Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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