wok annotate c_icap/receipt @ rev 24373

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 05 16:12:08 2022 +0000 (2022-02-05)
parents 59a032355c05
children 267887cc84bf
rev   line source
erjo@11890 1 # SliTaz package receipt.
erjo@11890 2
erjo@11890 3 PACKAGE="c_icap"
Hans-G?nter@22576 4 VERSION="0.5.6"
erjo@11890 5 CATEGORY="network"
erjo@11890 6 SHORT_DESC="Implementation of an ICAP server."
erjo@11890 7 MAINTAINER="erjo@slitaz.org"
pascal@14996 8 LICENSE="LGPL2.1"
erjo@11890 9 WEB_SITE="http://c-icap.sourceforge.net/"
Hans-G?nter@20757 10
erjo@11890 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@11890 12 WGET_URL="$SF_MIRROR/c-icap/$TARBALL"
erjo@11890 13
erjo@11890 14 DEPENDS=""
erjo@11890 15 BUILD_DEPENDS=""
erjo@11890 16
pascal@24373 17 # What is the latest version available today?
pascal@24373 18 current_version()
pascal@24373 19 {
pascal@24373 20 wget -O - https://sourceforge.net/projects/c-icap/files/c-icap/ 2>/dev/null | \
pascal@24373 21 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
pascal@24373 22 sed '/scope="row/!d;s|.*/c_icap-||;s|.tar.*||;q'
pascal@24373 23 }
pascal@24373 24
erjo@11890 25 # Rules to configure and make the package.
erjo@11890 26 compile_rules()
erjo@11890 27 {
Hans-G?nter@22576 28 ./configure \
Hans-G?nter@22576 29 --sysconfdir=/etc/c-icap \
Hans-G?nter@22576 30 --enable-large-files \
Hans-G?nter@20757 31 $CONFIGURE_ARGS &&
Hans-G?nter@20757 32 make &&
Hans-G?nter@20757 33 make install
erjo@11890 34 }
erjo@11890 35
erjo@11890 36 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@11890 37 genpkg_rules()
erjo@11890 38 {
Hans-G?nter@22576 39 mkdir -p $fs/usr/lib/$PACKAGE
Hans-G?nter@22576 40 mkdir -p $fs/etc/init.d
Hans-G?nter@22576 41 mkdir -p $fs/var/log/c-icap
Hans-G?nter@22576 42
Hans-G?nter@22576 43 cp -a $install/usr/bin $fs/usr
Hans-G?nter@22576 44 cp -a $install/usr/lib/*.so* $fs/usr/lib
Hans-G?nter@22576 45 cp -a $install/usr/lib/$PACKAGE/*.so* $fs/usr/lib/$PACKAGE
Hans-G?nter@22576 46 cp -pa $install/etc $fs/
Hans-G?nter@22576 47 cp -pa $stuff/c-icapd $fs/etc/init.d
Hans-G?nter@22576 48
erjo@11890 49 # Cleanup
erjo@11890 50 rm -f $fs/usr/bin/c-icap-config
Hans-G?nter@22576 51
Hans-G?nter@22576 52 # Fix configuration file
Hans-G?nter@22576 53 sed -i -e "s|YourServerName|localhost|" \
Hans-G?nter@22576 54 -e "s|/usr/var/log|/var/log/c-icap/|" \
Hans-G?nter@22576 55 -e "s|/usr/var/run/|/var/run/c-icap|" \
Hans-G?nter@22576 56 -e "s|/usr/etc|/etc/c-icap|" \
Hans-G?nter@22576 57 $fs/etc/c-icap/c-icap.conf
erjo@11941 58 chmod -x $fs/etc/c-icap/*
erjo@11890 59 }
erjo@11941 60
erjo@11941 61 post_install()
erjo@11941 62 {
Hans-G?nter@22576 63 [ -z "$1" -a ! -s /aufs-umount.sh ] &&
Hans-G?nter@22576 64 /etc/init.d/c-icapd start
Hans-G?nter@22576 65
erjo@11941 66 cat <<EOF
erjo@11941 67
erjo@11941 68 ----
erjo@11941 69 To start $PACKAGE server you can run :
erjo@11941 70
erjo@11941 71 /etc/init.d/$PACKAGE start
erjo@11941 72
erjo@11941 73 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@11941 74 ----
erjo@11941 75 EOF
erjo@11941 76 }
erjo@11941 77
Hans-G?nter@22576 78 pre_remove()
Hans-G?nter@22576 79 {
erjo@11941 80 echo "Stopping daemon..."
Hans-G?nter@22576 81 if (ps | grep -q c-icap)
Hans-G?nter@22576 82 then
pascal@17552 83 chroot "$1/" /etc/init.d/c-icapd stop
erjo@11941 84 fi
erjo@11941 85 }
Hans-G?nter@22576 86
erjo@11941 87 post_remove()
erjo@11941 88 {
erjo@11941 89 echo "Removing stalled files..."
pascal@18730 90 test -d "$1/var/log/c-icap" && rm -rf "$1/var/log/c-icap"
pascal@18730 91 test -d "$1/usr/run/c-icap" && rm -rf "$1/usr/run/c-icap"
erjo@11941 92 }