Tcl build fix
[gumsense-br.git] / package / thttpd / thttpd.mk
blob24dd149f0e258116f1ce3dc88524d6af82744c84
1 #############################################################
3 # thttpd
5 #############################################################
6 THTTPD_VER:=2.25b
7 THTTPD_SOURCE:=thttpd-$(THTTPD_VER).tar.gz
8 THTTPD_SITE:=http://www.acme.com/software/thttpd/
9 THTTPD_DIR:=$(BUILD_DIR)/thttpd-$(THTTPD_VER)
10 THTTPD_CAT:=zcat
11 THTTPD_BINARY:=thttpd
12 THTTPD_TARGET_BINARY:=sbin/thttpd
13 THTTPD_ROOT:=/var
14 THTTPD_WEB_DIR:=$(THTTPD_ROOT)/www
16 $(DL_DIR)/$(THTTPD_SOURCE):
17 $(WGET) -P $(DL_DIR) $(THTTPD_SITE)/$(THTTPD_SOURCE)
19 $(THTTPD_DIR)/.unpacked: $(DL_DIR)/$(THTTPD_SOURCE)
20 $(THTTPD_CAT) $(DL_DIR)/$(THTTPD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
21 touch $(THTTPD_DIR)/.unpacked
23 $(THTTPD_DIR)/.configured: $(THTTPD_DIR)/.unpacked
24 (cd $(THTTPD_DIR); rm -rf config.cache; \
25 $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
26 CFLAGS="$(TARGET_CFLAGS)" \
27 ./configure \
28 --target=$(GNU_TARGET_NAME) \
29 --host=$(GNU_TARGET_NAME) \
30 --build=$(GNU_HOST_NAME) \
31 --prefix=$(THTTPD_ROOT) \
33 touch $(THTTPD_DIR)/.configured
35 $(THTTPD_DIR)/$(THTTPD_BINARY): $(THTTPD_DIR)/.configured
36 $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(THTTPD_DIR)
38 $(TARGET_DIR)/$(THTTPD_TARGET_BINARY): $(THTTPD_DIR)/$(THTTPD_BINARY)
39 install -D $(THTTPD_DIR)/$(THTTPD_BINARY) $(TARGET_DIR)/$(THTTPD_TARGET_BINARY)
40 install -D $(THTTPD_DIR)/extras/htpasswd $(TARGET_DIR)/bin/htpasswd
41 install -D $(THTTPD_DIR)/extras/makeweb $(TARGET_DIR)/bin/makeweb
42 install -D $(THTTPD_DIR)/extras/syslogtocern $(TARGET_DIR)/bin/syslogtocern
43 install -D $(THTTPD_DIR)/scripts/thttpd_wrapper $(TARGET_DIR)/sbin/thttpd_wrapper
44 install -D $(THTTPD_DIR)/scripts/thttpd.sh $(TARGET_DIR)/etc/init.d/S90thttpd
45 cp $(TARGET_DIR)/etc/init.d/S90thttpd $(TARGET_DIR)/etc/init.d/S90thttpd.in
46 cp $(TARGET_DIR)/sbin/thttpd_wrapper $(TARGET_DIR)/sbin/thttpd_wrapper.in
47 sed -e "s:/usr/local/sbin:/sbin:g" -e "s:/usr/local/www:$(THTTPD_WEB_DIR):g" < $(TARGET_DIR)/sbin/thttpd_wrapper.in > $(TARGET_DIR)/sbin/httpd_wrapper
48 sed -e "s:/usr/local/sbin:/sbin:g" < $(TARGET_DIR)/etc/init.d/S90thttpd.in > $(TARGET_DIR)/etc/init.d/S90thttpd
49 rm -f $(TARGET_DIR)/etc/init.d/S90thttpd.in $(TARGET_DIR)/sbin/thttpd_wrapper.in
50 install -d $(TARGET_DIR)$(THTTPD_WEB_DIR)/data
51 install -d $(TARGET_DIR)$(THTTPD_WEB_DIR)/logs
52 echo "dir=$(THTTPD_WEB_DIR)/data" > $(TARGET_DIR)$(THTTPD_WEB_DIR)/thttpd_config
53 echo 'cgipat=**.cgi' >> $(TARGET_DIR)$(THTTPD_WEB_DIR)/thttpd_config
54 echo "logfile=$(THTTPD_WEB_DIR)/logs/thttpd_log" >> $(TARGET_DIR)$(THTTPD_WEB_DIR)/thttpd_config
55 echo "pidfile=/var/run/thttpd.pid" >> $(TARGET_DIR)$(THTTPD_WEB_DIR)/thttpd_config
56 echo "<HTML><BODY>thttpd test page</BODY></HTML>" > $(TARGET_DIR)$(THTTPD_WEB_DIR)/data/index.html
58 thttpd: uclibc $(TARGET_DIR)/$(THTTPD_TARGET_BINARY)
60 thttpd-clean:
61 rm -f $(TARGET_DIR)/$(THTTPD_TARGET_BINARY)
62 -$(MAKE) -C $(THTTPD_DIR) clean
64 thttpd-dirclean:
65 rm -rf $(THTTPD_DIR)
66 #############################################################
68 # Toplevel Makefile options
70 #############################################################
71 ifeq ($(strip $(BR2_PACKAGE_THTTPD)),y)
72 TARGETS+=thttpd
73 endif