wok annotate zaptel/receipt @ rev 1780
zaptel: add udev rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Nov 29 08:56:18 2008 +0000 (2008-11-29) |
parents | 0d30d3d18dcb |
children | bd6010223726 |
rev | line source |
---|---|
pascal@1187 | 1 # SliTaz package receipt. |
pascal@1187 | 2 |
pascal@1187 | 3 PACKAGE="zaptel" |
pascal@1327 | 4 VERSION="bristuff" |
pascal@1423 | 5 CATEGORY="misc" |
pascal@1187 | 6 SHORT_DESC="Zapata Telephony Interface Driver." |
pascal@1187 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@1187 | 8 WEB_SITE="http://www.digium.com/" |
pascal@1187 | 9 WANTED="bristuff" |
pascal@1187 | 10 CONFIG_FILES="/etc/zaptel.conf" |
pascal@1187 | 11 |
pascal@1187 | 12 # Extract VERSION from WANTED package source |
pascal@1187 | 13 get_version() |
pascal@1187 | 14 { |
pascal@1187 | 15 eval $(grep ^ZAP_VER= $WOK/$WANTED/$WANTED-*/download.sh) |
pascal@1327 | 16 VERSION=$WANTED-$ZAP_VER |
pascal@1187 | 17 } |
pascal@1187 | 18 |
pascal@1187 | 19 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1187 | 20 genpkg_rules() |
pascal@1187 | 21 { |
pascal@1780 | 22 mkdir -p $fs/etc/udev/rules.d |
pascal@1327 | 23 get_version |
pascal@1327 | 24 [ -d taz/$PACKAGE-$WANTED/fs ] && \ |
pascal@1327 | 25 mv taz/$PACKAGE-$WANTED taz/$PACKAGE-$VERSION |
pascal@1187 | 26 kver=$(grep "kernel version" ../linux/linux-*/.config) |
pascal@1187 | 27 kver=${kver##* } |
pascal@1187 | 28 EXTRAVERSION=_$kver |
pascal@1187 | 29 _pkg=$(cd $(dirname $src)/$WANTED-*/_pkg ; pwd) |
pascal@1187 | 30 while read file; do |
pascal@1187 | 31 dir=$(dirname $file) |
pascal@1187 | 32 [ -d $fs$dir ] || mkdir -p $fs$dir |
pascal@1187 | 33 eval cp -a "$_pkg$file" $fs$dir |
pascal@1187 | 34 done < $_pkg/../$PACKAGE.files-list |
pascal@1187 | 35 rm -f $fs/lib/modules/*/modules.* |
pascal@1780 | 36 src=$(dirname $_pkg) |
pascal@1780 | 37 cp $src/zaptel/build_tools/genudevrules $fs |
pascal@1780 | 38 sed -i 's/^ver/ver=99 # ver/' $fs/genudevrules |
pascal@1780 | 39 $fs/genudevrules | sed 's/asterisk/root/g' > $fs/etc/udev/rules.d/zaptel.rules |
pascal@1780 | 40 rm -f $fs/genudevrules |
pascal@1780 | 41 |
pascal@1187 | 42 } |
pascal@1187 | 43 |
pascal@1187 | 44 # Post install/remove commands for Tazpkg. |
pascal@1187 | 45 post_install() |
pascal@1187 | 46 { |
pascal@1213 | 47 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ |
pascal@1213 | 48 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT |
pascal@1213 | 49 etc/zaptel.conf |
pascal@1213 | 50 EOT |
pascal@1455 | 51 depmod -a -b "$1/" ${EXTRAVERSION#_}-slitaz |
pascal@1187 | 52 } |
pascal@1187 | 53 |
pascal@1187 | 54 post_remove() |
pascal@1187 | 55 { |
pascal@1187 | 56 depmod -a |
pascal@1187 | 57 } |
pascal@1187 | 58 |
pascal@1213 | 59 repack_cleanup() |
pascal@1213 | 60 { |
pascal@1213 | 61 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) |
pascal@1213 | 62 } |