Hello,

My own two cents.
I tried to implement it the VARIANT way, and I ended with (basically)
repeating everything twice in the Makefile. See attached for details.
If someone knows a better way, or if I messed up this patch,
I'm ready to listen to criticism.

Another way I tried (and I already posted the patches on this list [1])
is to use a CONFIG symbol that lets you choose wether you want to use
openssl or not. The changes in the lighttpd Makefile are less invasive
and the end result is quite similar (modulo the fact that you cannot
build the two versions at the same time).

Best regards,

-- Emmanuel Deloget

[1] http://patchwork.openwrt.org/patch/1924/

Le 19/03/2012 15:05, Peter Wagner a écrit :
both packaes are build in a sepreate folders
so yes - you can select both packages.

But you can also building both and testing it ;)

/Peter
On Monday 19 March 2012 13:24:24 edgar.sol...@web.de wrote:
had a look at irssi. does this actually work when both packages are
selected? don't you end up with two packages both containing whatever was
build first?

..ede

On 19.03.2012 13:18, Peter Wagner wrote:
Hi,

look at the ctorrent or irssi Makefile. There you can see how to
implement the nossl stuff in one Makefile.

Regards,
Peter

On Monday 19 March 2012 12:05:31 Christiane Ruetten wrote:
Hi Edgar,

  just to be explicit: the idea is to have lighttpd-nossl in the

official repo so I can get away with distributing a single
platform-independent opkg. So I was hoping that the current
maintainer could simply add a -nossl build instead of me having
to reproduce the complete build effort.

What I could do, though, is provide for a package/lighttpd-nossl/
Makefile and company and someone else adds it to the official
build system, but chances are that testing my changes, and generally
making sure I didn't screw up might surpass the effort that
a knowledgable maintainer requires for a copy/modify operation
on the current package repo.

I might be wrong there, and am grateful for any advice on
how to proceed.

Cheers,
Christiane

Am 19.03.12 11:30, schrieb edgar.sol...@web.de:
On 19.03.2012 10:52, Christiane Ruetten wrote:
Hi,

  would you be able to easily add a variant of the lighttpd

package without the massive libopenssl dependency? It is almost
completely filling up the flash in 4 MByte routers, leaving
almost no headroom for further functionality, and https is not
always required.

  I am currently in the process of rewriting the PirateBox

wifi deaddrop service in an OpenWRT-friendly way. The current
target router chosen by the PirateBox community is the
TL-MR3020 which unfortunately only has 4 MByte flash.
Installing just lighttpd with rewrite and cgi and minimal
modules for USB storage takes the system from 1.4M to under
100K of free flash.
hi christiane,

take a look at the lighttpd makefile

  https://dev.openwrt.org/browser/packages/net/lighttpd/Makefile

how webdav is build in as selectable package.

you could do something similar to the currently hard coded openssl
support.

..ede
Index: packages/net/lighttpd/Makefile
===================================================================
--- packages/net/lighttpd/Makefile	(révision 31021)
+++ packages/net/lighttpd/Makefile	(copie de travail)
@@ -9,7 +9,7 @@
 
 PKG_NAME:=lighttpd
 PKG_VERSION:=1.4.30
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
@@ -18,6 +18,8 @@
 PKG_FIXUP:=libtool
 PKG_INSTALL:=1
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/lighttpd/Default
@@ -25,186 +27,340 @@
   SECTION:=net
   CATEGORY:=Network
   URL:=http://www.lighttpd.net/
+  TITLE:=A flexible and lightweight web server
+  MENU:=1
+  DEPENDS:=+libpcre +libpthread
 endef
 
 define Package/lighttpd
   $(call Package/lighttpd/Default)
-  MENU:=1
-  DEPENDS:=+libopenssl +libpcre +libpthread
-  TITLE:=A flexible and lightweight web server
+  DEPENDS+=+libopenssl
+  VARIANT:=ssl
 endef
 
