wok-tiny view lpd-config/receipt @ rev 141

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