Changeset 8677


Ignore:
Timestamp:
2007-09-07T21:37:59+02:00 (10 years ago)
Author:
nico
Message:

fix multi-packages builds, cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/mini_httpd/Makefile

    r5980 r8677  
    1313PKG_RELEASE:=1 
    1414 
    15 PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION) 
    1615PKG_SOURCE:=mini_httpd-$(PKG_VERSION).tar.gz 
    1716PKG_SOURCE_URL:=http://www.acme.com/software/mini_httpd/ 
    1817PKG_MD5SUM:=792a529dfe974355aad8ba6c80e54e7a 
    19 PKG_CAT:=zcat 
     18 
     19PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION) 
    2020 
    2121include $(INCLUDE_DIR)/package.mk 
    2222 
    23 define Package/mini-httpd 
     23define Package/mini-httpd/Default 
    2424  SECTION:=net 
    2525  CATEGORY:=Network 
    2626  TITLE:=A small web server 
    27   DESCRIPTION:=mini_httpd is a small HTTP server. Its performance is not great, but for \\\ 
    28     low or medium traffic sites it's quite adequate. It implements all the \\\ 
    29     basic features of an HTTP server, including: \\\ 
    30     \\\ 
    31       * GET, HEAD, and POST methods.\\\ 
    32       * CGI.\\\ 
    33       * Basic authentication.\\\ 
    34       * Security against ".." filename snooping.\\\ 
    35       * The common MIME types.\\\ 
    36       * Trailing-slash redirection.\\\ 
    37       * index.html, index.htm, index.cgi\\\ 
    38       * Directory listings.\\\ 
    39       * Multihoming / virtual hosting.\\\ 
    40       * Standard logging.\\\ 
    41       * Custom error pages.\\\ 
    42     \\\ 
    43     It can also be configured to do IPv6. 
    4427  URL:=http://www.acme.com/software/mini_httpd/ 
    4528endef 
    4629 
    47 define Package/mini-httpd/conffiles 
     30define Package/mini-httpd/Default/conffiles 
    4831/etc/mini_httpd.conf 
    4932/etc/default/mini_httpd 
    5033endef 
    5134 
    52 define Package/mini-httpd-htpasswd 
    53   $(call Package/mini-httpd) 
    54   TITLE:=Utility to generate HTTP access files 
    55   DESCRIPTION+=This package generates .htaccess/.htpasswd files to use HTTP access authentication 
     35define Package/mini-httpd/Default/description 
     36 mini_httpd is a small HTTP server. Its performance is not great, but for  
     37 low or medium traffic sites it's quite adequate. It implements all the  
     38 basic features of an HTTP server, including:  
     39 - GET, HEAD, and POST methods 
     40 - CGI 
     41 - Basic authentication 
     42 - Security against ".." filename snooping 
     43 - The common MIME types 
     44 - Trailing-slash redirection 
     45 - index.html, index.htm, index.cgi 
     46 - Directory listings 
     47 - Multihoming / virtual hosting 
     48 - Standard logging 
     49 - Custom error pages 
     50 It can also be configured to do IPv6. 
     51endef 
     52 
     53define Package/mini-httpd 
     54$(call Package/mini-httpd/Default) 
     55endef 
     56 
     57define Package/mini-httpd/conffiles 
     58$(call Package/mini-httpd/Default/conffiles) 
     59endef 
     60 
     61define Package/mini-httpd/description 
     62$(call Package/mini-httpd/Default/description) 
    5663endef 
    5764 
    5865define Package/mini-httpd-matrixssl 
    59   $(call Package/mini-httpd) 
    60   DEPENDS:=+libmatrixssl 
    61   TITLE:=A small web server, built with SSL support using MatrixSSL 
    62   DESCRIPTION+=This package adds SSL/HTTPS. (MatrixSSL) 
     66$(call Package/mini-httpd/Default) 
     67  DEPENDS:= +libmatrixssl 
     68  TITLE+= (built with MatrixSSL) 
    6369endef 
    6470 
    6571define Package/mini-httpd-matrixssl/conffiles 
    66 /etc/mini_httpd.conf 
     72$(call Package/mini-httpd/Default/conffiles) 
    6773/etc/mini_httpd.pem 
    68 /etc/default/mini_httpd 
     74endef 
     75 
     76define Package/mini-httpd-matrixssl/description 
     77$(call Package/mini-httpd/Default/description) 
     78 This package is built with SSL/HTTPS using MatrixSSL. 
    6979endef 
    7080 
    7181define Package/mini-httpd-openssl 
    72   $(call Package/mini-httpd) 
    73   DEPENDS:=+libopenssl 
    74   TITLE:=A small web server, built with SSL support using OpenSSL 
    75   DESCRIPTION+=This package adds SSL/HTTPS. (OpenSSL) 
     82$(call Package/mini-httpd/Default) 
     83  DEPENDS:= +libopenssl 
     84  TITLE+= (built with OpenSSL) 
    7685endef 
    7786 
    7887define Package/mini-httpd-openssl/conffiles 
    79 /etc/mini_httpd.conf 
     88$(call Package/mini-httpd/Default/conffiles) 
    8089/etc/mini_httpd.pem 
    81 /etc/default/mini_httpd 
    8290endef 
    8391 
    84 ifneq ($(SDK),) 
    85   CONFIG_PACKAGE_mini-httpd:=m 
    86   CONFIG_PACKAGE_mini-httpd-matrixssl:=m 
    87   CONFIG_PACKAGE_mini-httpd-openssl:=m 
     92define Package/mini-httpd-openssl/description 
     93$(call Package/mini-httpd/Default/description) 
     94 This package is built with SSL/HTTPS using OpenSSL. 
     95endef 
     96 
     97define Package/mini-httpd-htpasswd 
     98  $(call Package/mini-httpd/Default) 
     99  TITLE:=Utility to generate HTTP access files 
     100endef 
     101 
     102define Package/mini-httpd-htpasswd/description 
     103$(call Package/mini-httpd/Default/description) 
     104 This package generates .htaccess/.htpasswd files to use HTTP access authentication. 
     105endef 
     106 
     107 
     108define Build/Template 
     109 
     110$(STAMP_BUILT)-$(2): $(STAMP_PREPARED) 
     111        -$(MAKE) -C $(PKG_BUILD_DIR) clean 
     112        $(MAKE) -C $(PKG_BUILD_DIR) \ 
     113                $(TARGET_CONFIGURE_OPTS) \ 
     114                OFLAGS="$(TARGET_CFLAGS)" \ 
     115                $(3) \ 
     116                all 
     117        ( cd $(PKG_BUILD_DIR); mv -f mini_httpd mini_httpd-$(2) ) 
     118        touch $$@ 
     119 
     120$(STAMP_BUILT): $(STAMP_BUILT)-$(2) 
     121 
     122define Package/$(1)/install 
     123        $(INSTALL_DIR) $$(1)/etc 
     124ifeq ($(2),without-ssl) 
     125        $(INSTALL_DATA) ./files/mini_httpd.conf $$(1)/etc/mini_httpd.conf 
     126else 
     127        $(INSTALL_DATA) ./files/mini_httpd-ssl.conf $$(1)/etc/mini_httpd.conf 
     128        $(INSTALL_CONF) ./files/mini_httpd.pem $$(1)/etc/mini_httpd.pem 
    88129endif 
     130        $(INSTALL_DIR) $$(1)/etc/default 
     131        $(INSTALL_DATA) ./files/mini_httpd.default $$(1)/etc/default/mini_httpd 
     132        $(INSTALL_DIR) $$(1)/etc/init.d 
     133        $(INSTALL_BIN) ./files/mini_httpd.init $$(1)/etc/init.d/mini_httpd 
     134        $(INSTALL_DIR) $$(1)/usr/sbin 
     135        $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd-$(2) $$(1)/usr/sbin/mini_httpd 
     136endef 
    89137 
    90 define Build/Configure 
     138endef 
     139 
     140 
     141define Build/Prepare 
     142$(call Build/Prepare/Default) 
    91143        $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/ 
    92144endef 
    93145 
    94 define Build/Compile     
    95         # with MatrixSSL 
    96   ifneq ($(CONFIG_PACKAGE_mini-httpd-matrixssl),) 
    97         $(MAKE) -C $(PKG_BUILD_DIR) \ 
    98                 $(TARGET_CONFIGURE_OPTS) \ 
    99                 OFLAGS="$(TARGET_CFLAGS)" \ 
    100                 SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \ 
    101                 SSL_INC="-I$(STAGING_DIR)/usr/include" \ 
    102                 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \ 
    103                 SSL_OBJS="matrixssl_helper.o" \ 
    104                 all 
    105         (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; ) 
    106         $(MAKE) -C $(PKG_BUILD_DIR) clean 
    107   endif 
    108         # with OpenSSL 
    109   ifneq ($(CONFIG_PACKAGE_mini-httpd-openssl),) 
    110         $(MAKE) -C $(PKG_BUILD_DIR) \ 
    111                 $(TARGET_CONFIGURE_OPTS) \ 
    112                 OFLAGS="$(TARGET_CFLAGS)" \ 
    113                 SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \ 
    114                 SSL_INC="-I$(STAGING_DIR)/usr/include" \ 
    115                 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto" \ 
    116                 all 
    117         (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; ) 
    118         $(MAKE) -C $(PKG_BUILD_DIR) clean 
    119   endif 
    120         # without SSL 
    121   ifneq ($(CONFIG_PACKAGE_mini-httpd),) 
    122         $(MAKE) -C $(PKG_BUILD_DIR) \ 
    123                 $(TARGET_CONFIGURE_OPTS) \ 
    124                 OFLAGS="$(TARGET_CFLAGS)" \ 
    125                 all 
    126   endif 
     146define Build/Configure 
    127147endef 
    128148 
    129 define Package/mini-httpd/install 
    130         $(INSTALL_DIR) $(1)/etc 
    131         $(INSTALL_DATA) ./files/mini_httpd.conf $(1)/etc/mini_httpd.conf 
    132         $(INSTALL_DIR) $(1)/etc/default 
    133         $(INSTALL_DATA) ./files/mini_httpd.default $(1)/etc/default/mini_httpd 
    134         $(INSTALL_DIR) $(1)/etc/init.d 
    135         $(INSTALL_BIN) ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd 
    136         $(INSTALL_DIR) $(1)/usr/sbin 
    137         $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd $(1)/usr/sbin/mini_httpd 
     149define Build/Compile 
    138150endef 
     151 
     152# always build without SSL because we might need htpassd 
     153define Build/without-ssl 
     154  $(call Build/Template,minit-httpd,without-ssl,) 
     155endef 
     156$(eval $(Build/without-ssl)) 
     157 
     158ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-matrixssl),) 
     159  define Build/with-matrixssl 
     160    $(call Build/Template,mini-httpd-matrixssl,with-matrixssl, \ 
     161                SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \ 
     162                SSL_INC="$(TARGET_CPPFLAGS)" \ 
     163                SSL_LIBS="$(TARGET_LDFLAGS) -lmatrixssl" \ 
     164                SSL_OBJS="matrixssl_helper.o" \ 
     165    ) 
     166  endef 
     167endif 
     168$(eval $(Build/with-matrixssl)) 
     169 
     170ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-openssl),) 
     171  define Build/with-openssl 
     172    $(call Build/Template,minit-httpd-openssl,with-openssl, \ 
     173                SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \ 
     174                SSL_INC="$(TARGET_CPPFLAGS)" \ 
     175                SSL_LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl" \ 
     176    ) 
     177  endef 
     178endif 
     179$(eval $(Build/with-openssl)) 
    139180 
    140181define Package/mini-httpd-htpasswd/install 
     
    143184endef 
    144185 
    145 define Package/mini-httpd-matrixssl/install 
    146         $(INSTALL_DIR) $(1)/etc 
    147         $(INSTALL_DATA) ./files/mini_httpd-ssl.conf $(1)/etc/mini_httpd.conf 
    148         $(INSTALL_CONF) ./files/mini_httpd.pem $(1)/etc/mini_httpd.pem 
    149         $(INSTALL_DIR) $(1)/etc/default 
    150         $(INSTALL_DATA) ./files/mini_httpd.default $(1)/etc/default/mini_httpd 
    151         $(INSTALL_DIR) $(1)/etc/init.d 
    152         $(INSTALL_BIN) ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd 
    153         $(INSTALL_DIR) $(1)/usr/sbin 
    154         $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd-matrixssl $(1)/usr/sbin/mini_httpd 
    155 endef 
    156  
    157 define Package/mini-httpd-openssl/install 
    158         $(INSTALL_DIR) $(1)/etc 
    159         $(INSTALL_DATA) ./files/mini_httpd-ssl.conf $(1)/etc/mini_httpd.conf 
    160         $(INSTALL_CONF) ./files/mini_httpd.pem $(1)/etc/mini_httpd.pem 
    161         $(INSTALL_DIR) $(1)/etc/default 
    162         $(INSTALL_DATA) ./files/mini_httpd.default $(1)/etc/default/mini_httpd 
    163         $(INSTALL_DIR) $(1)/etc/init.d 
    164         $(INSTALL_BIN) ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd 
    165         $(INSTALL_DIR) $(1)/usr/sbin 
    166         $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd-openssl $(1)/usr/sbin/mini_httpd 
    167 endef 
    168  
    169186$(eval $(call BuildPackage,mini-httpd)) 
    170 $(eval $(call BuildPackage,mini-httpd-htpasswd)) 
    171187$(eval $(call BuildPackage,mini-httpd-matrixssl)) 
    172188$(eval $(call BuildPackage,mini-httpd-openssl)) 
     189$(eval $(call BuildPackage,mini-httpd-htpasswd)) 
Note: See TracChangeset for help on using the changeset viewer.