Magellan Linux

Annotation of /trunk/extras/cups/cups-2.2.8-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31203 - (hide annotations) (download)
Tue Jun 12 11:36:39 2018 UTC (5 years, 11 months ago) by niro
File size: 6281 byte(s)
auto added: ver bump to 2.2.8-r1
1 niro 31203 # $Id$
2    
3     PNAME="cups"
4     PVER="2.2.8"
5     PBUILD="r1"
6    
7     SPLIT_PACKAGES="libcups cups"
8    
9     PCAT="net-print"
10     HOMEPAGE="http://www.cups.org/"
11    
12     LIB_DEPEND=">= virtual/glibc
13     >= app-crypt/gnutls-3.6
14     >= media-libs/libpng-1.5
15     >= media-libs/libtiff-4
16     >= virtual/libjpeg
17     >= net-dns/avahi-0.7
18     >= sys-libs/zlib-1.2.5
19     >= sys-libs/libstdc++-6.3
20     >= sys-apps/systemd-230"
21    
22     CUPS_DEPEND=">= sys-libs/pam-1.1
23     >= sys-apps/acl-2.2
24     >= sys-apps/dbus-1.10
25     >= dev-libs/libusb-compat-0.1.3
26     >= dev-libs/dbus-glib-0.108
27     >= app-text/libpaper-1.1.24
28     >= app-text/poppler-0.65"
29    
30     SDEPEND="${LIB_DEPEND}
31     ${CUPS_DEPEND}
32     >= sys-dev/automake-9
33     >= sys-dev/autoconf-10"
34    
35     SRCFILE="${PNAME}-${PVER}-source.tar.gz"
36     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
37    
38     sminclude mtools multilib mbuild systemd
39     msetfeature "!check"
40    
41     SRC_URI=(
42     https://github.com/apple/${PNAME}/releases/download/v${PVER}/${SRCFILE}
43     mirror://${PNAME}/${SRCFILE}
44     mirror://${PNAME}/cups.conf.tmpd
45     mirror://${PNAME}/cups.logrotate
46     mirror://${PNAME}/cups.pam-systemauth
47     mirror://${PNAME}/${PNAME}-1.2.11-multilib.patch
48     mirror://${PNAME}/${PNAME}-2.2.7-systemd-socket.patch
49     mirror://${PNAME}/${PNAME}-1.5.0-build-fix.patch
50     mirror://${PNAME}/${PNAME}-2.1.4-dnssd-deviceid.patch
51     mirror://${PNAME}/${PNAME}-2.0.3-no-export-ssllibs.patch
52     mirror://${PNAME}/${PNAME}-2.2.3-no-gzip-man.patch
53     mirror://${PNAME}/${PNAME}-2.0.3-statedir.patch
54     mirror://${PNAME}/${PNAME}-2.2.5-perms.patch
55    
56     )
57    
58     # exclude beta versions
59     UP2EXCLUDE="b[0-9]"
60     UP2DATE="updatecmd https://github.com/apple/cups/releases | grep ${PNAME}- | sed 's:-source::g' | highesttarball gz"
61    
62     split_info_libcups()
63     {
64     DESCRIPTION="cups: common unix printing system - client libraries and headers"
65     DEPEND="${LIB_DEPEND}"
66     }
67    
68     split_info_cups()
69     {
70     DESCRIPTION="cups: common unix printing system - service daemons."
71     DEPEND="== net-print/libcups-${PVER}
72     ${CUPS_DEPEND}"
73     }
74    
75     pkg_setup()
76     {
77     preinstall_cups
78     }
79    
80     src_prepare()
81     {
82     munpack ${SRCFILE} || die
83    
84     # fix hardcoded /usr/lib in cups-directories.m4 to respect 64bit arches
85     mpatch ${PNAME}-1.2.11-multilib.patch || die
86    
87     # adds systemd socket activation support
88     mpatch ${PNAME}-2.2.7-systemd-socket.patch || die
89    
90     # fix build, adds missing -lrt
91     mpatch ${PNAME}-1.5.0-build-fix.patch || die
92    
93     # mark DNSSD device-ids that have been guessed at with "FZY:1;"
94     mpatch ${PNAME}-2.1.4-dnssd-deviceid.patch || die
95    
96     # do not export SSL libs in cups-config
97     mpatch ${PNAME}-2.0.3-no-export-ssllibs.patch || die
98    
99     # do not compress man pages
100     mpatch ${PNAME}-2.2.3-no-gzip-man.patch || die
101    
102     # move /var/run -> /run
103     mpatch ${PNAME}-2.0.3-statedir.patch || die
104    
105     # fix broken install permissions
106     mpatch ${PNAME}-2.2.5-perms.patch || die
107    
108     # set MaxLogSize to 0 to prevent using cups internal log rotation
109     sed -i -e '5i\ ' conf/cupsd.conf.in
110     sed -i -e '6i# Disable cups internal logging - use logrotate instead' conf/cupsd.conf.in
111     sed -i -e '7iMaxLogSize 0' conf/cupsd.conf.in
112    
113     # non standard configure
114     all-abis aclocal -I config-scripts --force || die
115     all-abis autoconf --force || die
116     }
117    
118     src_compile()
119     {
120     mconfigure \
121     --localstatedir=/var \
122     --with-docdir=/usr/share/cups/html \
123     --with-systemdsystemunitdir=$(mget-systemd-unit-dir) \
124     --with-cups-user=lp \
125     --with-cups-group=lp \
126     --with-system-groups=lpadmin \
127     --enable-threads \
128     --enable-pam \
129     --enable-nls \
130     --enable-dbus \
131     --enable-png \
132     --enable-jpeg \
133     --enable-tiff \
134     --enable-libpaper \
135     --enable-avahi \
136     --enable-ssl=yes \
137     --enable-gnutls \
138     --enable-raw-printing \
139     --disable-slp \
140     --disable-php \
141     --disable-ldap \
142     || die
143    
144     mmake || die
145     }
146    
147     src_install_libcups()
148     {
149     mmake BUILDROOT=${BINDIR} install-headers || die
150     mmake BUILDROOT=${BINDIR} install-libs || die
151     # install config utiliy so other packages can find the libs
152     # because there a no pkgconfig files
153     minstallexec cups-config || die
154     }
155    
156     src_install_cups()
157     {
158     mmake BUILDROOT=${BINDIR} install-data || die
159     mmake BUILDROOT=${BINDIR} install-exec || die
160    
161     # provided by libcups
162     mdelete /usr/bin/cups-config || die
163    
164     # gzip *all* ppd's not just few
165     find ${BINDIR}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f || die
166    
167     # remove 32bit serverbins and co on 64bit multilib systems
168     if [[ ${ARCH} = x86_64 ]]
169     then
170     if [[ -d ${BINDIR}/usr/lib/cups ]]
171     then
172     mdelete -r /usr/lib/cups || die
173     fi
174     fi
175    
176     # remove possible installed backup configs
177     find ${BINDIR}/etc -name "*.O" | xargs rm -f || die
178     find ${BINDIR}/etc -name "*.N" | xargs rm -f || die
179    
180     # tempfile creation
181     minstalltmp cups.conf.tmpd cups.conf || die
182    
183     # install logrotate config
184     minstalllog cups.logrotate cups || die
185    
186     # install pam config
187     minstallpam cups.pam-systemauth cups || die
188    
189     # ship some config files to keep many apps happy (javapps nxnode etc)
190     memptyfile /etc/cups/printers.conf || die
191     memptyfile /etc/cups/classes.conf || die
192     memptyfile /etc/cups/client.conf || die
193     memptyfile /etc/cups/subscriptions.conf || die
194    
195     # prevents uninstall from prior versions
196     mkeepdir /usr/share/cups/profiles || die
197     mkeepdir /usr/$(mlibdir)/cups/driver || die
198     mkeepdir /var/log/cups || die
199     mkeepdir /var/run/cups/certs || die
200     mkeepdir /var/spool/cups || die
201     mkeepdir /var/spool/cups/tmp || die
202    
203     # create a rss feed directory
204     mkeepdir /var/cache/cups/rss || die
205     mchown lp.lp /var/cache/cups/rss || die
206     mchmod 0740 /var/cache/cups/rss || die
207    
208     # create a ssl directory to store cacerts and to fix some samba issues
209     mkeepdir /etc/cups/ssl || die
210     mchown root:lp /etc/cups/ssl || die
211     mchmod 0700 /etc/cups/ssl || die
212    
213     # fix cupsd permisions
214     mchmod 0755 /usr/sbin/cupsd || die
215    
216     # install missing docs
217     minstalldocs CHANGES* CREDITS* LICENSE* README* || die
218     }
219    
220     preinstall_cups()
221     {
222     mgroupadd -o "-g 106" lpadmin
223     mgroupadd -o "-g 9" lp
224     museradd -o "-u 9 -g lp -d /var/spool/lpd -s /bin/false" lp
225     }
226    
227     postinstall_cups()
228     {
229     # renamed cups services
230     if systemctl is-enabled cups.service &> /dev/null
231     then
232     systemctl disable cups.service
233     fi
234     if systemctl is-enabled cups.socket &> /dev/null
235     then
236     systemctl disable cups.socket
237     fi
238     if systemctl is-enabled cups.path &> /dev/null
239     then
240     systemctl disable cups.path
241     fi
242    
243     mstartunit org.cups.cupsd.service cupsd
244     mstartunit org.cups.cupsd.socket cupsd
245     }
246    
247     postremove_cups()
248     {
249     mstopunit org.cups.cupsd.service cupsd
250     mstopunit org.cups.cupsd.socket cupsd
251     }