wok-tiny annotate p910nd/receipt @ rev 82
fix p910nd
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 20 00:33:31 2012 +0200 (2012-07-20) |
parents | dc79b649a4b9 |
children | c5d2f4ae4c16 |
rev | line source |
---|---|
pascal@16 | 1 # SliTaz package receipt. |
pascal@16 | 2 |
pascal@16 | 3 PACKAGE="p910nd" |
pascal@16 | 4 VERSION="0.93" |
pascal@16 | 5 CATEGORY="network" |
pascal@16 | 6 SHORT_DESC="Forward printer device to 9100+ ports" |
pascal@16 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@16 | 8 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pascal@16 | 9 WEB_SITE="http://p910nd.sourceforge.net/" |
pascal@16 | 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
pascal@16 | 11 [ -n "$TARGET" ] || TARGET="i486" |
pascal@16 | 12 BUILD_DEPENDS="uclibc-cross-compiler-$TARGET" |
pascal@16 | 13 DEPENDS="base-tiny" |
pascal@16 | 14 CONFIG_FILES="/etc/inetd.conf /etc/rcS.conf" |
pascal@16 | 15 |
pascal@16 | 16 # Rules to configure and make the package. |
pascal@16 | 17 compile_rules() |
pascal@16 | 18 { |
pascal@16 | 19 cd $src |
pascal@16 | 20 make CC=uclibc-$TARGET-cc CFLAGS=-DLOCKFILE_DIR=\\\"/var/lock\\\" && |
pascal@16 | 21 make DESTDIR=$PWD/_pkg install |
pascal@16 | 22 } |
pascal@16 | 23 |
pascal@16 | 24 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@16 | 25 genpkg_rules() |
pascal@16 | 26 { |
pascal@16 | 27 mkdir -p $fs/usr $fs/etc/init.d $fs/dev |
pascal@16 | 28 cp -a $_pkg/usr/sbin $fs/usr |
pascal@16 | 29 ln -s daemon $fs/etc/init.d/p910nd |
pascal@82 | 30 mkdir $fs/dev |
pascal@16 | 31 } |
pascal@16 | 32 |
pascal@16 | 33 post_install() |
pascal@16 | 34 { |
pascal@16 | 35 [ -n "$DEVICES" ] || DEVICES="/dev/lp0" |
pascal@16 | 36 grep -q inetd $1/etc/rcS.conf || |
pascal@16 | 37 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf |
pascal@16 | 38 grep -q p910nd $1/etc/rcS.conf || |
pascal@16 | 39 sed -i 's/^RUN_DAEMONS="/&p910nd /' $1/etc/rcS.conf |
pascal@16 | 40 grep -q p910nd $1/etc/inetd.conf || |
pascal@16 | 41 echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \ |
pascal@16 | 42 "%d stream tcp nowait root %s %s -b -f %s\n", 9100 + n++, \ |
pascal@16 | 43 "/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf |
pascal@82 | 44 for dev in $(cat $DEVICES | dos2unix); do |
pascal@81 | 45 mknod -m 660 $1$dev c 6 ${dev#*lp} |
pascal@80 | 46 done |
pascal@16 | 47 } |
pascal@16 | 48 |
pascal@16 | 49 config_form() |
pascal@16 | 50 { |
pascal@16 | 51 [ -n "$DEVICES" ] || DEVICES=/dev/lp0 |
pascal@16 | 52 grep -q p910nd $1/etc/inetd.conf && return 1 |
pascal@16 | 53 cat <<EOT |
pascal@16 | 54 Printer device(s): |
pascal@16 | 55 <textarea name="DEVICES"> |
pascal@16 | 56 $DEVICES |
pascal@16 | 57 </textarea> |
pascal@16 | 58 EOT |
pascal@16 | 59 } |