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