wok annotate apache/receipt @ rev 1770
busybox udhcpc/zcip: call /etc/ip*.d scripts
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Nov 26 18:02:56 2008 +0000 (2008-11-26) |
parents | 295bc93ddcc2 |
children | d699aa373d79 |
rev | line source |
---|---|
pascal@1313 | 1 # SliTaz package receipt. |
pascal@1313 | 2 |
pascal@1313 | 3 PACKAGE="apache" |
pascal@1313 | 4 VERSION="2.2.9" |
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" |
pascal@1313 | 12 DEPENDS="apr-util apr" |
pascal@1313 | 13 BUILD_DEPENDS="apr-util-dev apr-dev" |
pascal@1313 | 14 CONFIG_FILES="/etc/apache /var/www" |
pascal@1572 | 15 PROVIDE="lighttpd" |
pascal@1313 | 16 |
pascal@1313 | 17 # Rules to configure and make the package. |
pascal@1313 | 18 compile_rules() |
pascal@1313 | 19 { |
pascal@1313 | 20 ln -s $SOURCE-$VERSION $PACKAGE-$VERSION |
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@1658 | 25 --enable-layout=Slitaz $CONFIGURE_ARGS && |
pascal@1313 | 26 make && make DESTDIR=$PWD/_pkg install |
pascal@1313 | 27 } |
pascal@1313 | 28 |
pascal@1313 | 29 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1313 | 30 genpkg_rules() |
pascal@1313 | 31 { |
pascal@1313 | 32 mkdir -p $fs/usr/share/apache $fs/etc/init.d $fs/etc/apache/conf.d |
pascal@1313 | 33 cp -a $_pkg/usr/share/apache/icons $fs/usr/share/apache |
pascal@1313 | 34 cp -a $_pkg/usr/share/apache/error $fs/usr/share/apache |
pascal@1313 | 35 cp -a $_pkg/usr/share/apache/modules $fs/usr/share/apache |
pascal@1313 | 36 cp -a $_pkg/usr/bin $fs/usr |
pascal@1313 | 37 rm -r $fs/usr/bin/apxs |
pascal@1313 | 38 cp -a $_pkg/etc $fs |
pascal@1313 | 39 cp -a $_pkg/var $fs |
pascal@1313 | 40 ln -s /usr/bin/apachectl $fs/etc/init.d/apache |
pascal@1313 | 41 sed -i -e 's|User daemon|User www|' -e 's|Group daemon|Group www|' \ |
pascal@1313 | 42 -e 's|ServerAdmin you@example.com|ServerAdmin root@localhost|' \ |
pascal@1313 | 43 $fs/etc/apache/httpd.conf |
pascal@1313 | 44 echo "Include /etc/apache/conf.d" >> $fs/etc/apache/httpd.conf |
pascal@1313 | 45 # Cook all packages based on apache |
pascal@1313 | 46 for i in $(cd $WOK; ls -d apache-*) |
pascal@1313 | 47 do |
pascal@1313 | 48 tazwok genpkg $i |
pascal@1313 | 49 done |
pascal@1313 | 50 } |
pascal@1313 | 51 |
pascal@1313 | 52 # Pre and post install commands for Tazpkg. |
pascal@1313 | 53 # We stop the server by default in case of upgarde. |
pascal@1313 | 54 pre_install() |
pascal@1313 | 55 { |
pascal@1313 | 56 echo "Processing pre-install commands..." |
pascal@1313 | 57 [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop |
pascal@1313 | 58 } |
pascal@1313 | 59 |
pascal@1313 | 60 post_install() |
pascal@1313 | 61 { |
pascal@1313 | 62 echo "Processing post-install commands..." |
pascal@1313 | 63 # Just in case. |
pascal@1313 | 64 chown www.www $1/var/log/$PACKAGE |
pascal@1658 | 65 ping -c 2 $(hostname) > /dev/null 2>&1 || |
pascal@1658 | 66 sed -i "s/localhost/$(hostname) localhost/" /etc/hosts |
pascal@1313 | 67 /etc/init.d/$PACKAGE start |
pascal@1313 | 68 } |
pascal@1313 | 69 |
pascal@1313 | 70 # Rules to clean extras dirs or files |
pascal@1313 | 71 clean_wok() |
pascal@1313 | 72 { |
pascal@1313 | 73 rm -rf $WOK/$PACKAGE/${PACKAGE}.${VERSION} |
pascal@1313 | 74 } |