+define Package/lighttpd-nossl
+  $(call Package/lighttpd/Default)
+  TITLE+=(without SSL)
+  VARIANT:=nossl
+endef
+
+define Package/lighttpd-module/Default
+  SUBMENU:=Web Servers/Proxies
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://www.lighttpd.net/
+  DEPENDS:=$(1)
+endef
+
 define Package/lighttpd-mod-access
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Access restrictions module
 endef
 
 define Package/lighttpd-mod-accesslog
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Access logging module
 endef
 
 define Package/lighttpd-mod-alias
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Directory alias module
 endef
 
 define Package/lighttpd-mod-auth
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Authentication module
 endef
 
 define Package/lighttpd-mod-cgi
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=CGI module
 endef
 
 define Package/lighttpd-mod-cml
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Cache Meta Language module
 endef
 
 define Package/lighttpd-mod-compress
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +zlib
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+zlib
   TITLE:=Compress output module
 endef
 
 define Package/lighttpd-mod-evasive
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Evasive module
 endef
 
 define Package/lighttpd-mod-evhost
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Exnhanced Virtual-Hosting module
 endef
 
 define Package/lighttpd-mod-expire
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Expire module
 endef
 
 define Package/lighttpd-mod-extforward
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Extract client IP module
 endef
 
 define Package/lighttpd-mod-fastcgi
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=FastCGI module
 endef
 
 define Package/lighttpd-mod-flv-streaming
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=flv streaming module
 endef
 
 define Package/lighttpd-mod-magnet
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=magnet module
 endef
 
 define Package/lighttpd-mod-mysql-vhost
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libmysqlclient
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libmysqlclient
   TITLE:=Mysql virtual hosting module
 endef
 
 define Package/lighttpd-mod-proxy
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Proxy module
 endef
 
 define Package/lighttpd-mod-redirect
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libpcre
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libpcre
   TITLE:=URL redirection module
 endef
 
 define Package/lighttpd-mod-rewrite
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libpcre
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libpcre
   TITLE:=URL rewriting module
 endef
 
 define Package/lighttpd-mod-rrdtool
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=rrdtool module
 endef
 
 define Package/lighttpd-mod-scgi
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=SCGI module
 endef
 
 define Package/lighttpd-mod-secdownload
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Secure and fast download module
 endef
 
 define Package/lighttpd-mod-setenv
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Environment variable setting module
 endef
 
 define Package/lighttpd-mod-simple-vhost
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Simple virtual hosting module
 endef
 
 define Package/lighttpd-mod-ssi
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libpcre
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libpcre
   TITLE:=SSI module
 endef
 
 define Package/lighttpd-mod-status
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=Server status display module
 endef
 
 define Package/lighttpd-mod-trigger-b4-dl
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libpcre
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libpcre
   TITLE:=Trigger before download module
 endef
 
 define Package/lighttpd-mod-userdir
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=User directory module
 endef
 
 define Package/lighttpd-mod-usertrack
-  $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd
+  $(call Package/lighttpd-module/Default,lighttpd)
   TITLE:=User tracking module
 endef
 
 define Package/lighttpd-mod-webdav
+  $(call Package/lighttpd-module/Default,lighttpd)
+  DEPENDS+=+libsqlite3 +libuuid +libxml2
+  TITLE:=WebDAV module
+endef
+
+# nossl variant
+
+define Package/lighttpd-nossl
   $(call Package/lighttpd/Default)
