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_BUILD_DIR
:=$(BUILD_DIR
)/mini_httpd-
$(PKG_VERSION
)
16 PKG_SOURCE
:=mini_httpd-
$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=http
://www.acme.com
/software
/mini_httpd
/
18 PKG_MD5SUM
:=792a529dfe974355aad8ba6c80e54e7a
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/mini-httpd
26 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: \\\
31 * GET, HEAD, and POST methods.\\\
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.\\\
43 It can also be configured to do IPv6.
44 URL:=http://www.acme.com/software/mini_httpd/
47 define Package/mini-httpd/conffiles
49 /etc/default/mini_httpd
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
58 define 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)
65 define Package/mini-httpd-matrixssl/conffiles
68 /etc/default/mini_httpd
71 define Package/mini-httpd-openssl
72 $(call Package/mini-httpd)
74 TITLE:=A small web server, built with SSL support using OpenSSL
75 DESCRIPTION+=This package adds SSL/HTTPS. (OpenSSL)
78 define Package/mini-httpd-openssl/conffiles
81 /etc/default/mini_httpd
85 CONFIG_PACKAGE_mini-httpd:=m
86 CONFIG_PACKAGE_mini-httpd-matrixssl:=m
87 CONFIG_PACKAGE_mini-httpd-openssl:=m
90 define Build/Configure
91 $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/
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" \
105 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; )
106 $(MAKE) -C $(PKG_BUILD_DIR) clean
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" \
117 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; )
118 $(MAKE) -C $(PKG_BUILD_DIR) clean
121 ifneq ($(CONFIG_PACKAGE_mini-httpd),)
122 $(MAKE) -C $(PKG_BUILD_DIR) \
123 $(TARGET_CONFIGURE_OPTS) \
124 OFLAGS="$(TARGET_CFLAGS)" \
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
140 define Package/mini-httpd-htpasswd/install
141 $(INSTALL_DIR) $(1)/usr/sbin
142 $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpasswd $(1)/usr/sbin/
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 -m0600 ./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
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 -m0600 ./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
169 $(eval $(call BuildPackage,mini-httpd))
170 $(eval $(call BuildPackage,mini-httpd-htpasswd))
171 $(eval $(call BuildPackage,mini-httpd-matrixssl))
172 $(eval $(call BuildPackage,mini-httpd-openssl))