1 # 2 # spec file for package SUNWavahi-bridge-dsd 3 # 4 # includes module(s): avahi 5 # 6 # Copyright (c) 2006 Sun Microsystems, Inc. 7 # This file and all modifications and additions to the pristine 8 # package are under the same license as the package itself. 9 # 10 # Owner: padraig 11 # 12 13 %include Solaris.inc 14 15 %use avahi = avahi.spec 16 17 Name: SUNWavahi-bridge-dsd 18 Summary: Avahi client and bridge to SUNWdsd. 19 Version: %{avahi.version} 20 SUNW_BaseDir: %{_basedir} 21 BuildRoot: %{_tmppath}/%{name}-%{version}-build 22 SUNW_copyright: %{name}.copyright 23 Source1: avahi-bridge-dsd.xml 24 Source2: svc-avahi-bridge-dsd 25 26 %include default-depend.inc 27 BuildRequires: SUNWgnome-base-libs-devel 28 BuildRequires: SUNWgnome-python-libs-devel 29 BuildRequires: SUNWdbus-bindings-devel 30 BuildRequires: SUNWpython-setuptools 31 Requires: SUNWgnome-base-libs 32 Requires: SUNWgnome-python-libs 33 Requires: SUNWdbus-bindings 34 Requires: SUNWavahi-bridge-dsd-root 35 Requires: SUNWlibdaemon 36 Requires: SUNWlexpt 37 Requires: SUNWdsdr 38 39 %package root 40 Summary: %{summary} - / filesystem 41 SUNW_BaseDir: / 42 %include default-depend.inc 43 44 %package devel 45 Summary: %{summary} - development files 46 SUNW_BaseDir: %{_prefix} 47 %include default-depend.inc 48 49 %if %build_l10n 50 %package l10n 51 Summary: %{summary} - l10n files 52 SUNW_BaseDir: %{_basedir} 53 %include default-depend.inc 54 Requires: %{name} 55 %endif 56 57 %prep 58 rm -rf %name-%version 59 mkdir %name-%version 60 %avahi.prep -d %name-%version 61 62 %build 63 PKG_CONFIG_DISABLE_UNISTALLED= 64 unset PKG_CONFIG_DISABLE_UNISTALLED 65 export PKG_CONFIG_PATH=../avahi-%{avahi.version}:%{_pkg_config_path} 66 export CFLAGS="%optflags -I/usr/sfw/include" 67 export RPM_OPT_FLAGS="$CFLAGS" 68 export LDFLAGS="%_ldflags -ldns_sd -lsocket -lnsl -L/usr/sfw/lib -R/usr/sfw/lib -lexpat" 69 70 %avahi.build -d %name-%version 71 72 %install 73 %avahi.install -d %name-%version 74 mkdir -p $RPM_BUILD_ROOT/var/svc/manifest/system 75 chmod -R 755 $RPM_BUILD_ROOT/var/svc 76 cp %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/system/ 77 mkdir -p $RPM_BUILD_ROOT/lib/svc/method 78 chmod -R 755 $RPM_BUILD_ROOT/lib 79 cp %SOURCE2 $RPM_BUILD_ROOT/lib/svc/method/ 80 81 mv $RPM_BUILD_ROOT%{_sbindir}/avahi-daemon $RPM_BUILD_ROOT%{_sbindir}/avahi-daemon-bridge-dsd 82 %if %option_with_indiana_branding 83 rm -rf $RPM_BUILD_ROOT%{_datadir}/applications 84 %endif 85 86 %if %build_l10n 87 %else 88 # REMOVE l10n FILES 89 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale 90 %endif 91 92 %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT} 93 94 %clean 95 rm -rf $RPM_BUILD_ROOT 96 97 %if %(test -f /usr/sadm/install/scripts/i.manifest && echo 0 || echo 1) 98 %iclass manifest -f i.manifest 99 %endif 100 101 %pre root 102 #!/bin/sh 103 # 104 # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 105 # Use is subject to license terms. 106 # 107 108 # Presence of this temp file will tell postinstall script 109 # that the avahi-bridge-dsd service is already installed, in which case 110 # the current service state will be preserved, be it enabled 111 # or disabled. 112 rm -f $PKG_INSTALL_ROOT/var/avahi-bridge-dsd_installed.tmp > /dev/null 2>&1 113 114 if [ -f $PKG_INSTALL_ROOT/var/svc/manifest/system/avahi-bridge-dsd.xml ]; then 115 touch $PKG_INSTALL_ROOT/var/avahi-bridge-dsd_installed.tmp 116 fi 117 118 exit 0 119 120 %post root 121 #!/bin/sh 122 # 123 # Copyright 2008 Sun Microsystems, Inc. All rights reserved. 124 # Use is subject to license terms. 125 # 126 127 # Preinstall script will create this file if avahi-bridge-dsd service was 128 # already installed, in which case we preserve current service state, 129 # be it enabled or disabled. 130 if [ -f $PKG_INSTALL_ROOT/var/avahi-bridge-dsd_installed.tmp ]; then 131 rm -f $PKG_INSTALL_ROOT/var/avahi-bridge-dsd_installed.tmp 132 else 133 # enable avahi-bridge-dsd: 134 # - PKG_INSTALL_ROOT is / or empty when installing onto a live system 135 # and we can invoke svcadm directly; 136 # - otherwise it's upgrade, so we append to the upgrade script 137 if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then 138 if [ `/sbin/zonename` = global ]; then 139 /usr/sbin/svcadm enable -r svc:/system/avahi-bridge-dsd:default 140 fi 141 else 142 cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF 143 if [ \`/sbin/zonename\` = global ]; then 144 /usr/sbin/svcadm enable -r svc:/system/avahi-bridge-dsd:default 145 fi 146 EOF 147 fi 148 fi 149 150 exit 0 151 %files 152 %doc -d avahi-%{avahi.version} README LICENSE 153 %dir %attr (0755, root, other) %{_datadir}/doc 154 %defattr (-, root, bin) 155 %dir %attr (0755, root, bin) %{_bindir} 156 %{_bindir}/* 157 %dir %attr (0755, root, bin) %{_sbindir} 158 %{_sbindir}/avahi-daemon-bridge-dsd 159 %dir %attr (0755, root, bin) %{_libdir} 160 %{_libdir}/libavahi*.so* 161 %{_libdir}/avahi/service-types.db.pag 162 %{_libdir}/avahi/service-types.db.dir 163 %dir %attr (0755, root, sys) %{_datadir} 164 %{_datadir}/avahi/service-types 165 %if %option_with_sun_branding 166 %dir %attr (0755, root, other) %{_datadir}/applications 167 %{_datadir}/applications/avahi-discover.desktop 168 %{_datadir}/applications/bssh.desktop 169 %{_datadir}/applications/bvnc.desktop 170 %endif 171 %{_datadir}/avahi/interfaces/avahi-discover.glade 172 %{_datadir}/avahi/introspection/Server.introspect 173 %{_datadir}/avahi/introspection/EntryGroup.introspect 174 %{_datadir}/avahi/introspection/DomainBrowser.introspect 175 %{_datadir}/avahi/introspection/ServiceBrowser.introspect 176 %{_datadir}/avahi/introspection/ServiceTypeBrowser.introspect 177 %{_datadir}/avahi/introspection/ServiceResolver.introspect 178 %{_datadir}/avahi/introspection/AddressResolver.introspect 179 %{_datadir}/avahi/introspection/HostNameResolver.introspect 180 %{_datadir}/avahi/introspection/RecordBrowser.introspect 181 %{_datadir}/avahi/avahi-service.dtd 182 %dir %attr (0755, root, bin) %{_mandir} 183 %{_mandir}/man1/* 184 %attr (-, root, bin) %{_libdir}/python* 185 186 %files root 187 %defattr (-, root, bin) 188 %dir %attr (0755, root, sys) %{_sysconfdir} 189 %config %{_sysconfdir}/* 190 %dir %attr (0755, root, sys) /var 191 %dir %attr (0755, root, sys) /var/svc 192 %dir %attr (0755, root, sys) /var/svc/manifest 193 %dir %attr (0755, root, sys) /var/svc/manifest/system 194 %class(manifest) %attr (0444, root, sys) /var/svc/manifest/system/avahi-bridge-dsd.xml 195 %attr (0555, root, bin) /lib/svc/method/svc-avahi-bridge-dsd 196 197 198 %files devel 199 %defattr (-, root, bin) 200 %dir %attr (0755, root, bin) %{_libdir} 201 %dir %attr (0755, root, other) %{_libdir}/pkgconfig 202 %{_libdir}/pkgconfig/* 203 %dir %attr (0755, root, bin) %{_includedir} 204 %{_includedir}/* 205 206 %if %build_l10n 207 %files l10n 208 %defattr (-, root, bin) 209 %dir %attr (0755, root, sys) %{_datadir} 210 %attr (-, root, other) %{_datadir}/locale 211 %endif 212 213 %changelog 214 * Wed Sep 10 2008- padraig.obriain@sun.com 215 - Add %doc in %files for copyright 216 217 * Wed Aug 06 2008- padraig.obriain@sun.com 218 - add pre and post scripts for enabling the avahi-bridge-dsd svc upon 219 installation but leaving it as is upon upgrade (based on dbus spec file) 220 221 * Fri Jun 06 2008 - damien.carbery@sun.com 222 - Add l10n package. 223 224 * Wed Oct 31 2007 - damien.carbery@sun.com 225 - Add Build/Requires SUNWdbus-bindings/-devel as the dbus python module is used. 226 227 * Wed Oct 31 2007 - damien.carbery@sun.com 228 - Remove references to /usr/lib/mdns from LDFLAGS as the dir doesn't exist. 229 230 * Fri Sep 07 2007 - damien.carbery (at] sun.com 231 - Add Build/Requires SUNWgnome-base-libs/-devel for glib. 232 - Add Build/Requires SUNWgnome-python-libs/-devel for gtk Python module. 233 234 * Wed Jun 28 2007 - padraig.obriain (at] sun.com 235 - Initial spec file created. 236