-  DEPENDS:=lighttpd +libsqlite3 +libuuid +libxml2
+  TITLE+=(without SSL)
+  VARIANT:=nossl
+endef
+
+define Package/lighttpd-mod-access-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Access restrictions module
+endef
+
+define Package/lighttpd-mod-accesslog-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Access logging module
+endef
+
+define Package/lighttpd-mod-alias-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Directory alias module
+endef
+
+define Package/lighttpd-mod-auth-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Authentication module
+endef
+
+define Package/lighttpd-mod-cgi-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=CGI module
+endef
+
+define Package/lighttpd-mod-cml-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Cache Meta Language module
+endef
+
+define Package/lighttpd-mod-compress-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+zlib
+  TITLE:=Compress output module
+endef
+
+define Package/lighttpd-mod-evasive-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Evasive module
+endef
+
+define Package/lighttpd-mod-evhost-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Exnhanced Virtual-Hosting module
+endef
+
+define Package/lighttpd-mod-expire-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Expire module
+endef
+
+define Package/lighttpd-mod-extforward-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Extract client IP module
+endef
+
+define Package/lighttpd-mod-fastcgi-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=FastCGI module
+endef
+
+define Package/lighttpd-mod-flv-streaming-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=flv streaming module
+endef
+
+define Package/lighttpd-mod-magnet-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=magnet module
+endef
+
+define Package/lighttpd-mod-mysql-vhost-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libmysqlclient
+  TITLE:=Mysql virtual hosting module
+endef
+
+define Package/lighttpd-mod-proxy-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Proxy module
+endef
+
+define Package/lighttpd-mod-redirect-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libpcre
+  TITLE:=URL redirection module
+endef
+
+define Package/lighttpd-mod-rewrite-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libpcre
+  TITLE:=URL rewriting module
+endef
+
+define Package/lighttpd-mod-rrdtool-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=rrdtool module
+endef
+
+define Package/lighttpd-mod-scgi-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=SCGI module
+endef
+
+define Package/lighttpd-mod-secdownload-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Secure and fast download module
+endef
+
+define Package/lighttpd-mod-setenv-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Environment variable setting module
+endef
+
+define Package/lighttpd-mod-simple-vhost-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Simple virtual hosting module
+endef
+
+define Package/lighttpd-mod-ssi-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libpcre
+  TITLE:=SSI module
+endef
+
+define Package/lighttpd-mod-status-nossl
+  $(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=Server status display module
+endef
+
+define Package/lighttpd-mod-trigger-b4-dl-nossl
+$(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libpcre
+  TITLE:=Trigger before download module
+endef
+
+define Package/lighttpd-mod-userdir-nossl
+$(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=User directory module
+endef
+
+define Package/lighttpd-mod-usertrack-nossl
+$(call Package/lighttpd-module/Default,lighttpd-nossl)
+  TITLE:=User tracking module
+endef
+
+define Package/lighttpd-mod-webdav-nossl
+$(call Package/lighttpd-module/Default,lighttpd-nossl)
+  DEPENDS+=+libsqlite3 +libuuid +libxml2
   TITLE:=WebDAV module
 endef
 
@@ -222,7 +378,6 @@
 	--without-lua \
 	--without-memcache \
 	--without-mysql \
-	--with-openssl="$(STAGING_DIR)/usr" \
 	--with-pcre \
 	--without-valgrind \
 	 $(call autoconf_bool,CONFIG_IPV6,ipv6)
@@ -243,6 +398,16 @@
 	--without-webdav-props
 endif
 
+ifeq ($(BUILD_VARIANT),ssl)
+  CONFIGURE_ARGS+= \
+	--with-openssl="$(STAGING_DIR)/usr"
+endif
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CONFIGURE_ARGS+= \
+	--without-openssl
+endif
+
 define Build/Configure
 $(call Build/Configure/Default)
 	# XXX: override pcre (mis)detection by ./configure when cross-compiling
@@ -267,6 +432,8 @@
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
 endef
 
+Package/lighttpd-nossl/install = $(Package/lighttpd/install)
+
 define BuildPlugin
   define Package/$(1)/install
 	[ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
@@ -307,3 +474,33 @@
 $(eval $(call BuildPlugin,lighttpd-mod-userdir,userdir))
 $(eval $(call BuildPlugin,lighttpd-mod-usertrack,usertrack))
 $(eval $(call BuildPlugin,lighttpd-mod-webdav,webdav))
+
+$(eval $(call BuildPackage,lighttpd-nossl))
+$(eval $(call BuildPlugin,lighttpd-mod-access-nossl,access))
+$(eval $(call BuildPlugin,lighttpd-mod-accesslog-nossl,accesslog))
+$(eval $(call BuildPlugin,lighttpd-mod-alias-nossl,alias))
+$(eval $(call BuildPlugin,lighttpd-mod-auth-nossl,auth))
+$(eval $(call BuildPlugin,lighttpd-mod-cgi-nossl,cgi))
+$(eval $(call BuildPlugin,lighttpd-mod-cml-nossl,cml))
+$(eval $(call BuildPlugin,lighttpd-mod-compress-nossl,compress))
+$(eval $(call BuildPlugin,lighttpd-mod-evasive-nossl,evasive))
+$(eval $(call BuildPlugin,lighttpd-mod-evhost-nossl,evhost))
+$(eval $(call BuildPlugin,lighttpd-mod-expire-nossl,expire))
+$(eval $(call BuildPlugin,lighttpd-mod-extforward-nossl,extforward))
+$(eval $(call BuildPlugin,lighttpd-mod-fastcgi-nossl,fastcgi))
+$(eval $(call BuildPlugin,lighttpd-mod-flv-streaming-nossl,flv_streaming))
+$(eval $(call BuildPlugin,lighttpd-mod-magnet-nossl,magnet))
+$(eval $(call BuildPlugin,lighttpd-mod-proxy-nossl,proxy))
+$(eval $(call BuildPlugin,lighttpd-mod-redirect-nossl,redirect))
+$(eval $(call BuildPlugin,lighttpd-mod-rewrite-nossl,rewrite))
+$(eval $(call BuildPlugin,lighttpd-mod-rrdtool-nossl,rrdtool))
+$(eval $(call BuildPlugin,lighttpd-mod-scgi-nossl,scgi))
+$(eval $(call BuildPlugin,lighttpd-mod-secdownload-nossl,secdownload))
+$(eval $(call BuildPlugin,lighttpd-mod-setenv-nossl,setenv))
+$(eval $(call BuildPlugin,lighttpd-mod-simple-vhost-nossl,simple_vhost))
+$(eval $(call BuildPlugin,lighttpd-mod-ssi-nossl,ssi))
+$(eval $(call BuildPlugin,lighttpd-mod-status-nossl,status))
+$(eval $(call BuildPlugin,lighttpd-mod-trigger-b4-dl-nossl,trigger_b4_dl))
+$(eval $(call BuildPlugin,lighttpd-mod-userdir-nossl,userdir))
+$(eval $(call BuildPlugin,lighttpd-mod-usertrack-nossl,usertrack))
+$(eval $(call BuildPlugin,lighttpd-mod-webdav-nossl,webdav))
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to