Annotation of /trunk/extras/cups/cups-2.3.0-r1.smage2
Parent Directory | Revision Log
Revision 33074 -
(hide annotations)
(download)
Thu Oct 17 16:21:49 2019 UTC (4 years, 11 months ago) by niro
File size: 6239 byte(s)
Thu Oct 17 16:21:49 2019 UTC (4 years, 11 months ago) by niro
File size: 6239 byte(s)
-re-diffed system-socket patch and dropped obsolete no-gzip-man patch
1 | niro | 33073 | # $Id$ |
2 | |||
3 | PNAME="cups" | ||
4 | PVER="2.3.0" | ||
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++-9.2 | ||
20 | >= sys-apps/systemd-242" | ||
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.81" | ||
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 | # cups conf revision | ||
42 | CUPS_CONF_TMPD_REV=1.2 | ||
43 | |||
44 | SRC_URI=( | ||
45 | https://github.com/apple/${PNAME}/releases/download/v${PVER}/${SRCFILE} | ||
46 | mirror://${PNAME}/${SRCFILE} | ||
47 | mirror://${PNAME}/cups.conf.tmpd-${CUPS_CONF_TMPD_REV} | ||
48 | mirror://${PNAME}/cups.logrotate | ||
49 | mirror://${PNAME}/cups.pam-systemauth | ||
50 | mirror://${PNAME}/${PNAME}-1.2.11-multilib.patch | ||
51 | niro | 33074 | mirror://${PNAME}/${PNAME}-2.3.0-systemd-socket.patch |
52 | niro | 33073 | mirror://${PNAME}/${PNAME}-1.5.0-build-fix.patch |
53 | mirror://${PNAME}/${PNAME}-2.1.4-dnssd-deviceid.patch | ||
54 | mirror://${PNAME}/${PNAME}-2.0.3-no-export-ssllibs.patch | ||
55 | mirror://${PNAME}/${PNAME}-2.0.3-statedir.patch | ||
56 | mirror://${PNAME}/${PNAME}-2.2.5-perms.patch | ||
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 | # fix hardcoded /usr/lib in cups-directories.m4 to respect 64bit arches | ||
86 | mpatch ${PNAME}-1.2.11-multilib.patch || die | ||
87 | |||
88 | # adds systemd socket activation support | ||
89 | niro | 33074 | mpatch ${PNAME}-2.3.0-systemd-socket.patch || die |
90 | niro | 33073 | |
91 | # fix build, adds missing -lrt | ||
92 | mpatch ${PNAME}-1.5.0-build-fix.patch || die | ||
93 | |||
94 | # mark DNSSD device-ids that have been guessed at with "FZY:1;" | ||
95 | mpatch ${PNAME}-2.1.4-dnssd-deviceid.patch || die | ||
96 | |||
97 | # do not export SSL libs in cups-config | ||
98 | mpatch ${PNAME}-2.0.3-no-export-ssllibs.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_TMPD_REV} 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 | } |