add a patch to provide a descent PATH to cgi,
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 19 Oct 2005 00:16:27 +0000 (00:16 +0000)
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 19 Oct 2005 00:16:27 +0000 (00:16 +0000)
split in 3 packages (w/o ssl, w/ matrixssl & w/ openssl),
add a restart command to init-script.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2174 3c298f89-4303-0410-b956-a3cf2f4a3e73

14 files changed:
openwrt/package/Makefile
openwrt/package/mini_httpd/Config.in
openwrt/package/mini_httpd/Makefile
openwrt/package/mini_httpd/files/mini_httpd-ssl.conf [new file with mode: 0644]
openwrt/package/mini_httpd/files/mini_httpd.conf
openwrt/package/mini_httpd/files/mini_httpd.init
openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles [new file with mode: 0644]
openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control [new file with mode: 0644]
openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles [new file with mode: 0644]
openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control [new file with mode: 0644]
openwrt/package/mini_httpd/ipkg/mini-httpd.conffiles
openwrt/package/mini_httpd/ipkg/mini-httpd.control
openwrt/package/mini_httpd/patches/001-cgi_path.patch [new file with mode: 0644]
openwrt/package/mini_httpd/patches/500-matrixssl.patch

index 3c56620..5e5087d 100644 (file)
@@ -107,7 +107,7 @@ package-$(BR2_PACKAGE_MARADNS) += maradns
 package-$(BR2_PACKAGE_MATRIXSSL) += matrixssl
 package-$(BR2_PACKAGE_MICROCOM) += microcom
 package-$(BR2_PACKAGE_MICROPERL) += microperl
 package-$(BR2_PACKAGE_MATRIXSSL) += matrixssl
 package-$(BR2_PACKAGE_MICROCOM) += microcom
 package-$(BR2_PACKAGE_MICROPERL) += microperl
-package-$(BR2_PACKAGE_MINI_HTTPD) += mini_httpd
+package-$(BR2_COMPILE_MINI_HTTPD) += mini_httpd
 package-$(BR2_PACKAGE_MINI_SENDMAIL) += mini_sendmail
 package-$(BR2_PACKAGE_MONIT) += monit
 package-$(BR2_PACKAGE_MPD) += mpd
 package-$(BR2_PACKAGE_MINI_SENDMAIL) += mini_sendmail
 package-$(BR2_PACKAGE_MONIT) += monit
 package-$(BR2_PACKAGE_MPD) += mpd
@@ -248,7 +248,6 @@ libvorbis-compile: libogg-compile
 libxml2-compile: zlib-compile
 libxslt-compile: libxml2-compile
 lighttpd-compile: openssl-compile pcre-compile
 libxml2-compile: zlib-compile
 libxslt-compile: libxml2-compile
 lighttpd-compile: openssl-compile pcre-compile
-mini_httpd-compile: matrixssl-compile
 mt-daapd-compile: howl-compile libgdbm-compile libid3tag-compile
 mtr-compile: ncurses-compile
 mysql-compile: ncurses-compile zlib-compile
 mt-daapd-compile: howl-compile libgdbm-compile libid3tag-compile
 mtr-compile: ncurses-compile
 mysql-compile: ncurses-compile zlib-compile
@@ -314,6 +313,13 @@ ifneq ($(BR2_PACKAGE_FREERADIUS_MOD_SQL_PGSQL),)
 freeradius-compile: postgresql-compile
 endif
 
 freeradius-compile: postgresql-compile
 endif
 
+ifneq ($(BR2_PACKAGE_MINI_HTTPD_MATRIXSSL),)
+mini_httpd-compile: matrixssl-compile
+endif
+ifneq ($(BR2_PACKAGE_MINI_HTTPD_OPENSSL),)
+mini_httpd-compile: openssl-compile
+endif
+
 ifneq ($(BR2_PACKAGE_MPD_MP3),)
 mpd-compile: libid3tag-compile libmad-compile
 endif
 ifneq ($(BR2_PACKAGE_MPD_MP3),)
 mpd-compile: libid3tag-compile libmad-compile
 endif
