Annotation of /trunk/extras/avahi/avahi-0.7-r1.smage2
Parent Directory | Revision Log
Revision 30014 -
(hide annotations)
(download)
Fri Oct 20 12:40:31 2017 UTC (7 years ago) by niro
File size: 7121 byte(s)
Fri Oct 20 12:40:31 2017 UTC (7 years ago) by niro
File size: 7121 byte(s)
auto added: ver bump to 0.7-r1
1 | niro | 30014 | # $Id$ |
2 | |||
3 | PNAME="avahi" | ||
4 | PVER="0.7" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | SPLIT_PACKAGES="avahi avahi-gtk avahi-gtk3 avahi-qt4" | ||
8 | |||
9 | PCAT="net-dns" | ||
10 | HOMEPAGE="http://avahi.org/" | ||
11 | |||
12 | AVAHI_DEPEND=">= dev-libs/libdaemon-0.14 | ||
13 | >= dev-libs/expat-2 | ||
14 | >= dev-libs/glib2-2.54 | ||
15 | >= sys-apps/dbus-1.10 | ||
16 | >= sys-libs/libcap-2.25 | ||
17 | >= sys-libs/libstdc++-6.3 | ||
18 | >= virtual/initscripts | ||
19 | >= net-dns/nss-mdns-0.10" | ||
20 | GTK_DEPEND=">= x11-libs/gtk2+-2.24 | ||
21 | >= gnome-base/libglade-2.6.4" | ||
22 | GTK3_DEPEND=">= x11-libs/gtk3+-3.22" | ||
23 | QT4_DEPEND=">= x11-libs/qt4-core-4.8" | ||
24 | |||
25 | SDEPEND="${AVAHI_DEPEND} | ||
26 | ${GTK_DEPEND} | ||
27 | ${GTK3_DEPEND} | ||
28 | ${QT4_DEPEND} | ||
29 | >= dev-util/intltool-0.50 | ||
30 | >= dev-util/pkgconfig-0.25" | ||
31 | |||
32 | SRCFILE="${PNAME}-${PVER}.tar.gz" | ||
33 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
34 | |||
35 | sminclude mtools qt4 multilib mbuild systemd cleanutils | ||
36 | |||
37 | SRC_URI=( | ||
38 | http://avahi.org/download/${SRCFILE} | ||
39 | mirror://${PNAME}/${SRCFILE} | ||
40 | ) | ||
41 | |||
42 | UP2DATE="updatecmd ${HOMEPAGE}/download | grep ${PNAME}- | lasttarball gz" | ||
43 | |||
44 | split_info_avahi() | ||
45 | { | ||
46 | DESCRIPTION="Avahi is a system which facilitates service discovery on a local network." | ||
47 | DEPEND="${AVAHI_DEPEND}" | ||
48 | } | ||
49 | |||
50 | split_info_avahi-gtk() | ||
51 | { | ||
52 | DESCRIPTION="GTK2 user interface library for Avahi." | ||
53 | DEPEND="== net-dns/avahi-${PVER} | ||
54 | ${GTK_DEPEND}" | ||
55 | } | ||
56 | |||
57 | split_info_avahi-gtk3() | ||
58 | { | ||
59 | DESCRIPTION="GTK3 user interface library for Avahi." | ||
60 | DEPEND="== net-dns/avahi-${PVER} | ||
61 | ${GTK3_DEPEND}" | ||
62 | } | ||
63 | |||
64 | split_info_avahi-qt4() | ||
65 | { | ||
66 | DESCRIPTION="QT4 user interface library for Avahi." | ||
67 | DEPEND="== net-dns/avahi-${PVER} | ||
68 | ${QT4_DEPEND}" | ||
69 | } | ||
70 | |||
71 | pkg_setup() | ||
72 | { | ||
73 | preinstall_avahi | ||
74 | } | ||
75 | |||
76 | src_prepare() | ||
77 | { | ||
78 | munpack ${SRCFILE} || die | ||
79 | all-abis 'sed -i "s:-DG[^ ]*_DISABLE_DEPRECATED=1::g" avahi-ui/Makefile.* || die' | ||
80 | } | ||
81 | |||
82 | src_compile() | ||
83 | { | ||
84 | local myconf="--localstatedir=/var | ||
85 | --with-systemdsystemunitdir=$(mget-systemd-unit-dir) \ | ||
86 | --with-distro=none | ||
87 | --enable-compat-libdns_sd | ||
88 | --enable-compat-howl | ||
89 | --enable-autoipd | ||
90 | --with-autoipd-user=avahi | ||
91 | --with-autoipd-group=avahi | ||
92 | --disable-python-dbus | ||
93 | --disable-pygtk | ||
94 | --disable-monodoc | ||
95 | --disable-doxygen-doc | ||
96 | --disable-xmltoman | ||
97 | --disable-gdbm | ||
98 | --disable-mono | ||
99 | --disable-python | ||
100 | --disable-qt3 | ||
101 | --enable-dbus | ||
102 | --enable-glib | ||
103 | --enable-gtk | ||
104 | --enable-gtk3" | ||
105 | |||
106 | # qt4 is not multilib on 64bit systems! | ||
107 | # exclude them from multilib, but build everything else multilib | ||
108 | if [[ ${ARCH} = x86_64 ]] | ||
109 | then | ||
110 | only-m32 mconfigure ${myconf} --disable-qt4 || die | ||
111 | only-m64 mconfigure ${myconf} --enable-qt4 || die | ||
112 | else | ||
113 | mconfigure ${myconf} --enable-qt4 || die | ||
114 | fi | ||
115 | |||
116 | mmake || die | ||
117 | } | ||
118 | |||
119 | src_install_avahi() | ||
120 | { | ||
121 | mmake DESTDIR=${BINDIR} install || die | ||
122 | |||
123 | # for howl and mdnsresponder compat | ||
124 | mlink avahi-compat-howl.pc /usr/$(mlibdir)/pkgconfig/howl.pc || die | ||
125 | mlink avahi-compat-libdns_sd.pc /usr/$(mlibdir)/pkgconfig/libdns_sd.pc || die | ||
126 | mlink avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h || die | ||
127 | |||
128 | # remove examples | ||
129 | mdelete /etc/avahi/services/ssh.service || die | ||
130 | mdelete /etc/avahi/services/sftp-ssh.service || die | ||
131 | # always keep this directory | ||
132 | mkeepdir /etc/avahi/services || die | ||
133 | |||
134 | minstalldocs ChangeLog LICENSE README | ||
135 | |||
136 | # remove stuff from other packages | ||
137 | # gtk2+3 | ||
138 | mdelete /usr/bin/bssh || die | ||
139 | mdelete /usr/bin/bshell || die | ||
140 | mdelete /usr/bin/bvnc || die | ||
141 | mdelete -r /usr/share/applications || die | ||
142 | mdelete -r /usr/share/avahi/interfaces || die | ||
143 | mdelete -r /usr/include/avahi-ui || die | ||
144 | mdelete /usr/$(mlibdir)/libavahi-ui\*.\* || die | ||
145 | mdelete /usr/$(mlibdir)/pkgconfig/avahi-ui-gtk3.pc | ||
146 | mdelete /usr/$(mlibdir)/pkgconfig/avahi-ui.pc | ||
147 | if [[ $(mlibdir) != lib ]] | ||
148 | then | ||
149 | mdelete /usr/lib/libavahi-ui\*.\* || die | ||
150 | mdelete /usr/lib/pkgconfig/avahi-ui-gtk3.pc | ||
151 | mdelete /usr/lib/pkgconfig/avahi-ui.pc | ||
152 | fi | ||
153 | # qt4 | ||
154 | mdelete /usr/$(mlibdir)/libavahi-qt4\*.\* || die | ||
155 | mdelete /usr/$(mlibdir)/pkgconfig/avahi-qt4\*.\* || die | ||
156 | mdelete -r /usr/include/avahi-qt4 || die | ||
157 | } | ||
158 | |||
159 | src_install_avahi-gtk() | ||
160 | { | ||
161 | # first install needed libs to fix link issues | ||
162 | mmake -j1 -C avahi-common DESTDIR=${BINDIR} install || die | ||
163 | mmake -j1 -C avahi-glib DESTDIR=${BINDIR} install || die | ||
164 | mmake -j1 -C avahi-client DESTDIR=${BINDIR} install || die | ||
165 | |||
166 | # install gtk-ui | ||
167 | mmake -j1 -C avahi-ui DESTDIR=${BINDIR} install || die | ||
168 | |||
169 | # then remove temp libs | ||
170 | mmake -j1 -C avahi-client DESTDIR=${BINDIR} uninstall || die | ||
171 | mmake -j1 -C avahi-glib DESTDIR=${BINDIR} uninstall || die | ||
172 | mmake -j1 -C avahi-common DESTDIR=${BINDIR} uninstall || die | ||
173 | mdelete -r /usr/include/avahi-common || die | ||
174 | mdelete -r /usr/include/avahi-client || die | ||
175 | mdelete -r /usr/include/avahi-glib || die | ||
176 | |||
177 | # only keep gtk2 libs | ||
178 | zapmost ${BINDIR} \ | ||
179 | usr/$(mlibdir)/libavahi-ui.* \ | ||
180 | $([[ $(mlibdir) != lib ]] && echo 'usr/lib/libavahi-ui.*') \ | ||
181 | || die | ||
182 | |||
183 | # missing pkgconfig file | ||
184 | all-abis 'minstalldir /usr/$(mlibdir)/pkgconfig' || die | ||
185 | all-abis 'minstallfile avahi-ui.pc /usr/$(mlibdir)/pkgconfig' || die | ||
186 | } | ||
187 | |||
188 | src_install_avahi-gtk3() | ||
189 | { | ||
190 | # first install needed libs to fix link issues | ||
191 | mmake -j1 -C avahi-common DESTDIR=${BINDIR} install || die | ||
192 | mmake -j1 -C avahi-glib DESTDIR=${BINDIR} install || die | ||
193 | mmake -j1 -C avahi-client DESTDIR=${BINDIR} install || die | ||
194 | |||
195 | # install gtk-ui | ||
196 | mmake -j1 -C avahi-ui DESTDIR=${BINDIR} install || die | ||
197 | |||
198 | # then remove temp libs | ||
199 | mmake -j1 -C avahi-client DESTDIR=${BINDIR} uninstall || die | ||
200 | mmake -j1 -C avahi-glib DESTDIR=${BINDIR} uninstall || die | ||
201 | mmake -j1 -C avahi-common DESTDIR=${BINDIR} uninstall || die | ||
202 | mdelete -r /usr/include/avahi-common || die | ||
203 | mdelete -r /usr/include/avahi-client || die | ||
204 | mdelete -r /usr/include/avahi-glib || die | ||
205 | |||
206 | # only keep gtk3 libs, remove gtk2 libs | ||
207 | mdelete /usr/$(mlibdir)/libavahi-ui.\* || die | ||
208 | if [[ $(mlibdir) != lib ]] | ||
209 | then | ||
210 | mdelete /usr/lib/libavahi-ui.\* || die | ||
211 | fi | ||
212 | |||
213 | # missing pkgconfig file | ||
214 | all-abis 'minstalldir /usr/$(mlibdir)/pkgconfig' || die | ||
215 | all-abis 'minstallfile avahi-ui-gtk3.pc /usr/$(mlibdir)/pkgconfig' || die | ||
216 | } | ||
217 | |||
218 | src_install_avahi-qt4() | ||
219 | { | ||
220 | # first install needed libs to fix link issues | ||
221 | mmake -C avahi-common DESTDIR=${BINDIR} install || die | ||
222 | |||
223 | # install qt-ui | ||
224 | mmake -C avahi-qt DESTDIR=${BINDIR} install || die | ||
225 | |||
226 | # then remove temp libs | ||
227 | mmake -C avahi-common DESTDIR=${BINDIR} uninstall || die | ||
228 | mdelete -r /usr/include/avahi-common || die | ||
229 | |||
230 | # missing pkgconfig file | ||
231 | if [[ ${ARCH} = x86_64 ]] | ||
232 | then | ||
233 | only-m64 'minstalldir /usr/$(mlibdir)/pkgconfig' || die | ||
234 | only-m64 'minstallfile avahi-qt4.pc /usr/$(mlibdir)/pkgconfig' || die | ||
235 | else | ||
236 | all-abis 'minstalldir /usr/$(mlibdir)/pkgconfig' || die | ||
237 | all-abis 'minstallfile avahi-qt4.pc /usr/$(mlibdir)/pkgconfig' || die | ||
238 | fi | ||
239 | |||
240 | zapmost ${BINDIR} \ | ||
241 | usr/$(mlibdir)/libavahi-qt4*.* \ | ||
242 | usr/$(mlibdir)/pkgconfig/avahi-qt4*.* \ | ||
243 | usr/include/avahi-qt4 \ | ||
244 | || die | ||
245 | } | ||
246 | |||
247 | preinstall_avahi() | ||
248 | { | ||
249 | if [[ ! -z $(magequery -n mdnsresponder) ]] | ||
250 | then | ||
251 | echo -e ${COLRED} | ||
252 | echo -e "Error: net-misc/mdnsresponder is installed!!" | ||
253 | echo -e "mdnsresponder is now superseeded by avahi and deprecated in this distribution." | ||
254 | echo -e "Please uninstall net-misc/mdnsresponder first!" | ||
255 | echo -e ${COLDEFAULT} | ||
256 | die "net-misc/mdnsresponder found!" | ||
257 | fi | ||
258 | |||
259 | # adding avahi user | ||
260 | mgroupadd -o "-g 303" netdev | ||
261 | mgroupadd -o "-g 304" avahi | ||
262 | museradd -o "-u 304 -g avahi -d /dev/null -s /bin/false" avahi | ||
263 | } | ||
264 | |||
265 | postinstall_avahi() | ||
266 | { | ||
267 | mstartunit avahi-daemon.service | ||
268 | } | ||
269 | |||
270 | postremove_avahi() | ||
271 | { | ||
272 | mstopunit avahi-daemon.service | ||
273 | } |