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 TITLE:=A small web server, built with SSL support using MatrixSSL
61 DESCRIPTION+=This package adds SSL/HTTPS. (MatrixSSL)
64 define Package/mini-httpd-matrixssl/conffiles
67 /etc/default/mini_httpd
70 define Package/mini-httpd-openssl
71 $(call Package/mini-httpd)
72 TITLE:=A small web server, built with SSL support using OpenSSL
73 DESCRIPTION+=This package adds SSL/HTTPS. (OpenSSL)
76 define Package/mini-httpd-openssl/conffiles
79 /etc/default/mini_httpd
83 CONFIG_PACKAGE_mini-httpd:=m
84 CONFIG_PACKAGE_mini-httpd-matrixssl:=m
85 CONFIG_PACKAGE_mini-httpd-openssl:=m
88 define Build/Configure
89 $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/
94 ifneq ($(CONFIG_PACKAGE_mini-httpd-matrixssl),)
95 $(MAKE) -C $(PKG_BUILD_DIR) \
96 $(TARGET_CONFIGURE_OPTS) \
97 OFLAGS="$(TARGET_CFLAGS)" \
98 SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \
99 SSL_INC="-I$(STAGING_DIR)/usr/include" \
100 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \
101 SSL_OBJS="matrixssl_helper.o" \
103 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; )
104 $(MAKE) -C $(PKG_BUILD_DIR) clean
107 ifneq ($(CONFIG_PACKAGE_mini-httpd-openssl),)
108 $(MAKE) -C $(PKG_BUILD_DIR) \
109 $(TARGET_CONFIGURE_OPTS) \
110 OFLAGS="$(TARGET_CFLAGS)" \
111 SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
112 SSL_INC="-I$(STAGING_DIR)/usr/include" \
113 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto" \
115 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; )
116 $(MAKE) -C $(PKG_BUILD_DIR) clean
119 ifneq ($(CONFIG_PACKAGE_mini-httpd),)
120 $(MAKE) -C $(PKG_BUILD_DIR) \
121 $(TARGET_CONFIGURE_OPTS) \
122 OFLAGS="$(TARGET_CFLAGS)" \
127 define Package/mini-httpd/install
128 install -d -m0755 $(1)/etc
129 install -m0644 ./files/mini_httpd.conf $(1)/etc/mini_httpd.conf
130 install -d -m0755 $(1)/etc/default
131 install -m0644 ./files/mini_httpd.default $(1)/etc/default/mini_httpd
132 install -d -m0755 $(1)/etc/init.d
133 install -m0755 ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd
134 install -d -m0755 $(1)/usr/sbin
135 install -m0755 $(PKG_BUILD_DIR)/mini_httpd $(1)/usr/sbin/mini_httpd
138 define Package/mini-httpd-htpasswd/install
139 install -d -m0755 $(1)/usr/sbin
140 install -m0755 $(PKG_BUILD_DIR)/htpasswd $(1)/usr/sbin/
143 define Package/mini-httpd-matrixssl/install
144 install -d -m0755 $(1)/etc
145 install -m0644 ./files/mini_httpd-ssl.conf $(1)/etc/mini_httpd.conf
146 install -m0600 ./files/mini_httpd.pem $(1)/etc/mini_httpd.pem
147 install -d -m0755 $(1)/etc/default
148 install -m0644 ./files/mini_httpd.default $(1)/etc/default/mini_httpd
149 install -d -m0755 $(1)/etc/init.d
150 install -m0755 ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd
151 install -d -m0755 $(1)/usr/sbin
152 install -m0755 $(PKG_BUILD_DIR)/mini_httpd-matrixssl $(1)/usr/sbin/mini_httpd
155 define Package/mini-httpd-openssl/install
156 install -d -m0755 $(1)/etc
157 install -m0644 ./files/mini_httpd-ssl.conf $(1)/etc/mini_httpd.conf
158 install -m0600 ./files/mini_httpd.pem $(1)/etc/mini_httpd.pem
159 install -d -m0755 $(1)/etc/default
160 install -m0644 ./files/mini_httpd.default $(1)/etc/default/mini_httpd
161 install -d -m0755 $(1)/etc/init.d
162 install -m0755 ./files/mini_httpd.init $(1)/etc/init.d/mini_httpd
163 install -d -m0755 $(1)/usr/sbin
164 install -m0755 $(PKG_BUILD_DIR)/mini_httpd-openssl $(1)/usr/sbin/mini_httpd
167 $(eval $(call BuildPackage,mini-httpd))
168 $(eval $(call BuildPackage,mini-httpd-htpasswd))
169 $(eval $(call BuildPackage,mini-httpd-matrixssl))
170 $(eval $(call BuildPackage,mini-httpd-openssl))