index 484924f..fb319ae 100644 (file)
@@ -1,6 +1,66 @@
+config BR2_COMPILE_MINI_HTTPD
+       bool
+       default n
+       depends BR2_PACKAGE_MINI_HTTPD || BR2_PACKAGE_MINI_HTTPD_MATRIXSSL || BR2_PACKAGE_MINI_HTTPD_OPENSSL
+
 config BR2_PACKAGE_MINI_HTTPD
        tristate "mini-httpd - A small web server"
        default m if CONFIG_DEVEL
 config BR2_PACKAGE_MINI_HTTPD
        tristate "mini-httpd - A small web server"
        default m if CONFIG_DEVEL
+       select BR2_COMPILE_MINI_HTTPD
+       help
+        mini_httpd is a small HTTP server. Its performance is not great, but for 
+        low or medium traffic sites it's quite adequate. It implements all the 
+        basic features of an HTTP server, including:
+        
+            * GET, HEAD, and POST methods.
+            * CGI.
+            * Basic authentication.
+            * Security against ".." filename snooping.
+            * The common MIME types.
+            * Trailing-slash redirection.
+            * index.html, index.htm, index.cgi
+            * Directory listings.
+            * Multihoming / virtual hosting.
+            * Standard logging.
+            * Custom error pages. 
+        
+        It can also be configured to do IPv6. 
+        
+        http://www.acme.com/software/mini_httpd/
+        
+
+config BR2_PACKAGE_MINI_HTTPD_MATRIXSSL
+       tristate "mini-httpd-matrixssl - A small web server, built with SSL support using MatrixSSL"
+       default m if CONFIG_DEVEL
+       select BR2_COMPILE_MINI_HTTPD
+       select BR2_PACKAGE_LIBMATRIXSSL
+       help
+        mini_httpd is a small HTTP server. Its performance is not great, but for 
+        low or medium traffic sites it's quite adequate. It implements all the 
+        basic features of an HTTP server, including:
+        
+            * GET, HEAD, and POST methods.
+            * CGI.
+            * Basic authentication.
+            * Security against ".." filename snooping.
+            * The common MIME types.
+            * Trailing-slash redirection.
+            * index.html, index.htm, index.cgi
+            * Directory listings.
+            * Multihoming / virtual hosting.
+            * Standard logging.
+            * Custom error pages. 
+        
+        It can also be configured to do SSL/HTTPS and IPv6. 
+        
+        http://www.acme.com/software/mini_httpd/
+        
+
+config BR2_PACKAGE_MINI_HTTPD_OPENSSL
+       tristate "mini-httpd-openssl - A small web server, built with SSL support using OpenSSL"
+       default m if CONFIG_DEVEL
+       select BR2_COMPILE_MINI_HTTPD
+       select BR2_PACKAGE_LIBOPENSSL
        help
         mini_httpd is a small HTTP server. Its performance is not great, but for 
         low or medium traffic sites it's quite adequate. It implements all the 
        help
         mini_httpd is a small HTTP server. Its performance is not great, but for 
         low or medium traffic sites it's quite adequate. It implements all the 
index aa9d89b..2261b54 100644 (file)
@@ -16,6 +16,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/mini_httpd-$(PKG_VERSION)
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,MINI_HTTPD,mini-httpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,MINI_HTTPD,mini-httpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,MINI_HTTPD_MATRIXSSL,mini-httpd-matrixssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,MINI_HTTPD_OPENSSL,mini-httpd-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 
 $(PKG_BUILD_DIR)/.configured:
 
 
 $(PKG_BUILD_DIR)/.configured:
@@ -23,18 +25,43 @@ $(PKG_BUILD_DIR)/.configured:
        touch $@
 
 $(PKG_BUILD_DIR)/.built:
        touch $@
 
 $(PKG_BUILD_DIR)/.built:
