wok-current view cups/receipt @ rev 25678
Reenable network feature for hplip
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Thu Mar 07 20:38:36 2024 +0000 (8 months ago) |
parents | a23978bfa665 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="cups"
4 VERSION="2.4.7"
5 CATEGORY="system-tools"
6 TAGS="printer printing"
7 SHORT_DESC="Common UNIX Printing System."
8 MAINTAINER="erjo@slitaz.org"
9 LICENSE="GPL2 LGPL2"
10 WEB_SITE="https://www.cups.org/"
12 TARBALL="$PACKAGE-$VERSION-source.tar.gz"
13 WGET_URL="https://github.com/OpenPrinting/$PACKAGE/releases/download/v$VERSION/$TARBALL"
15 SUGGESTED="cups-lang"
16 DEPENDS="cups-doc dbus libcomerr libcups libkrb5 libssl \
17 libunistring libusb-compat poppler-apps cups-filters" # poppler-apps cups-filters
18 BUILD_DEPENDS="acl-dev dbus-dev gnutls-dev jpeg-dev libgcrypt-dev \
19 libgnutls libpng-dev libtasn1-dev libunistring-dev libusb-compat-dev \
20 openssl-dev php-dev tiff-dev zlib-dev poppler-apps" # poppler-apps
22 # build first without poppler-apps / cups-filters avoid loop between qt4/poppler/cups
23 # and gutenprint/ghostscript.
24 # Rebuild it with cups-filters / poppler-apps deps
26 current_version()
27 {
28 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
29 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
30 }
32 # Rules to configure and make the package.
33 compile_rules()
34 {
35 # patch -Np1 -i $stuff/install-sh.u
37 export LDFLAGS="$LDFLAGS -lrt"
39 # Set list of wanted locales in LOCALE_PACK
40 . $WOK/slitaz-i18n/stuff/locale-pack.conf
42 # <= 2.0.2 unrecognised
43 # --disable-ldap
44 # --disable-slp
45 # --with-pdftops=pdftops
47 ./configure \
48 --prefix=/usr \
49 --sysconfdir=/etc \
50 --localstatedir=/var \
51 --mandir=/usr/share/man \
52 --enable-static \
53 --disable-pam \
54 --disable-gssapi \
55 --disable-acl \
56 --enable-dbus \
57 --with-dbusdir=/etc/dbus-1 \
58 --with-cups-user=nobody \
59 --with-cups-group=nogroup \
60 --with-languages="$LOCALE_PACK" \
61 --with-cups-build \
62 $CONFIGURE_ARGS &&
63 make &&
64 make install BUILDROOT=$DESTDIR
66 cp -f $stuff/cups.desktop \
67 $install/usr/share/applications/cups.desktop
68 }
70 # Rules to gen a SliTaz package suitable for Tazpkg.
71 genpkg_rules()
72 {
73 mkdir -p $fs/etc
74 mkdir -p $fs/usr/lib
75 mkdir -p $fs/usr/share
77 cp -a $install/etc/cups $fs/etc
78 cp -a $install/etc/dbus* $fs/etc
79 cp -a $install/usr/bin $fs/usr
80 cp -a $install/usr/lib/*.so* $fs/usr/lib
81 cp -a $install/usr/lib/cups $fs/usr/lib
82 cp -a $install/usr/sbin $fs/usr
83 cp -a $install/usr/share/cups $fs/usr/share
84 cp -a $install/usr/share/icons $fs/usr/share
85 cp -a $install/var $fs
87 # Remove files provided by cups-filters
88 rm -f $fs/usr/share/cups/banners/*
89 rm -f $fs/usr/share/cups/data/testprint
91 # Remove files provided by libcups
92 rm -f $fs/usr/lib/libcups.so*
94 # Daemon script
95 cp -a $stuff/etc $fs
96 sed -i 's|^#Group .*|Group lp|' $fs/etc/cups/cups-files.conf
98 # TazPanel link
99 cp -a $stuff/var $fs
101 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
102 $fs/usr/share/cups/templates/choose-uri.tmpl
103 }
105 post_install()
106 {
107 # Start CUPS daemon and edit daemons.conf
108 if [ -z "$1" -a ! -s /aufs-umount.sh ]
109 then
110 /etc/init.d/cupsd start || continue
111 fi
112 rm -f "$1"/var/cache/tazpanel/* 2> /dev/null
113 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"
114 then
115 cat >> "$1/etc/daemons.conf" <<EOT
116 # CUPS printing daemon options.
117 CUPSD_OPTIONS=""
119 EOT
120 fi
121 echo "Add cupsd to RUN_DAEMONS in /etc/rcS.conf to start cupsd after SliTaz startup."
122 }
124 pre_remove()
125 {
126 # Stop CUPS daemon before removing.
127 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
128 :
129 }
131 post_remove()
132 {
133 ln -fs /bin/busybox "$1/usr/bin/lpr"
134 }