43f7793bcbf2ddb868d4fce837f30655fb1bead5
[openwrt/svn-archive/archive.git] / net / mini_httpd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mini-httpd
12 PKG_VERSION:=1.19
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=792a529dfe974355aad8ba6c80e54e7a
15
16 PKG_SOURCE_URL:=http://www.acme.com/software/mini_httpd/
17 PKG_SOURCE:=mini_httpd-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/mini-httpd
25 SECTION:=net
26 CATEGORY:=Network
27 SUBMENU:=A small web server
28 DESCRIPTION:=mini_httpd is a small HTTP server. Its performance is not great, but for\\\
29 low or medium traffic sites it's quite adequate. It implements all the\\\
30 basic features of an HTTP server, including:\\\
31 \\\
32 * GET, HEAD, and POST methods.\\\
33 * CGI.\\\
34 * Basic authentication.\\\
35 * Security against ".." filename snooping.\\\
36 * The common MIME types.\\\
37 * Trailing-slash redirection.\\\
38 * index.html, index.htm, index.cgi\\\
39 * Directory listings.\\\
40 * Multihoming / virtual hosting.\\\
41 * Standard logging.\\\
42 * Custom error pages.\\\
43 \\\
44 It can also be configured to do IPv6.\\\
45 URL:=http://www.acme.com/software/mini_httpd/
46 endef
47
48 define Package/mini-httpd-htpasswd
49 $(call Package/mini-httpd)
50 TITLE:=Utility to generate HTTP access files
51 DESCRIPTION:=This file generates .htaccess/.htpasswd files to use HTTP access authentication\\\
52 endef
53
54 define Package/mini-httpd-matrixssl
55 $(call Package/mini-httpd)
56 TITLE:=A small web server, built with SSL support using MatrixSSL
57 DESCRIPTION:=mini_httpd is a small HTTP server. Its performance is not great, but for\\\
58 low or medium traffic sites it's quite adequate. It implements all the\\\
59 basic features of an HTTP server, including:\\\
60 \\\
61 * GET, HEAD, and POST methods.\\\
62 * CGI.\\\
63 * Basic authentication.\\\
64 * Security against ".." filename snooping.\\\
65 * The common MIME types.\\\
66 * Trailing-slash redirection.\\\
67 * index.html, index.htm, index.cgi\\\
68 * Directory listings.\\\
69 * Multihoming / virtual hosting.\\\
70 * Standard logging.\\\
71 * Custom error pages.\\\
72 \\\
73 It can also be configured to do SSL/HTTPS and IPv6.\\\
74 endef
75
76 define Package/mini-httpd-openssl
77 $(call BuildPackage,mini-httpd)
78 TITLE:=A small web server, built with SSL support using OpenSSL
79 DESCRIPTION:=mini_httpd is a small HTTP server. Its performance is not great, but for\\\
80 low or medium traffic sites it's quite adequate. It implements all the\\\
81 basic features of an HTTP server, including:\\\
82 \\\
83 * GET, HEAD, and POST methods.\\\
84 * CGI.\\\
85 * Basic authentication.\\\
86 * Security against ".." filename snooping.\\\
87 * The common MIME types.\\\
88 * Trailing-slash redirection.\\\
89 * index.html, index.htm, index.cgi\\\
90 * Directory listings.\\\
91 * Multihoming / virtual hosting.\\\
92 * Standard logging.\\\
93 * Custom error pages.\\\
94 \\\
95 It can also be configured to do SSL/HTTPS and IPv6.\\\
96 endef
97
98 define Build/Configure
99 $(CP) ./files/matrixssl_helper.{c,h} $(PKG_BUILD_DIR)/
100 enddef
101
102 define Build/Compile
103 # with MatrixSSL
104 ifneq ($(BR2_PACKAGE_MINI_HTTPD_MATRIXSSL),)
105 $(MAKE) -C $(PKG_BUILD_DIR) \
106 CC=$(TARGET_CC) \
107 OFLAGS="$(TARGET_CFLAGS)" \
108 SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \
109 SSL_INC="-I$(STAGING_DIR)/usr/include" \
110 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \
111 SSL_OBJS="matrixssl_helper.o" \
112 all
113 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; )
114 $(MAKE) -C $(PKG_BUILD_DIR) clean
115 endif
116 # with OpenSSL
117 ifneq ($(BR2_PACKAGE_MINI_HTTPD_OPENSSL),)
118 $(MAKE) -C $(PKG_BUILD_DIR) \
119 CC=$(TARGET_CC) \
120 OFLAGS="$(TARGET_CFLAGS)" \
121 SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
122 SSL_INC="-I$(STAGING_DIR)/usr/include" \
123 SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto" \
124 all
125 (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; )
126 $(MAKE) -C $(PKG_BUILD_DIR) clean
127 endif
128 # without SSL
129 ifneq ($(BR2_PACKAGE_MINI_HTTPD),)
130 $(MAKE) -C $(PKG_BUILD_DIR) \
131 CC=$(TARGET_CC) \
132 OFLAGS="$(TARGET_CFLAGS)" \
133 all
134 endif
135 touch $@
136
137 $(IPKG_MINI_HTTPD):
138 install -d -m0755 $(IDIR_MINI_HTTPD)/etc
139 install -m0644 ./files/mini_httpd.conf $(IDIR_MINI_HTTPD)/etc/mini_httpd.conf
140 install -d -m0755 $(IDIR_MINI_HTTPD)/etc/default
141 install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD)/etc/default/mini_httpd
142 install -d -m0755 $(IDIR_MINI_HTTPD)/etc/init.d
143 install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD)/etc/init.d/mini_httpd
144 install -d -m0755 $(IDIR_MINI_HTTPD)/usr/sbin
145 install -m0755 $(PKG_BUILD_DIR)/mini_httpd $(IDIR_MINI_HTTPD)/usr/sbin/
146 $(RSTRIP) $(IDIR_MINI_HTTPD)
147 $(IPKG_BUILD) $(IDIR_MINI_HTTPD) $(PACKAGE_DIR)
148
149 $(IPKG_MINI_HTTPD_HTPASSWD):
150 install -d -m0755 $(IDIR_MINI_HTTPD_HTPASSWD)/usr/sbin
151 install -m0755 $(PKG_BUILD_DIR)/htpasswd $(IDIR_MINI_HTTPD_HTPASSWD)/usr/sbin/
152 $(RSTRIP) $(IDIR_MINI_HTTPD_HTPASSWD)
153 $(IPKG_BUILD) $(IDIR_MINI_HTTPD_HTPASSWD) $(PACKAGE_DIR)
154
155 $(IPKG_MINI_HTTPD_MATRIXSSL):
156 install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc
157 install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/mini_httpd.conf
158 install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/
159 install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default
160 install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default/mini_httpd
161 install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d
162 install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d/mini_httpd
163 install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin
164 install -m0755 $(PKG_BUILD_DIR)/mini_httpd-matrixssl $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin/mini_httpd
165 $(RSTRIP) $(IDIR_MINI_HTTPD_MATRIXSSL)
166 $(IPKG_BUILD) $(IDIR_MINI_HTTPD_MATRIXSSL) $(PACKAGE_DIR)
167
168 $(IPKG_MINI_HTTPD_OPENSSL):
169 install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc
170 install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_OPENSSL)/etc/mini_httpd.conf
171 install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_OPENSSL)/etc/
172 install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/default
173 install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_OPENSSL)/etc/default/mini_httpd
174 install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d
175 install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d/mini_httpd
176 install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin
177 install -m0755 $(PKG_BUILD_DIR)/mini_httpd-openssl $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin/mini_httpd
178 $(RSTRIP) $(IDIR_MINI_HTTPD_OPENSSL)
179 $(IPKG_BUILD) $(IDIR_MINI_HTTPD_OPENSSL) $(PACKAGE_DIR)