+       # with MatrixSSL
+ifneq ($(BR2_PACKAGE_MINI_HTTPD_MATRIXSSL),)
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC=$(TARGET_CC) \
                OFLAGS="$(TARGET_CFLAGS)" \
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC=$(TARGET_CC) \
                OFLAGS="$(TARGET_CFLAGS)" \
+               SSL_DEFS="-DUSE_SSL -DHAVE_MATRIXSSL" \
                SSL_INC="-I$(STAGING_DIR)/usr/include" \
                SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \
                SSL_INC="-I$(STAGING_DIR)/usr/include" \
                SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lmatrixssl" \
+               SSL_OBJS="matrixssl_helper.o" \
                all
                all
+       (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-matrixssl; )
+       $(MAKE) -C $(PKG_BUILD_DIR) clean
+endif
+       # with OpenSSL
+ifneq ($(BR2_PACKAGE_MINI_HTTPD_OPENSSL),)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC=$(TARGET_CC) \
+               OFLAGS="$(TARGET_CFLAGS)" \
+               SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
+               SSL_INC="-I$(STAGING_DIR)/usr/include" \
+               SSL_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto" \
+               all
+       (cd $(PKG_BUILD_DIR); mv mini_httpd mini_httpd-openssl; )
+       $(MAKE) -C $(PKG_BUILD_DIR) clean
+endif
+       # without SSL
+ifneq ($(BR2_PACKAGE_MINI_HTTPD),)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC=$(TARGET_CC) \
+               OFLAGS="$(TARGET_CFLAGS)" \
+               all
+endif
        touch $@
 
 $(IPKG_MINI_HTTPD):
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc
        touch $@
 
 $(IPKG_MINI_HTTPD):
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc
-       install -m0644 ./files/mini_httpd.conf $(IDIR_MINI_HTTPD)/etc/
-       install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD)/etc/
+       install -m0644 ./files/mini_httpd.conf $(IDIR_MINI_HTTPD)/etc/mini_httpd.conf
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc/default
        install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD)/etc/default/mini_httpd
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc/init.d
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc/default
        install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD)/etc/default/mini_httpd
        install -d -m0755 $(IDIR_MINI_HTTPD)/etc/init.d
@@ -43,3 +70,29 @@ $(IPKG_MINI_HTTPD):
        install -m0755 $(PKG_BUILD_DIR)/mini_httpd $(IDIR_MINI_HTTPD)/usr/sbin/
        $(RSTRIP) $(IDIR_MINI_HTTPD)
        $(IPKG_BUILD) $(IDIR_MINI_HTTPD) $(PACKAGE_DIR)
        install -m0755 $(PKG_BUILD_DIR)/mini_httpd $(IDIR_MINI_HTTPD)/usr/sbin/
        $(RSTRIP) $(IDIR_MINI_HTTPD)
        $(IPKG_BUILD) $(IDIR_MINI_HTTPD) $(PACKAGE_DIR)
