wok-next view cups/receipt @ rev 20280
remove cyrus-sasl-pam, libsasl-without-ldap, enlightenment-pam, enlightenment-backgrounds, libcap-pam
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Nov 08 14:41:47 2017 +0100 (2017-11-08) |
parents | 886f88dc3863 |
children | d3adbeea3a9f |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="cups"
4 VERSION="2.2.2"
5 CATEGORY="system-tools"
6 SHORT_DESC="Common UNIX Printing System"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2 LGPL2"
9 WEB_SITE="https://www.cups.org/"
11 TARBALL="cups-$VERSION-source.tar.gz"
12 WGET_URL="https://github.com/apple/cups/releases/download/v$VERSION/$TARBALL"
14 BUILD_DEPENDS="automake libusb-dev zlib-dev acl-dev dbus-dev gnutls-dev perl \
15 python pam pam-dev"
16 SPLIT="libcups cups cups-pam cups-doc cups-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 # gid 19 suggested by the BLFS is in use in SliTaz (by cdrom group),
22 # using 23 instead
23 addgroup -g 23 lpadmin &&
25 sed -i 's:555:755:g;s:444:644:g' Makedefs.in &&
26 sed -i '/MAN.EXT/s:.gz::g' configure config-scripts/cups-manpages.m4 &&
27 sed -i '/LIBGCRYPTCONFIG/d' config-scripts/cups-ssl.m4 &&
29 aclocal -I config-scripts &&
30 autoconf -I config-scripts &&
32 cp -a $src $src-pam
34 CC=gcc \
35 ./configure \
36 --sysconfdir=/etc \
37 --libdir=/usr/lib \
38 --localstatedir=/var \
39 --disable-pam \
40 --disable-systemd \
41 --with-rcdir=/tmp/cupsinit \
42 --with-system-groups=lpadmin \
43 --with-docdir=/usr/share/doc/cups-$VERSION \
44 $CONFIGURE_ARGS &&
45 make &&
46 make BUILDROOT=$install install &&
48 cd $src-pam &&
49 CC=gcc \
50 ./configure \
51 --sysconfdir=/etc \
52 --libdir=/usr/lib \
53 --localstatedir=/var \
54 --enable-pam \
55 --disable-systemd \
56 --with-rcdir=/tmp/cupsinit \
57 --with-system-groups=lpadmin \
58 --with-docdir=/usr/share/doc/cups-$VERSION \
59 $CONFIGURE_ARGS &&
60 make &&
61 make BUILDROOT=$install-pam install &&
63 for inst in $install $install-pam ; do
64 rm -rf $inst/tmp &&
66 ln -svnf ../doc/cups-$VERSION $inst/usr/share/cups/doc-$VERSION
68 echo "ServerName /var/run/cups/cups.sock" > $inst/etc/cups/client.conf &&
70 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
71 $inst/usr/share/cups/templates/choose-uri.tmpl &&
72 sed -i 's|htmlview|browser|' $inst/usr/share/applications/cups.desktop &&
73 sed -i 's|^#Group .*|Group lp|' $inst/etc/cups/cups-files.conf &&
75 # Daemon script
76 cp -a $stuff/etc $inst &&
77 chown -R root:root $inst/etc &&
78 # TazPanel link
79 cp -a $stuff/var $inst &&
80 chown -R root:root $inst/var &&
82 # Install ssl directory where to store the certs, solves some samba issues
83 install -dm700 -g lp $inst/etc/cups/ssl &&
85 # Install some more configuration files that will get filled by cupsd
86 touch $inst/etc/cups/printers.conf &&
87 touch $inst/etc/cups/classes.conf &&
88 touch $inst/etc/cups/subscriptions.conf &&
89 chgrp -R lp $inst/etc/cups &&
91 # Comment out unnecessary PageLogFormat entry
92 sed -i -e 's:PageLogFormat:#PageLogFormat:' $inst/etc/cups/cupsd.conf* &&
94 # Change files permissions to be accessible via web interface - will be
95 # fixed in post_install
96 chmod -c o+r $inst/etc/cups/* $inst/usr/sbin/cupsd \
97 $inst/usr/lib/cups/backend/ipp $inst/usr/lib/cups/backend/lpd
98 done
99 }
101 # Rules to gen a SliTaz package suitable for Tazpkg.
102 genpkg_rules()
103 {
104 case $PACKAGE in
105 libcups)
106 copy libcups.so*
107 CAT="system-tools|common libraries"
108 TAGS="printer printing"
109 DEPENDS="libgnutls zlib"
110 ;;
111 cups)
112 copy @std var/ # copy empty dirs in var/
113 remove_already_packed
114 DEPENDS="acl dbus libcups libgnutls libusb zlib"
115 CONFIG_FILES="/etc/cups/"
116 TAGS="printer printing"
117 ;;
118 cups-pam)
119 install=$install-pam \
120 copy @std var/ # copy empty dirs in var/
121 rm -f $fs/usr/lib/libcups.so*
122 DEPENDS="acl dbus libcups libgnutls libusb zlib pam"
123 PROVIDE="cups:pam"
124 CONFIG_FILES="/etc/cups/"
125 TAGS="printer printing"
126 ;;
127 cups-doc)
128 # We need the doc for CSS, images and help in the web interface.
129 copy doc/
130 CAT="docs|documentation"
131 DEPENDS="cups"
132 ;;
133 cups-dev)
134 copy @dev
135 ;;
136 esac
137 }
139 post_install_cups() {
140 # Start CUPS daemon
141 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
142 /etc/init.d/cupsd start || continue
143 fi
145 # Clean TazPanel menu cache
146 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
148 # Edit daemons.conf
149 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
150 cat >> "$1/etc/daemons.conf" <<EOT
151 # CUPS printing daemon options.
152 CUPSD_OPTIONS=""
154 EOT
155 fi
157 # Add lpadmin group
158 addgroup -g 23 lpadmin
160 # Return permissions to previous state
161 chmod 640 $1/etc/cups/*
162 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
163 chmod 500 $1/usr/sbin/cupsd
164 }
166 pre_remove_cups() {
167 # Stop CUPS daemon before rm.
168 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
169 :
170 }
172 post_install_cups_pam() {
173 # Start CUPS daemon
174 if [ -z "$1" -a ! -s /aufs-umount.sh ]; then
175 /etc/init.d/cupsd start || continue
176 fi
178 # Clean TazPanel menu cache
179 rm -f "$1"/var/cache/tazpanel/* 2>/dev/null
181 # Edit daemons.conf
182 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"; then
183 cat >> "$1/etc/daemons.conf" <<EOT
184 # CUPS printing daemon options.
185 CUPSD_OPTIONS=""
187 EOT
188 fi
190 # Add lpadmin group
191 addgroup -g 23 lpadmin
193 # Return permissions to previous state
194 chmod 640 $1/etc/cups/*
195 chmod 700 $1/usr/lib/cups/backend/ipp $1/usr/lib/cups/backend/lpd
196 chmod 500 $1/usr/sbin/cupsd
197 }
199 pre_remove_cups_pam() {
200 # Stop CUPS daemon before rm.
201 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
202 :
203 }