wok-6.x view cups-pam/receipt @ rev 24055

Add current_version for most github hosted softwares
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 08 08:46:05 2021 +0000 (2021-06-08)
parents 5f106bffd69a
children 92bbd9147f9b
line source
1 # SliTaz package receipt.
3 PACKAGE="cups-pam"
4 VERSION="2.3.1"
5 CATEGORY="system-tools"
6 SHORT_DESC="Common UNIX Printing System with PAM support."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2 LGPL2"
9 WEB_SITE="https://www.cups.org/"
11 SOURCE="cups"
12 TARBALL="$SOURCE-$VERSION-source.tar.gz"
13 WGET_URL="https://github.com/apple/$SOURCE/releases/download/v$VERSION/$TARBALL"
15 PROVIDE="cups:pam"
16 DEPENDS="cups-doc cups-filters dbus libcomerr libcups libkrb5 libssl
17 libunistring pam"
18 BUILD_DEPENDS="acl-dev dbus-dev gnutls-dev jpeg-dev libcomerr-dev
19 libgcrypt-dev libgnutls libpng-dev libunistring-dev openssl-dev
20 pam pam-dev tiff-dev"
22 current_version()
23 {
24 wget -O - ${WGET_URL%/down*} 2>/dev/null | \
25 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
26 }
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 # patch -Np1 -i ${WOK}/cups/stuff/install-sh.u
33 export LDFLAGS="$LDFLAGS -lrt"
35 # Set list of wanted locales in LOCALE_PACK
36 . $WOK/slitaz-i18n/stuff/locale-pack.conf
38 # <= 2.0.2 unrecognised
39 # --disable-ldap
41 ./configure \
42 --prefix=/usr \
43 --sysconfdir=/etc \
44 --localstatedir=/var \
45 --mandir=/usr/share/man \
46 --enable-static \
47 --enable-pam \
48 --disable-ldap \
49 --with-cups-user=nobody \
50 --with-cups-group=nogroup \
51 --with-languages="$LOCALE_PACK" \
52 $CONFIGURE_ARGS &&
53 make &&
54 make BUILDROOT=$DESTDIR install
56 cp -f $WOK/cups/stuff/cups.desktop \
57 $install/usr/share/applications/cups.desktop
58 }
60 # Rules to gen a SliTaz package suitable for Tazpkg.
61 genpkg_rules()
62 {
63 mkdir -p $fs/etc
64 mkdir -p $fs/usr/lib
65 mkdir -p $fs/usr/share
67 cp -a $install/etc/cups $fs/etc
68 cp -a $install/etc/dbus* $fs/etc
69 cp -a $install/usr/bin $fs/usr
70 cp -a $install/usr/sbin $fs/usr
71 cp -a $install/usr/lib/*.so* $fs/usr/lib
72 cp -a $install/usr/lib/cups $fs/usr/lib
73 cp -a $install/usr/share/cups $fs/usr/share
74 cp -a $install/usr/share/icons $fs/usr/share
75 cp -a $install/var $fs
77 # Remove files provided by cups-filters
78 rm -f $fs/usr/share/cups/banners/*
79 rm -f $fs/usr/share/cups/data/testprint
81 # Remove files provided by libcups
82 rm -f $fs/usr/lib/libcups.so*
84 # PAM conf
85 cp -a $stuff/etc $fs
87 # Daemon script
88 cp -a $WOK/cups/stuff/etc $fs
90 # TazPanel link
91 cp -a $WOK/cups/stuff/var $fs
93 }
95 post_install()
96 {
97 # Start CUPS daemon and edit daemons.conf
98 if [ -z "$1" -a ! -s /aufs-umount.sh ]
99 then
100 /etc/init.d/cupsd start || continue
101 fi
102 if ! grep -q ^CUPSD_OPTIONS "$1/etc/daemons.conf"
103 then
104 cat >> "$1/etc/daemons.conf" <<EOT
105 # CUPS printing daemon options.
106 CUPSD_OPTIONS=""
108 EOT
109 fi
110 }
112 pre_remove()
113 {
114 # Stop CUPS daemon before remove.
115 [ -z "$1" -a -x /etc/init.d/cupsd ] && /etc/init.d/cupsd stop
116 :
117 }
119 post_remove()
120 {
121 ln -s /bin/busybox "$1/usr/bin/lpr"
122 }