+
+$(IPKG_MINI_HTTPD_MATRIXSSL):
+       install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc
+       install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/mini_httpd.conf
+       install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/
+       install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default
+       install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/default/mini_httpd
+       install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d
+       install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_MATRIXSSL)/etc/init.d/mini_httpd
+       install -d -m0755 $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin
+       install -m0755 $(PKG_BUILD_DIR)/mini_httpd-matrixssl $(IDIR_MINI_HTTPD_MATRIXSSL)/usr/sbin/mini_httpd
+       $(RSTRIP) $(IDIR_MINI_HTTPD_MATRIXSSL)
+       $(IPKG_BUILD) $(IDIR_MINI_HTTPD_MATRIXSSL) $(PACKAGE_DIR)
+
+$(IPKG_MINI_HTTPD_OPENSSL):
+       install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc
+       install -m0644 ./files/mini_httpd-ssl.conf $(IDIR_MINI_HTTPD_OPENSSL)/etc/mini_httpd.conf
+       install -m0600 ./files/mini_httpd.pem $(IDIR_MINI_HTTPD_OPENSSL)/etc/
+       install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/default
+       install -m0644 ./files/mini_httpd.default $(IDIR_MINI_HTTPD_OPENSSL)/etc/default/mini_httpd
+       install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d
+       install -m0755 ./files/mini_httpd.init $(IDIR_MINI_HTTPD_OPENSSL)/etc/init.d/mini_httpd
+       install -d -m0755 $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin
+       install -m0755 $(PKG_BUILD_DIR)/mini_httpd-openssl $(IDIR_MINI_HTTPD_OPENSSL)/usr/sbin/mini_httpd
+       $(RSTRIP) $(IDIR_MINI_HTTPD_OPENSSL)
+       $(IPKG_BUILD) $(IDIR_MINI_HTTPD_OPENSSL) $(PACKAGE_DIR)
diff --git a/openwrt/package/mini_httpd/files/mini_httpd-ssl.conf b/openwrt/package/mini_httpd/files/mini_httpd-ssl.conf
new file mode 100644 (file)
index 0000000..1cd7022
--- /dev/null
@@ -0,0 +1,7 @@
+cgipat=cgi-bin/**|**.sh
+dir=/www
+nochroot
+pidfile=/var/run/mini_httpd.pid
+user=root
+ssl
+certfile=/etc/mini_httpd.pem
index 2e78452..d636a43 100644 (file)
@@ -1,7 +1,5 @@
-cgipat=cgi-bin/*
+cgipat=cgi-bin/**|**.sh
 dir=/www
 nochroot
 pidfile=/var/run/mini_httpd.pid
 user=root
 dir=/www
 nochroot
 pidfile=/var/run/mini_httpd.pid
 user=root
-ssl
-certfile=/etc/mini_httpd.pem
index a690559..77bd6fd 100644 (file)
@@ -1,20 +1,25 @@
 #!/bin/sh
 
 #!/bin/sh
 
-DEFAULT=/etc/default/mini_httpd
+BIN=mini_httpd
+DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 RUN_D=/var/run
-PID_F=$RUN_D/mini_httpd.pid
+PID_F=$RUN_D/$BIN.pid
 [ -f $DEFAULT ] && . $DEFAULT
 
 case $1 in
  start)
   [ -d $RUN_D ] || mkdir -p $RUN_D
 [ -f $DEFAULT ] && . $DEFAULT
 
 case $1 in
  start)
   [ -d $RUN_D ] || mkdir -p $RUN_D
-  mini_httpd $OPTIONS
+  $BIN $OPTIONS 2>/dev/null
   ;;
  stop)
   [ -f $PID_F ] && kill $(cat $PID_F)
   ;;
   ;;
  stop)
   [ -f $PID_F ] && kill $(cat $PID_F)
   ;;
+ restart)
+  $0 stop
+  $0 start
+  ;;
  *)
  *)
-  echo "usage: $0 (start|stop)"
+  echo "usage: $0 (start|stop|restart)"
   exit 1
 esac
 
   exit 1
 esac
 
diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles
new file mode 100644 (file)
index 0000000..36a86b9
--- /dev/null
@@ -0,0 +1,3 @@
+/etc/default/mini_httpd
+/etc/mini_httpd.conf
+/etc/mini_httpd.pem
diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control b/openwrt/package/mini_httpd/ipkg/mini-httpd-matrixssl.control
new file mode 100644 (file)
index 0000000..9212997
--- /dev/null
@@ -0,0 +1,9 @@
+Package: mini-httpd-matrixssl
+Priority: optional
+Section: net
+Version: [TBDL]
+Architecture: [TBDL]
+Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
+Source: buildroot internal
+Description: A small HTTP server, built with SSL support using MatrixSSL.
+Depends: libmatrixssl
diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles
new file mode 100644 (file)
index 0000000..36a86b9
--- /dev/null
@@ -0,0 +1,3 @@
+/etc/default/mini_httpd
+/etc/mini_httpd.conf
+/etc/mini_httpd.pem
diff --git a/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control b/openwrt/package/mini_httpd/ipkg/mini-httpd-openssl.control
new file mode 100644 (file)
index 0000000..97bc916
--- /dev/null
@@ -0,0 +1,9 @@
+Package: mini-httpd-openssl
+Priority: optional
+Section: net
+Version: [TBDL]
+Architecture: [TBDL]
+Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
+Source: buildroot internal
+Description: A small HTTP server, built with SSL support using OpenSSL.
+Depends: libopenssl
index 36a86b9..d1123c2 100644 (file)
@@ -1,3 +1,2 @@
 /etc/default/mini_httpd
 /etc/mini_httpd.conf
 /etc/default/mini_httpd
 /etc/mini_httpd.conf
-/etc/mini_httpd.pem
index 5084053..2082aad 100644 (file)
@@ -3,7 +3,7 @@ Priority: optional
 Section: net
 Version: [TBDL]
 Architecture: [TBDL]
 Section: net
 Version: [TBDL]
 Architecture: [TBDL]
-Maintainer: OpenWrt Developers Team <bugs@openwrt.org>
-Source: http://openwrt.org/cgi-bin/viewcvs.cgi/openwrt/package/mini_httpd/
+Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org>
+Source: buildroot internal
 Description: A small HTTP server, built with SSL support using MatrixSSL.
 Depends: libmatrixssl
 Description: A small HTTP server, built with SSL support using MatrixSSL.
 Depends: libmatrixssl
diff --git a/openwrt/package/mini_httpd/patches/001-cgi_path.patch b/openwrt/package/mini_httpd/patches/001-cgi_path.patch
new file mode 100644 (file)
index 0000000..c847d94
--- /dev/null
@@ -0,0 +1,16 @@
+diff -ruN mini_httpd-1.19-old/mini_httpd.c mini_httpd-1.19-new/mini_httpd.c
+--- mini_httpd-1.19-old/mini_httpd.c   2005-10-19 01:11:24.000000000 +0200
++++ mini_httpd-1.19-new/mini_httpd.c   2005-10-19 01:13:05.000000000 +0200
+@@ -138,10 +138,10 @@
+ #define CGI_NICE 10
+ #endif /* CGI_NICE */
+ #ifndef CGI_PATH
+-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin"
++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin"
+ #endif /* CGI_PATH */
+ #ifndef CGI_LD_LIBRARY_PATH
+-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib"
++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib"
+ #endif /* CGI_LD_LIBRARY_PATH */
+ #ifndef AUTH_FILE
+ #define AUTH_FILE ".htpasswd"
index e2d83af..0ab8d68 100644 (file)
@@ -14,11 +14,11 @@ diff -ruN mini_httpd-1.19-orig/Makefile mini_httpd-1.19-3/Makefile
 +#SSL_OBJS =
 +
 +# MatrixSSL
 +#SSL_OBJS =
 +
 +# MatrixSSL
-+SSL_TREE =
-+SSL_DEFS =    -DUSE_SSL -DHAVE_MATRIXSSL
-+SSL_INC =
-+SSL_LIBS =    -lmatrixssl
-+SSL_OBJS =    matrixssl_helper.o
++#SSL_TREE =
++#SSL_DEFS =   -DUSE_SSL -DHAVE_MATRIXSSL
++#SSL_INC =
++#SSL_LIBS =   -lmatrixssl
++#SSL_OBJS =   matrixssl_helper.o
  
  
 -BINDIR =      /usr/local/sbin
  
  
 -BINDIR =      /usr/local/sbin
This page took 0.041679 seconds and 4 git commands to generate.