wok-6.x annotate apache/receipt @ rev 15281
qemacs: race condition
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Sep 26 13:36:58 2013 +0000 (2013-09-26) |
parents | e9130cce9043 |
children | 191b99ca9dc2 |
rev | line source |
---|---|
pascal@1313 | 1 # SliTaz package receipt. |
pascal@1313 | 2 |
pascal@1313 | 3 PACKAGE="apache" |
erjo@14809 | 4 VERSION="2.4.4" |
pascal@1313 | 5 CATEGORY="network" |
pascal@1313 | 6 SHORT_DESC="Secure, efficient and extensible HTTP server." |
pascal@1313 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@1313 | 8 SOURCE="httpd" |
pascal@1313 | 9 TARBALL="$SOURCE-$VERSION.tar.bz2" |
pascal@1313 | 10 WEB_SITE="http://www.apache.org/" |
pascal@1313 | 11 WGET_URL="${WEB_SITE}dist/$SOURCE/$TARBALL" |
pankso@12481 | 12 DEPENDS="apr-util apr openssl pcre util-linux-uuid expat zlib" |
pascal@12200 | 13 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev \ |
slaxemulator@13101 | 14 util-linux-uuid-dev openldap-dev bash" |
pascal@1906 | 15 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache" |
pascal@14772 | 16 TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE" |
pascal@1572 | 17 PROVIDE="lighttpd" |
jozee@4931 | 18 TAGS="webserver http server" |
pascal@1313 | 19 |
pascal@1313 | 20 # Rules to configure and make the package. |
pascal@1313 | 21 compile_rules() |
pascal@1313 | 22 { |
pascal@1313 | 23 cd $src |
pascal@1313 | 24 grep -q Slitaz config.layout || \ |
slaxemulator@9698 | 25 cat $stuff/slitaz.layout >> config.layout |
erjo@14809 | 26 ./configure --mandir=/usr/share/man \ |
erjo@14809 | 27 --with-program-name=apache \ |
erjo@14809 | 28 --enable-mods-shared=all \ |
erjo@14809 | 29 --enable-proxy \ |
erjo@14809 | 30 --enable-ssl \ |
pascal@1658 | 31 --enable-layout=Slitaz $CONFIGURE_ARGS && |
slaxemulator@13101 | 32 make $MAKEFLAGS && make DESTDIR=$DESTDIR install |
pascal@1313 | 33 } |
pascal@1313 | 34 |
pascal@1313 | 35 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1313 | 36 genpkg_rules() |
pascal@1313 | 37 { |
pascal@1313 | 38 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d |
pascal@1794 | 39 mkdir -p $fs/etc/ssl/apache |
pascal@1313 | 40 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache |
pascal@1313 | 41 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache |
pascal@1313 | 42 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache |
pascal@1313 | 43 cp -a $_pkg/usr/bin $fs/usr |
pascal@1313 | 44 rm -r $fs/usr/bin/apxs |
pascal@1313 | 45 cp -a $_pkg/etc $fs |
pascal@1786 | 46 rm -rf $fs/etc/apache/original |
pascal@1313 | 47 cp -a $_pkg/var $fs |
erjo@4105 | 48 |
pankso@9697 | 49 cp -a $stuff/apache $fs/etc/init.d |
pascal@10931 | 50 mkdir -p $fs/etc/apache/extra |
pascal@10931 | 51 cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra |
erjo@4647 | 52 |
pascal@1313 | 53 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \ |
pascal@1313 | 54 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \ |
pascal@1794 | 55 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \ |
pascal@1794 | 56 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \ |
pascal@1794 | 57 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \ |
erjo@14809 | 58 $fs/etc/apache/apache.conf $fs/etc/apache/extra/httpd-ssl.conf |
erjo@14809 | 59 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/apache.conf |
pascal@1313 | 60 } |
pascal@1313 | 61 |
pascal@1313 | 62 # Pre and post install commands for Tazpkg. |
pascal@1313 | 63 # We stop the server by default in case of upgarde. |
pascal@1313 | 64 pre_install() |
pascal@1313 | 65 { |
pascal@1313 | 66 echo "Processing pre-install commands..." |
pascal@1794 | 67 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop |
pascal@1313 | 68 } |
pascal@1313 | 69 |
pascal@1313 | 70 post_install() |
pascal@1313 | 71 { |
pascal@12197 | 72 local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_}) |
pascal@12197 | 73 local tz=$(cat /etc/TZ 2>/dev/null) |
pascal@12197 | 74 local hostname=$(cat /etc/hostname 2>/dev/null) |
pascal@1313 | 75 echo "Processing post-install commands..." |
pascal@1313 | 76 # Just in case. |
pascal@1313 | 77 chown www.www $1/var/log/$PACKAGE |
pascal@1658 | 78 ping -c 2 $(hostname) > /dev/null 2>&1 || |
pascal@1658 | 79 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts |
pascal@11175 | 80 [ -s $1/etc/ssl/apache/apache.pem ] || |
pascal@1794 | 81 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \ |
pascal@1794 | 82 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT |
pascal@12197 | 83 ${lang:-us} |
pascal@12197 | 84 ${tz:-UTC} |
pascal@1794 | 85 |
pascal@12197 | 86 ${hostname:-slitaz} |
pascal@1794 | 87 |
pascal@1794 | 88 |
pascal@1794 | 89 |
pascal@1794 | 90 EOT |
pascal@1922 | 91 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \ |
pascal@1922 | 92 while read file; do |
pascal@1922 | 93 pkg=$(dirname $file) |
pascal@1922 | 94 [ "$pkg" = "$PACKAGE" ] && continue |
pascal@1922 | 95 echo "Reconfiguring $pkg for $PACKAGE..." |
pascal@1922 | 96 tazpkg reconfigure $pkg |
pascal@1922 | 97 done |
pascal@1905 | 98 if [ -z "$1" ]; then |
pascal@1905 | 99 for i in lighttpd ; do |
pascal@1905 | 100 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop |
pascal@1905 | 101 done |
pascal@1905 | 102 /etc/init.d/$PACKAGE start |
pascal@1905 | 103 fi |
pascal@1313 | 104 } |
pascal@1313 | 105 |
pascal@1313 | 106 # Rules to clean extras dirs or files |
pascal@1313 | 107 clean_wok() |
pascal@1313 | 108 { |
pascal@1313 | 109 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION} |
pascal@1313 | 110 } |