wok-current annotate apache/receipt @ rev 7035

Merge
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Oct 31 23:40:37 2010 +0100 (2010-10-31)
parents 5701f391e47c
children a1644dbcf632
rev   line source
pascal@1313 1 # SliTaz package receipt.
pascal@1313 2
pascal@1313 3 PACKAGE="apache"
slaxemulator@6799 4 VERSION="2.2.17"
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"
slaxemulator@6799 12 DEPENDS="apr-util apr openssl pcre util-linux-ng-uuid expat zlib"
slaxemulator@6799 13 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev util-linux-ng-uuid-dev openldap-dev"
pascal@1906 14 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache"
pascal@1572 15 PROVIDE="lighttpd"
jozee@4931 16 TAGS="webserver http server"
pascal@1313 17
pascal@1313 18 # Rules to configure and make the package.
pascal@1313 19 compile_rules()
pascal@1313 20 {
pascal@1313 21 cd $src
pascal@1313 22 grep -q Slitaz config.layout || \
pascal@1313 23 cat ../stuff/slitaz.layout >> config.layout
pascal@1313 24 ./configure --mandir=/usr/share/man --enable-mods-shared=all \
pascal@1786 25 --enable-proxy --enable-ssl \
pascal@1658 26 --enable-layout=Slitaz $CONFIGURE_ARGS &&
pascal@5800 27 make -j 4 && make DESTDIR=$PWD/_pkg install
pascal@1313 28 }
pascal@1313 29
pascal@1313 30 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1313 31 genpkg_rules()
pascal@1313 32 {
pascal@1313 33 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
pascal@1794 34 mkdir -p $fs/etc/ssl/apache
pascal@1313 35 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
pascal@1313 36 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
pascal@1313 37 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
pascal@1313 38 cp -a $_pkg/usr/bin $fs/usr
pascal@1313 39 rm -r $fs/usr/bin/apxs
pascal@1313 40 cp -a $_pkg/etc $fs
pascal@1786 41 rm -rf $fs/etc/apache/original
pascal@1313 42 cp -a $_pkg/var $fs
erjo@4105 43
erjo@4105 44 cp -a stuff/apache $fs/etc/init.d
erjo@4647 45
pascal@1313 46 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
pascal@1313 47 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
pascal@1794 48 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
pascal@1794 49 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
pascal@1794 50 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
pascal@1794 51 $fs/etc/apache/httpd.conf $fs/etc/apache/extra/httpd-ssl.conf
pascal@1313 52 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf
pascal@1313 53 }
pascal@1313 54
pascal@1313 55 # Pre and post install commands for Tazpkg.
pascal@1313 56 # We stop the server by default in case of upgarde.
pascal@1313 57 pre_install()
pascal@1313 58 {
pascal@1313 59 echo "Processing pre-install commands..."
pascal@1794 60 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
pascal@1313 61 }
pascal@1313 62
pascal@1313 63 post_install()
pascal@1313 64 {
pascal@1313 65 echo "Processing post-install commands..."
pascal@1313 66 # Just in case.
pascal@1313 67 chown www.www $1/var/log/$PACKAGE
pascal@1658 68 ping -c 2 $(hostname) > /dev/null 2>&1 ||
pascal@1658 69 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
pascal@1794 70 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
pascal@1794 71 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
pascal@1794 72 $(. /etc/locale.conf ; echo ${LANG#*_})
pascal@1794 73 $(cat /etc/TZ)
pascal@1794 74
pascal@1794 75 $(cat /etc/hostname)
pascal@1794 76
pascal@1794 77
pascal@1794 78
pascal@1794 79 EOT
pascal@1922 80 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
pascal@1922 81 while read file; do
pascal@1922 82 pkg=$(dirname $file)
pascal@1922 83 [ "$pkg" = "$PACKAGE" ] && continue
pascal@1922 84 echo "Reconfiguring $pkg for $PACKAGE..."
pascal@1922 85 tazpkg reconfigure $pkg
pascal@1922 86 done
pascal@1905 87 if [ -z "$1" ]; then
pascal@1905 88 for i in lighttpd ; do
pascal@1905 89 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
pascal@1905 90 done
pascal@1905 91 /etc/init.d/$PACKAGE start
pascal@1905 92 fi
pascal@1313 93 }
pascal@1313 94
pascal@1313 95 # Rules to clean extras dirs or files
pascal@1313 96 clean_wok()
pascal@1313 97 {
pascal@1313 98 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
pascal@1313 99 }