# SliTaz package receipt. PACKAGE="apache" VERSION="2.4.58" CATEGORY="network" TAGS="webserver http server" SHORT_DESC="Secure, efficient and extensible HTTP server." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="Apache" WEB_SITE="https://www.apache.org/" SOURCE="httpd" TARBALL="$SOURCE-$VERSION.tar.bz2" WGET_URL="http://archive.apache.org/dist/$SOURCE/$TARBALL" PROVIDE="lighttpd" DEPENDS="apr apr-util expat openssl pcre util-linux-uuid zlib" BUILD_DEPENDS="apr-dev apr-util-dev bash expat-dev lua5.1-dev openldap-dev openssl-dev sed util-linux-uuid-dev zlib-dev" CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache" TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE" # What is the latest version available today? current_version() { wget -O - https://downloads.apache.org/httpd/ 2>/dev/null | \ sed "/$SOURCE-/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q } # Rules to configure and make the package. compile_rules() { grep -q Slitaz config.layout || \ cat $stuff/slitaz.layout >> config.layout ./configure \ --mandir=/usr/share/man \ --enable-mods-shared=all \ --enable-proxy \ --enable-ssl \ --enable-layout=Slitaz \ $CONFIGURE_ARGS && make $MAKEFLAGS && make -j 1 DESTDIR=$DESTDIR install } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share/apache mkdir -p $fs/etc/init.d mkdir -p $fs/etc/apache/conf.d mkdir -p $fs/etc/apache/extra mkdir -p $fs/etc/ssl/apache cp -a $install/usr/share/apache/icons $fs/usr/share/apache cp -a $install/usr/share/apache/error $fs/usr/share/apache cp -a $install/usr/share/apache/modules $fs/usr/share/apache cp -a $install/usr/bin $fs/usr rm -r $fs/usr/bin/apxs cp -a $install/etc $fs rm -rf $fs/etc/apache/original cp -a $install/var $fs cp -a $stuff/apache $fs/etc/init.d cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra sed -i -e 's|User daemon|User www|' \ -e 's|Group daemon|Group www|' \ -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \ -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \ -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \ -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \ -e 's|#LoadModule ssl_module|LoadModule ssl_module|' \ $fs/etc/apache/httpd.conf \ $fs/etc/apache/extra/httpd-ssl.conf echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf sed -i 's/^SSLSessionCache /#&/' $fs/etc/apache/extra/httpd-ssl.conf cat >> $fs/etc/apache/extra/httpd-ssl.conf </dev/null; echo ${LANG#*_}) local tz=$(cat $1/etc/TZ 2>/dev/null) local hostname=$(cat $1/etc/hostname 2>/dev/null) # Just in case. chown www.www "$1/var/log/$PACKAGE" ping -c 2 $(hostname) > /dev/null 2>&1 || sed -i "s/localhost/$(hostname) localhost/" "$1/etc/hosts" sed -i -e "s/^#\(LoadModule.*slotmem_shm.*\)$/\1/" \ -e "s/.*ServerName www.example.*/ServerName ${hostname:-slitaz}/" \ $1/etc/apache/httpd.conf $1/etc/apache/extra/httpd-ssl.conf grep -qs Apache $1/var/www/index.html && sed -i 's|^LighTTPD.*|&\nApache configs : /etc/apache|' \ $1/var/www/index.html [ -s "$1/etc/ssl/apache/apache.pem" ] || openssl req -new -x509 -keyout "$1/etc/ssl/apache/apache.pem" \ -out "$1/etc/ssl/apache/apache.pem" -days 3650 -nodes < /dev/null | grep -q :80 || /etc/init.d/$PACKAGE start } # Rules to clean extras dirs or files clean_wok() { rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION} }