2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=mini_httpd-
$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=http
://www.acme.com
/software
/mini_httpd
/
17 PKG_MD5SUM
:=792a529dfe974355aad8ba6c80e54e7a
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/mini_httpd-
$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/mini-httpd
/Default
27 TITLE
:=A small web server
28 URL
:=http
://www.acme.com
/software
/mini_httpd
/
31 define Package
/mini-httpd
/Default
/conffiles
33 /etc
/default
/mini_httpd
36 define Package
/mini-httpd
/Default
/description
37 mini_httpd is a small HTTP server. Its performance is not great
, but for
38 low or medium traffic sites it
's quite adequate. It implements all the
39 basic features of an HTTP server, including:
40 - GET, HEAD, and POST methods
42 - Basic authentication
43 - Security against ".." filename snooping
44 - The common MIME types
45 - Trailing-slash redirection
46 - index.html, index.htm, index.cgi
48 - Multihoming / virtual hosting
51 It can also be configured to do IPv6.
54 define Package/mini-httpd
55 $(call Package/mini-httpd/Default)
58 define Package/mini-httpd/conffiles
59 $(call Package/mini-httpd/Default/conffiles)
62 define Package/mini-httpd/description
63 $(call Package/mini-httpd/Default/description)
66 define Package/mini-httpd-matrixssl
67 $(call Package/mini-httpd/Default)
68 DEPENDS:= +libmatrixssl
69 TITLE+= (built with MatrixSSL)
72 define Package/mini-httpd-matrixssl/conffiles
73 $(call Package/mini-httpd/Default/conffiles)
77 define Package/mini-httpd-matrixssl/description
78 $(call Package/mini-httpd/Default/description)
79 This package is built with SSL/HTTPS using MatrixSSL.
82 define Package/mini-httpd-openssl
83 $(call Package/mini-httpd/Default)
85 TITLE+= (built with OpenSSL)
88 define Package/mini-httpd-openssl/conffiles
89 $(call Package/mini-httpd/Default/conffiles)
93 define Package/mini-httpd-openssl/description
94 $(call Package/mini-httpd/Default/description)
95 This package is built with SSL/HTTPS using OpenSSL.
98 define Package/mini-httpd-htpasswd
99 $(call Package/mini-httpd/Default)
100 TITLE:=Utility to generate HTTP access files
103 define Package/mini-httpd-htpasswd/description
104 $(call Package/mini-httpd/Default/description)
105 This package generates .htaccess/.htpasswd files to use HTTP access authentication.
109 define Build/Template
111 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
112 -$(MAKE) -C $(PKG_BUILD_DIR) clean
113 $(MAKE) -C $(PKG_BUILD_DIR) \
114 $(TARGET_CONFIGURE_OPTS) \
115 OFLAGS="$(TARGET_CFLAGS)" \
118 ( cd $(PKG_BUILD_DIR); mv -f mini_httpd mini_httpd-$(2) )
121 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
123 define Package/$(1)/install
124 $(INSTALL_DIR) $$(1)/etc
125 ifeq ($(2),without-ssl)
126 $(INSTALL_DATA) ./files/mini_httpd.conf $$(1)/etc/mini_httpd.conf
128 $(INSTALL_DATA) ./files/mini_httpd-ssl.conf $$(1)/etc/mini_httpd.conf
129 $(INSTALL_CONF) ./files/mini_httpd.pem $$(1)/etc/mini_httpd.pem
131 $(INSTALL_DIR) $$(1)/etc/default
132 $(INSTALL_DATA) ./files/mini_httpd.default $$(1)/etc/default/mini_httpd
133 $(INSTALL_DIR) $$(1)/etc/init.d
134 $(INSTALL_BIN) ./files/mini_httpd.init $$(1)/etc/init.d/mini_httpd
135 $(INSTALL_DIR) $$(1)/usr/sbin
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mini_httpd-$(2) $$(1)/usr/sbin/mini_httpd
143 $(call Build/Prepare/Default)
144 $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/
147 define Build/Configure
153 # always build without SSL because we might need htpassd
154 define Build/without-ssl
155 $(call Build/Template,mini-httpd,without-ssl,)
157 $(eval $(Build/without-ssl))
159 ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-matrixssl),)
160 define Build/with-matrixssl
161 $(call Build/Template,mini-httpd-matrixssl,with-matrixssl, \
162 SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \
163 SSL_INC="$(TARGET_CPPFLAGS)" \
164 SSL_LIBS="$(TARGET_LDFLAGS) -lmatrixssl" \
165 SSL_OBJS="matrixssl_helper.o" \
169 $(eval $(Build/with-matrixssl))
171 ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-openssl),)
172 define Build/with-openssl
173 $(call Build/Template,mini-httpd-openssl,with-openssl, \
174 SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
175 SSL_INC="$(TARGET_CPPFLAGS)" \
176 SSL_LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl" \
180 $(eval $(Build/with-openssl))
182 define Package/mini-httpd-htpasswd/install
183 $(INSTALL_DIR) $(1)/usr/sbin
184 $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpasswd $(1)/usr/sbin/
187 $(eval $(call BuildPackage,mini-httpd))
188 $(eval $(call BuildPackage,mini-httpd-matrixssl))
189 $(eval $(call BuildPackage,mini-httpd-openssl))
190 $(eval $(call BuildPackage,mini-httpd-htpasswd))