wok-next view apache/receipt @ rev 15361
tuxmath: add -lt4k_common
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 02 10:41:05 2013 +0000 (2013-10-02) |
parents | 390a5a938ba6 |
children | 73910552a828 |
line source
1 # SliTaz package receipt.
3 PACKAGE="apache"
4 VERSION="2.4.4"
5 CATEGORY="network"
6 SHORT_DESC="Secure, efficient and extensible HTTP server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="Apache"
9 SOURCE="httpd"
10 TARBALL="$SOURCE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.apache.org/"
12 WGET_URL="${WEB_SITE}dist/$SOURCE/$TARBALL"
13 CONFIG_FILES="/etc/apache /var/www /etc/ssl/apache"
14 TAZPANEL_DAEMON="edit::/etc/apache/httpd.conf|web::$WEB_SITE"
15 PROVIDE="lighttpd"
16 TAGS="webserver http server"
18 DEPENDS="apr-util apr openssl pcre util-linux-uuid expat zlib"
19 BUILD_DEPENDS="apr-util-dev apr-dev openssl-dev sed expat-dev zlib-dev \
20 util-linux-uuid-dev openldap-dev bash"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 cd $src
26 grep -q Slitaz config.layout || \
27 cat $stuff/slitaz.layout >> config.layout
28 ./configure --mandir=/usr/share/man \
29 --with-program-name=apache \
30 --enable-mods-shared=all \
31 --enable-proxy \
32 --enable-ssl \
33 --enable-layout=Slitaz $CONFIGURE_ARGS &&
34 make $MAKEFLAGS && make DESTDIR=$DESTDIR install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d
41 mkdir -p $fs/etc/ssl/apache
42 cp -a $install/usr/share/apache/icons $fs/usr/share/apache
43 cp -a $install/usr/share/apache/error $fs/usr/share/apache
44 cp -a $install/usr/share/apache/modules $fs/usr/share/apache
45 cp -a $install/usr/bin $fs/usr
46 rm -r $fs/usr/bin/apxs
47 cp -a $install/etc $fs
48 rm -rf $fs/etc/apache/original
49 cp -a $install/var $fs
51 cp -a $stuff/apache $fs/etc/init.d
52 mkdir -p $fs/etc/apache/extra
53 cp -a $stuff/fix-range-CVE-2011-3192.conf $fs/etc/apache/extra
55 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \
56 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \
57 -e 's|#Include /etc/apache/extra/httpd-ssl.conf|Include /etc/apache/extra/httpd-ssl.conf|' \
58 -e 's|/etc/apache/server.crt|/etc/ssl/apache/apache.pem|' \
59 -e 's|/etc/apache/server.key|/etc/ssl/apache/apache.pem|' \
60 $fs/etc/apache/apache.conf $fs/etc/apache/extra/httpd-ssl.conf
61 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/apache.conf
62 }
64 # Pre and post install commands for Tazpkg.
65 # We stop the server by default in case of upgarde.
66 pre_install()
67 {
68 echo "Processing pre-install commands..."
69 [ -z "$1" ] && [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
70 }
72 post_install()
73 {
74 local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_})
75 local tz=$(cat /etc/TZ 2>/dev/null)
76 local hostname=$(cat /etc/hostname 2>/dev/null)
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 [ -s $1/etc/ssl/apache/apache.pem ] ||
83 openssl req -new -x509 -keyout $1/etc/ssl/apache/apache.pem \
84 -out $1/etc/ssl/apache/apache.pem -days 3650 -nodes <<EOT
85 ${lang:-us}
86 ${tz:-UTC}
88 ${hostname:-slitaz}
92 EOT
93 ( cd $1/$INSTALLED/ ; grep -l /etc/apache/conf.d/ */receipt ) | \
94 while read file; do
95 pkg=$(dirname $file)
96 [ "$pkg" = "$PACKAGE" ] && continue
97 echo "Reconfiguring $pkg for $PACKAGE..."
98 tazpkg reconfigure $pkg
99 done
100 if [ -z "$1" ]; then
101 for i in lighttpd ; do
102 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop
103 done
104 /etc/init.d/$PACKAGE start
105 fi
106 }
108 # Rules to clean extras dirs or files
109 clean_wok()
110 {
111 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION}
112 }