wok-next view cups/receipt @ rev 21572

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