wok-6.x view apache/receipt @ rev 4165
Fix: git receipt, FSH and update to 1.6.4.4
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Sep 22 20:05:52 2009 +0200 (2009-09-22) |
parents | 0588160a6878 |
children | 8b98d274afb5 |
line source
1 # SliTaz package receipt.
3 PACKAGE="apache"
4 VERSION="2.2.13"
5 CATEGORY="network"
6 SHORT_DESC="Secure, efficient and extensible HTTP server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 SOURCE="httpd"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.apache.org/"
11 WGET_URL="${WEB_SITE}dist/$SOURCE/$TARBALL"
12 DEPENDS="apr-util apr openssl util-linux-ng-uuid expat zlib"
13 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev"
14 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache"
15 PROVIDE="lighttpd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 grep -q Slitaz config.layout || \
22 cat ../stuff/slitaz.layout >> config.layout
23 ./configure --mandir=/usr/share/man --enable-mods-shared=all \
24 --enable-proxy --enable-ssl \
25 --enable-layout=Slitaz $CONFIGURE_ARGS &&
26 make && make DESTDIR=$PWD/_pkg install
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 genpkg_rules()
31 {
32 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
33 mkdir -p $fs/etc/ssl/apache
34 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache
35 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache
36 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache
37 cp -a $_pkg/usr/bin $fs/usr
38 rm -r $fs/usr/bin/apxs
39 cp -a $_pkg/etc $fs
40 rm -rf $fs/etc/apache/original
41 cp -a $_pkg/var $fs
43 cp -a stuff/apache $fs/etc/init.d
44 # cat > $fs/etc/init.d/apache <<EOT
45 #!/bin/sh
46 #
47 #. /etc/init.d/rc.functions
48 #active_pidfile /var/run/apache/httpd.pid httpd
49 #
50 #exec /usr/bin/apachectl "\$@"
51 #EOT
52 # chmod +x $fs/etc/init.d/apache
53 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
54 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
55 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
56 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
57 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
58 $fs/etc/apache/httpd.conf $fs/etc/apache/extra/httpd-ssl.conf
59 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf
60 # Cook all packages based on apache
61 for i in $(cd $WOK; ls -d apache-*)
62 do
63 tazwok genpkg $i
64 done
65 }
67 # Pre and post install commands for Tazpkg.
68 # We stop the server by default in case of upgarde.
69 pre_install()
70 {
71 echo "Processing pre-install commands..."
72 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
73 }
75 post_install()
76 {
77 echo "Processing post-install commands..."
78 # Just in case.
79 chown www.www $1/var/log/$PACKAGE
80 ping -c 2 $(hostname) > /dev/null 2>&1 ||
81 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts
82 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
83 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
84 $(. /etc/locale.conf ; echo ${LANG#*_})
85 $(cat /etc/TZ)
87 $(cat /etc/hostname)
91 EOT
92 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
93 while read file; do
94 pkg=$(dirname $file)
95 [ "$pkg" = "$PACKAGE" ] && continue
96 echo "Reconfiguring $pkg for $PACKAGE..."
97 tazpkg reconfigure $pkg
98 done
99 if [ -z "$1" ]; then
100 for i in lighttpd ; do
101 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
102 done
103 /etc/init.d/$PACKAGE start
104 fi
105 }
107 # Rules to clean extras dirs or files
108 clean_wok()
109 {
110 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
111 }