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.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=mini_httpd-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.acme.com/software/mini_httpd/
16 PKG_MD5SUM:=792a529dfe974355aad8ba6c80e54e7a
18 PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION)
20 include $(INCLUDE_DIR)/package.mk
22 define Package/mini-httpd/Default
23 SUBMENU:=Web Servers/Proxies
26 TITLE:=A small web server
27 URL:=http://www.acme.com/software/mini_httpd/
30 define Package/mini-httpd/Default/conffiles
32 /etc/default/mini_httpd
35 define 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
41 - Basic authentication
42 - Security against ".." filename snooping
43 - The common MIME types
44 - Trailing-slash redirection
45 - index.html, index.htm, index.cgi
47 - Multihoming / virtual hosting
50 It can also be configured to do IPv6.
53 define Package/mini-httpd
54 $(call Package/mini-httpd/Default)
57 define Package/mini-httpd/conffiles
58 $(call Package/mini-httpd/Default/conffiles)
61 define Package/mini-httpd/description
62 $(call Package/mini-httpd/Default/description)
65 define Package/mini-httpd-matrixssl
66 $(call Package/mini-httpd/Default)
67 DEPENDS:= +libmatrixssl
68 TITLE+= (built with MatrixSSL)
71 define Package/mini-httpd-matrixssl/conffiles
72 $(call Package/mini-httpd/Default/conffiles)
76 define Package/mini-httpd-matrixssl/description
77 $(call Package/mini-httpd/Default/description)
78 This package is built with SSL/HTTPS using MatrixSSL.
81 define Package/mini-httpd-openssl
82 $(call Package/mini-httpd/Default)
84 TITLE+= (built with OpenSSL)
87 define Package/mini-httpd-openssl/conffiles
88 $(call Package/mini-httpd/Default/conffiles)
92 define Package/mini-httpd-openssl/description
93 $(call Package/mini-httpd/Default/description)
94 This package is built with SSL/HTTPS using OpenSSL.
97 define Package/mini-httpd-htpasswd
98 $(call Package/mini-httpd/Default)
99 TITLE:=Utility to generate HTTP access files
102 define Package/mini-httpd-htpasswd/description
103 $(call Package/mini-httpd/Default/description)
104 This package generates .htaccess/.htpasswd files to use HTTP access authentication.
108 define Build/Template
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)" \
117 ( cd $(PKG_BUILD_DIR); mv -f mini_httpd mini_httpd-$(2) )
120 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
122 define Package/$(1)/install
123 $(INSTALL_DIR) $$(1)/etc
124 ifeq ($(2),without-ssl)
125 $(INSTALL_DATA) ./files/mini_httpd.conf $$(1)/etc/mini_httpd.conf
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
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
142 $(call Build/Prepare/Default)
143 $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/
146 define Build/Configure
152 # always build without SSL because we might need htpassd
153 define Build/without-ssl
154 $(call Build/Template,mini-httpd,without-ssl,)
156 $(eval $(Build/without-ssl))
158 ifneq ($(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" \
168 $(eval $(Build/with-matrixssl))
170 ifneq ($(SDK)$(CONFIG_PACKAGE_mini-httpd-openssl),)
171 define Build/with-openssl
172 $(call Build/Template,mini-httpd-openssl,with-openssl, \
173 SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
174 SSL_INC="$(TARGET_CPPFLAGS)" \
175 SSL_LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl" \
179 $(eval $(Build/with-openssl))
181 define Package/mini-httpd-htpasswd/install
182 $(INSTALL_DIR) $(1)/usr/sbin
183 $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpasswd $(1)/usr/sbin/
186 $(eval $(call BuildPackage,mini-httpd))
187 $(eval $(call BuildPackage,mini-httpd-matrixssl))
188 $(eval $(call BuildPackage,mini-httpd-openssl))
189 $(eval $(call BuildPackage,mini-httpd-htpasswd))