wok view cups/receipt @ rev 24069

Add some current_version()
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 06 11:01:20 2021 +0000 (2021-07-06)
parents 37d8597570cc
children 92bbd9147f9b
line source
1 # SliTaz package receipt.
3 PACKAGE="cups"
4 VERSION="2.3.1"
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/apple/$PACKAGE/releases/download/v$VERSION/$TARBALL"
15 DEPENDS="cups-doc cups-filters dbus libcomerr libcups libkrb5 libssl
16 libunistring libusb-compat poppler-apps"
17 BUILD_DEPENDS="acl-dev dbus-dev gnutls-dev jpeg-dev libgcrypt-dev
18 libgnutls libpng-dev libtasn1-dev libunistring-dev libusb-compat-dev
19 openssl-dev php-dev poppler-apps tiff-dev zlib-dev"
21 current_version()
22 {
23 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
24 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
25 }
27 # Rules to configure and make the package.
28 compile_rules()
29 {
30 # patch -Np1 -i $stuff/install-sh.u
32 export LDFLAGS="$LDFLAGS -lrt"
34 # Set list of wanted locales in LOCALE_PACK
35 . $WOK/slitaz-i18n/stuff/locale-pack.conf
37 # <= 2.0.2 unrecognised
38 # --disable-ldap
39 # --disable-slp
40 # --with-pdftops=pdftops
42 ./configure \
43 --prefix=/usr \
44 --sysconfdir=/etc \
45 --localstatedir=/var \
46 --mandir=/usr/share/man \
47 --enable-static \
48 --disable-pam \
49 --disable-gssapi \
50 --disable-acl \
51 --enable-dbus \
52 --with-dbusdir=/etc/dbus-1 \
53 --with-cups-user=nobody \
54 --with-cups-group=nogroup \
55 --with-languages="$LOCALE_PACK" \
56 $CONFIGURE_ARGS &&
57 make &&
58 make BUILDROOT=$DESTDIR install
60 cp -f $stuff/cups.desktop \
61 $install/usr/share/applications/cups.desktop
62 }
64 # Rules to gen a SliTaz package suitable for Tazpkg.
65 genpkg_rules()
66 {
67 mkdir -p $fs/etc
68 mkdir -p $fs/usr/lib
69 mkdir -p $fs/usr/share
71 cp -a $install/etc/cups $fs/etc
72 cp -a $install/etc/dbus* $fs/etc
73 cp -a $install/usr/bin $fs/usr
74 cp -a $install/usr/sbin $fs/usr
75 cp -a $install/usr/lib/*.so* $fs/usr/lib
76 cp -a $install/usr/lib/cups $fs/usr/lib
77 cp -a $install/usr/share/cups $fs/usr/share
78 cp -a $install/usr/share/icons $fs/usr/share
79 cp -a $install/var $fs
81 # Remove files provided by cups-filters
82 rm -f $fs/usr/share/cups/banners/*
83 rm -f $fs/usr/share/cups/data/testprint
85 # Remove files provided by libcups
86 rm -f $fs/usr/lib/libcups.so*
88 # Daemon script
89 cp -a $stuff/etc $fs
90 sed -i 's|^#Group .*|Group lp|' $fs/etc/cups/cups-files.conf
92 # TazPanel link
93 cp -a $stuff/var $fs
95 sed -i 's|hostname:9100|&\n\n parallel:/dev/usb/lp0|' \
96 $fs/usr/share/cups/templates/choose-uri.tmpl
97 }
99 post_install()
100 {
101 # Start CUPS daemon and edit daemons.conf
102 if [ -z "$1" -a ! -s /aufs-umount.sh ]
103 then
104 /etc/init.d/cupsd start || continue
105 fi
106 rm -f "$1"/var/cache/tazpanel/* 2> /dev/null
107 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"
108 then
109 cat >> "$1/etc/daemons.conf" <<EOT
110 # CUPS printing daemon options.
111 CUPSD_OPTIONS=""
113 EOT
114 fi
115 }
117 pre_remove()
118 {
119 # Stop CUPS daemon before remove.
120 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
121 :
122 }
124 post_remove()
125 {
126 ln -fs /bin/busybox "$1/usr/bin/lpr"
127 }