Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33073 - (hide annotations) (download)
Thu Oct 17 15:48:28 2019 UTC (4 years, 8 months ago) by niro
File size: 6369 byte(s)
auto added: ver bump to 2.3.0-r1
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     mirror://${PNAME}/${PNAME}-2.2.8-systemd-socket.patch
52     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.2.3-no-gzip-man.patch
56     mirror://${PNAME}/${PNAME}-2.0.3-statedir.patch
57     mirror://${PNAME}/${PNAME}-2.2.5-perms.patch
58     )
59    
60     # exclude beta versions
61     UP2EXCLUDE="b[0-9]"
62     UP2DATE="updatecmd https://github.com/apple/cups/releases | grep ${PNAME}- | sed 's:-source::g' | highesttarball gz"
63    
64     split_info_libcups()
65     {
66     DESCRIPTION="cups: common unix printing system - client libraries and headers"
67     DEPEND="${LIB_DEPEND}"
68     }
69    
70     split_info_cups()
71     {
72     DESCRIPTION="cups: common unix printing system - service daemons."
73     DEPEND="== net-print/libcups-${PVER}
74     ${CUPS_DEPEND}"
75     }
76    
77     pkg_setup()
78     {
79     preinstall_cups
80     }
81    
82     src_prepare()
83     {
84     munpack ${SRCFILE} || die
85    
86     # fix hardcoded /usr/lib in cups-directories.m4 to respect 64bit arches
87     mpatch ${PNAME}-1.2.11-multilib.patch || die
88    
89     # adds systemd socket activation support
90     mpatch ${PNAME}-2.2.8-systemd-socket.patch || die
91    
92     # fix build, adds missing -lrt
93     mpatch ${PNAME}-1.5.0-build-fix.patch || die
94    
95     # mark DNSSD device-ids that have been guessed at with "FZY:1;"
96     mpatch ${PNAME}-2.1.4-dnssd-deviceid.patch || die
97    
98     # do not export SSL libs in cups-config
99     mpatch ${PNAME}-2.0.3-no-export-ssllibs.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.2.5-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_TMPD_REV} 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     }