Magellan Linux

Contents of /trunk/extras/cups/cups-2.2.8-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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