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