wok-tiny annotate lpd-config/receipt @ rev 154

More verbose titles
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Sep 25 19:09:24 2019 +0200 (2019-09-25)
parents 10cf1a5f187d
children a28c45a86936
rev   line source
pascal@86 1 # SliTaz package receipt.
pascal@86 2
pascal@86 3 PACKAGE="lpd-config"
pascal@86 4 VERSION="1.0"
pascal@126 5 CATEGORY="meta"
pascal@86 6 SHORT_DESC="Line printer server configuration (without spooling)"
pascal@86 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@90 8 LICENSE="BSD"
pascal@86 9 WEB_SITE="http://tiny.slitaz.org/"
pascal@149 10 AUTO_SELECTION="CONFIG_LPD"
pascal@86 11 DEPENDS="base-tiny"
pascal@100 12 SUGGESTED="module-lp module-usblp"
pascal@86 13
pascal@86 14 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@86 15 genpkg_rules()
pascal@86 16 {
pascal@126 17 mkdir -p $fs/var/spool
pascal@86 18 }
pascal@86 19
pascal@86 20 config_form()
pascal@86 21 {
pascal@86 22 cat <<EOT
pascal@86 23 Respective printer names for lp0, lp1 ...
pascal@126 24 <input type="text" name="LP_NAMES" value="${LP_NAMES:-printer}" >
pascal@86 25 EOT
pascal@86 26 }
pascal@86 27
pascal@86 28 post_install()
pascal@86 29 {
pascal@86 30 local n
pascal@86 31 grep -q inetd $1/etc/rcS.conf ||
pascal@86 32 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
pascal@86 33 cat >> $1/etc/inetd.conf <<EOT
pascal@97 34 printer stream tcp nowait root lpd lpd /var/spool
pascal@86 35 EOT
pascal@86 36 n=0
pascal@86 37 for i in $(echo $LP_NAMES | sed 's/,/ /g') ; do
pascal@86 38 mknod $1/dev/lp$n c 6 $n
pascal@86 39 ln -s /dev/lp$n $1/var/spool/$i
pascal@86 40 n=$(($n + 1))
pascal@86 41 done
pascal@86 42 }