Magellan Linux

Contents of /trunk/extras/cups/cups-1.5.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11059 - (show annotations) (download)
Thu Feb 16 09:04:56 2012 UTC (12 years, 3 months ago) by niro
File size: 6122 byte(s)
-fixed systemd patch to match avahi patches
1 # $Id$
2
3 PNAME="cups"
4 PVER="1.5.2"
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-2.12
14 >= media-libs/libpng-1.5
15 >= media-libs/libtiff-4
16 >= media-libs/libjpeg-8
17 >= net-dns/avahi-0.6.30
18 >= sys-libs/zlib-1.2.5
19 >= sys-libs/libstdc++-4.6"
20
21 CUPS_DEPEND=">= sys-libs/pam-1.1
22 >= sys-apps/acl-2.2
23 >= sys-apps/dbus-1.5
24 >= dev-libs/libusb-compat-0.1.3
25 >= dev-libs/dbus-glib-0.98
26 >= app-text/libpaper-1.1.24
27 >= app-text/poppler-0.18"
28
29 SDEPEND="${LIB_DEPEND}
30 ${CUPS_DEPEND}
31 >= sys-dev/automake-4
32 >= sys-dev/autoconf-5"
33
34 SRCFILE="${PNAME}-${PVER}-source.tar.bz2"
35 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
36
37 sminclude mbuild mtools multilib
38 msetfeature "!check"
39
40 SRC_URI=(
41 http://ftp.easysw.com/pub/${PNAME}/${PVER}/${SRCFILE}
42 mirror://${PNAME}/${SRCFILE}
43 mirror://${PNAME}/cups.conf.tmpd
44 mirror://${PNAME}/cups.logrotate
45 mirror://${PNAME}/cups.pam-systemauth
46 mirror://${PNAME}/${PNAME}-1.2.11-multilib.patch
47 mirror://${PNAME}/${PNAME}-1.4.1-backend-https.patch
48 mirror://${PNAME}/${PNAME}-1.5.2-systemd-socket.patch
49 mirror://${PNAME}/${PNAME}-1.5.0-build-fix.patch
50 mirror://${PNAME}/${PNAME}-1.5.2-dnssd-build.patch
51 mirror://${PNAME}/${PNAME}-1.5.2-avahi-1-config.patch
52 mirror://${PNAME}/${PNAME}-1.5.2-avahi-2-backend.patch
53 mirror://${PNAME}/${PNAME}-1.5.2-avahi-3-timeouts.patch
54 mirror://${PNAME}/${PNAME}-1.5.2-avahi-4-poll.patch
55 mirror://${PNAME}/${PNAME}-1.5.2-avahi-5-services.patch
56 mirror://${PNAME}/${PNAME}-1.5.2-dnssd-deviceid.patch
57 )
58
59 UP2DATE="updatecmd ${HOMEPAGE} | grep 'Download CUPS' | grep v[0-9] | sed 's/.*v\([0-9].*\)\ (.*/\1/'"
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 src_prepare()
75 {
76 munpack ${SRCFILE} || die
77
78 # fix hardcoded /usr/lib in cups-directories.m4 to respect 64bit arches
79 mpatch ${PNAME}-1.2.11-multilib.patch || die
80
81 # create a missing symlink to allow https printing via IPP, bug #217293
82 mpatch ${PNAME}-1.4.1-backend-https.patch || die
83
84 # adds systemd socket activation support
85 mpatch ${PNAME}-1.5.2-systemd-socket.patch || die
86
87 # fix build, adds missing -lrt
88 mpatch ${PNAME}-1.5.0-build-fix.patch || die
89
90 # simplify the DNSSD parts so they can build using the compat library
91 mpatch ${PNAME}-1.5.2-dnssd-build.patch || die
92
93 # real avahi support - from redhat/fedora
94 # - discovery in the dnssd backend
95 # - service announcement in the scheduler
96 mpatch ${PNAME}-1.5.2-avahi-1-config.patch || die
97 mpatch ${PNAME}-1.5.2-avahi-2-backend.patch || die
98 mpatch ${PNAME}-1.5.2-avahi-3-timeouts.patch || die
99 mpatch ${PNAME}-1.5.2-avahi-4-poll.patch || die
100 mpatch ${PNAME}-1.5.2-avahi-5-services.patch || die
101
102 # mark DNSSD device-ids that have been guessed at with "FZY:1;"
103 mpatch ${PNAME}-1.5.2-dnssd-deviceid.patch || die
104
105 # non standard configure
106 all-abis aclocal -I config-scripts --force || die
107 all-abis autoconf --force || die
108 }
109
110 src_compile()
111 {
112 mconfigure \
113 --localstatedir=/var \
114 --with-docdir=/usr/share/cups/html \
115 --with-systemdsystemunitdir=/usr/lib/systemd/system \
116 --with-cups-user=lp \
117 --with-cups-group=lp \
118 --with-system-groups=lpadmin \
119 --enable-threads \
120 --enable-pam \
121 --enable-nls \
122 --enable-dbus \
123 --enable-png \
124 --enable-jpeg \
125 --enable-tiff \
126 --enable-libpaper \
127 --enable-avahi \
128 --enable-ssl=yes --enable-gnutls \
129 --disable-slp \
130 --disable-php \
131 --disable-ldap \
132 || die
133
134 mmake || die
135 }
136
137 src_install_libcups()
138 {
139 mmake BUILDROOT=${BINDIR} install-headers || die
140 mmake BUILDROOT=${BINDIR} install-libs || die
141 # install config utiliy so other packages can find the libs
142 # because there a no pkgconfig files
143 minstallexec cups-config || die
144 }
145
146 src_install_cups()
147 {
148 mmake BUILDROOT=${BINDIR} install-data || die
149 mmake BUILDROOT=${BINDIR} install-exec || die
150
151 # provided by libcups
152 rm ${BINDIR}/usr/bin/cups-config || die
153
154 # gzip *all* ppd's not just few
155 find ${BINDIR}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f || die
156
157 # remove 32bit serverbins and co on 64bit multilib systems
158 if [[ ${ARCH} = x86_64 ]]
159 then
160 [[ -d ${BINDIR}/usr/lib/cups ]] && ( rm -rf ${BINDIR}/usr/lib/cups || die; )
161 fi
162
163 # remove possible installed backup configs
164 find ${BINDIR}/etc -name "*.O" | xargs rm -f || die
165 find ${BINDIR}/etc -name "*.N" | xargs rm -f || die
166
167 # removing cups created init-scripts
168 rm -rf ${BINDIR}/etc/rc*.d || die
169
170 # remove /etc/init.d too
171 rm -rf ${BINDIR}/etc/init.d || die
172
173 # tempfile creation
174 minstalltmp cups.conf.tmpd cups.conf || die
175
176 # install logrotate config
177 minstalllog cups.logrotate cups || die
178
179 # install pam config
180 minstallpam cups.pam-systemauth cups || die
181
182 # ship some config files to keep many apps happy (javapps nxnode etc)
183 memptyfile /etc/cups/printers.conf || die
184 memptyfile /etc/cups/classes.conf || die
185 memptyfile /etc/cups/client.conf || die
186 memptyfile /etc/cups/subscriptions.conf || die
187
188 # prevents uninstall from prior versions
189 mkeepdir /usr/share/cups/profiles || die
190 mkeepdir /usr/$(mlibdir)/cups/driver || die
191 mkeepdir /var/log/cups || die
192 mkeepdir /var/run/cups/certs || die
193 mkeepdir /var/spool/cups || die
194 mkeepdir /var/spool/cups/tmp || die
195
196 # create a rss feed directory
197 mkeepdir /var/cache/cups/rss || die
198 mchown lp.lp /var/cache/cups/rss || die
199 mchmod 0740 /var/cache/cups/rss || die
200
201 # create a ssl directory to store cacerts and to fix some samba issues
202 mkeepdir /etc/cups/ssl || die
203 mchown root:lp /etc/cups/ssl || die
204 mchmod 0700 /etc/cups/ssl || die
205
206 # install missing docs
207 minstalldocs CHANGES* CREDITS* LICENSE* README* || die
208 }
209
210 preinstall_cups()
211 {
212 ${MLIBDIR}/mgroupadd -o "-g 106" lpadmin
213 ${MLIBDIR}/mgroupadd -o "-g 9" lp
214 ${MLIBDIR}/museradd -o "-u 9 -g lp -d /var/spool/lpd -s /bin/false" lp
215 }
216
217 postinstall_cups()
218 {
219 mstartunit cups.service cupsd
220 mstartunit cups.socket cupsd
221 }
222
223 postremove_cups()
224 {
225 mstopunit cups.service cupsd
226 mstopunit cups.socket cupsd
227 }