Home | History | Annotate | Download | only in trunk
      1 #
      2 # spec file for package SUNWdbus
      3 #
      4 # includes module(s): dbus
      5 #
      6 # Copyright 2007 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 yippi
     11 #
     12 
     13 %include Solaris.inc
     14 
     15 %ifarch amd64 sparcv9
     16 %include arch64.inc
     17 %define _libexecdir %{_basedir}/lib
     18 %use dbus_64 = dbus.spec
     19 %endif
     20 
     21 %include base.inc
     22 %use dbus = dbus.spec
     23 
     24 Name:                    SUNWdbus
     25 Summary:                 Simple IPC library based on messages
     26 Version:                 %{dbus.version}
     27 Source:                  %{name}-manpages-0.1.tar.gz
     28 SUNW_BaseDir:            %{_basedir}
     29 SUNW_Copyright:          %{name}.copyright
     30 BuildRoot:               %{_tmppath}/%{name}-%{version}-build
     31 Source1:        dbus.xml
     32 Source2:        svc-dbus
     33 Source3:        0070.dbus
     34 %include default-depend.inc
     35 Requires:	SUNWxwrtl
     36 Requires:	SUNWdbus-libs
     37 Requires:	SUNWdbus-root
     38 Requires:	SUNWlxml
     39 Requires:	SUNWlexpt
     40 Requires:	SUNWPython-extra
     41 BuildRequires:	SUNWlxml
     42 BuildRequires:	SUNWPython-extra
     43 
     44 %package devel
     45 Summary:                 %{summary} - development files
     46 SUNW_BaseDir:            %{_basedir}
     47 %include default-depend.inc
     48 
     49 %package libs
     50 Summary:                 %{summary} - client libraries
     51 SUNW_BaseDir:            %{_basedir}
     52 %include default-depend.inc
     53 BuildRequires:	SUNWdbus-devel
     54 
     55 %package root
     56 Summary:                 %{summary} - / filesystem
     57 SUNW_BaseDir:            /
     58 %include default-depend.inc
     59 
     60 %prep
     61 rm -rf %name-%version
     62 mkdir %name-%version
     63 
     64 %ifarch amd64 sparcv9
     65 mkdir %name-%version/%_arch64
     66 %dbus_64.prep -d %name-%version/%_arch64
     67 %endif
     68 
     69 mkdir %name-%version/%{base_arch}
     70 %dbus.prep -d %name-%version/%{base_arch}
     71 
     72 cd %{_builddir}/%name-%version
     73 gzcat %SOURCE0 | tar xf -
     74 
     75 %build
     76 # Put /usr/ccs/lib first in the PATH so that cpp is picked up from there
     77 # note: I didn't put /usr/lib in the PATH because there's too much other
     78 # stuff in there
     79 #
     80 export PATH=/usr/ccs/lib:$PATH
     81 %ifarch amd64 sparcv9
     82 %dbus_64.build -d %name-%version/%_arch64
     83 %endif
     84  
     85 %dbus.build -d %name-%version/%{base_arch}
     86 
     87 %install
     88 rm -rf $RPM_BUILD_ROOT
     89 
     90 %ifarch amd64 sparcv9
     91 %dbus_64.install -d %name-%version/%_arch64
     92 %endif
     93 
     94 %dbus.install -d %name-%version/%{base_arch}
     95 rm -rf $RPM_BUILD_ROOT%{_mandir}
     96 cd %{_builddir}/%name-%version/sun-manpages
     97 make install DESTDIR=$RPM_BUILD_ROOT
     98 
     99 %ifarch amd64 sparcv9
    100 cd $RPM_BUILD_ROOT%{_bindir}/%{_arch64}
    101 rm dbus-launch dbus-monitor dbus-cleanup-sockets dbus-send dbus-uuidgen
    102 cd ..
    103 rmdir %{_arch64}
    104 %endif
    105 
    106 # The /var/run directory should not be included with the packages.
    107 # D-Bus will create it at run-time.
    108 #
    109 rmdir $RPM_BUILD_ROOT/var/run/dbus
    110 rmdir $RPM_BUILD_ROOT/var/run
    111 
    112 # Add SMF integration files.
    113 #
    114 mkdir -p $RPM_BUILD_ROOT/var/svc/manifest/system
    115 chmod -R 755 $RPM_BUILD_ROOT/var/svc
    116 cp %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/system/
    117 mkdir -p $RPM_BUILD_ROOT/lib/svc/method
    118 chmod -R 755 $RPM_BUILD_ROOT/lib
    119 cp %SOURCE2 $RPM_BUILD_ROOT/lib/svc/method/
    120 
    121 # Add in dbus session launching for gdm
    122 #
    123 install --mode=0755 -d $RPM_BUILD_ROOT/%{_sysconfdir}
    124 install --mode=0755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/X11
    125 install --mode=0755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/X11/xinit
    126 install --mode=0755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/X11/xinit/xinitrc.d
    127 install --mode=0755 %SOURCE3 $RPM_BUILD_ROOT/%{_sysconfdir}/X11/xinit/xinitrc.d/0070.dbus
    128 
    129 mkdir -p $RPM_BUILD_ROOT/etc/security
    130 echo 'solaris.smf.manage.dbus:::Manage D-BUS Service States::help=SmfDBUSStates.html' > $RPM_BUILD_ROOT/etc/security/auth_attr
    131 echo 'D-BUS Management:::Manage D-BUS:auths=solaris.smf.manage.dbus;help=RtDBUSMngmnt.html' > $RPM_BUILD_ROOT/etc/security/prof_attr
    132 
    133 %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
    134 
    135 %clean
    136 rm -rf $RPM_BUILD_ROOT
    137 
    138 %if %(test -f /usr/sadm/install/scripts/i.manifest && echo 0 || echo 1)
    139 %iclass manifest -f i.manifest
    140 %endif
    141 
    142 %pre root
    143 #!/bin/sh
    144 #
    145 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    146 # Use is subject to license terms.
    147 #
    148 
    149 # Presence of this temp file will tell postinstall script
    150 # that the dbus service is already installed, in which case
    151 # the current service state will be preserved, be it enabled
    152 # or disabled.
    153 rm -f $PKG_INSTALL_ROOT/var/dbus_installed.tmp > /dev/null 2>&1
    154 
    155 if [ -f $PKG_INSTALL_ROOT/var/svc/manifest/system/dbus.xml ]; then 
    156 	touch $PKG_INSTALL_ROOT/var/dbus_installed.tmp
    157 fi
    158 
    159 exit 0
    160 
    161 %post root
    162 #!/bin/sh
    163 #
    164 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    165 # Use is subject to license terms.
    166 #
    167 
    168 # Preinstall script will create this file if dbus service was already
    169 # installed, in which case we preserve current service state,
    170 # be it enabled or disabled.
    171 if [ -f $PKG_INSTALL_ROOT/var/dbus_installed.tmp ]; then
    172 	rm -f $PKG_INSTALL_ROOT/var/dbus_installed.tmp
    173 else
    174 	# enable dbus:
    175 	# - PKG_INSTALL_ROOT is / or empty when installing onto a live system
    176 	#   and we can invoke svcadm directly;
    177 	# - otherwise it's upgrade, so we append to the upgrade script
    178 	if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
    179 		if [ `/sbin/zonename` = global ]; then
    180 			/usr/sbin/svcadm enable svc:/system/dbus:default
    181 		fi
    182 	else
    183 		cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
    184 		if [ \`/sbin/zonename\` = global ]; then
    185 			/usr/sbin/svcadm enable svc:/system/dbus:default
    186 		fi
    187 EOF
    188 	fi
    189 fi
    190 
    191 exit 0
    192 
    193 %files
    194 %defattr (-, root, bin)
    195 %dir %attr (0755, root, bin) %{_bindir}
    196 %{_bindir}/*
    197 %{_libexecdir}/dbus-1
    198 %{_libexecdir}/dbus-daemon
    199 %dir %attr (0755, root, sys) %{_datadir}
    200 %{_datadir}/dbus-1
    201 %doc -d %{base_arch}/dbus-%{dbus.version} AUTHORS README
    202 %doc(bzip2) -d %{base_arch}/dbus-%{dbus.version} ChangeLog ChangeLog.pre-1-0
    203 %doc(bzip2) -d %{base_arch}/dbus-%{dbus.version} ChangeLog.pre-1-2
    204 %doc(bzip2) -d %{base_arch}/dbus-%{dbus.version} COPYING NEWS
    205 %doc(bzip2) -d %{base_arch}/dbus-%{dbus.version} NEWS.pre-1-0 NEWS.pre-1-2
    206 %dir %attr (0755, root, other) %{_datadir}/doc
    207 %dir %attr(0755, root, bin) %{_mandir}
    208 %dir %attr(0755, root, bin) %{_mandir}/man1
    209 %dir %attr(0755, root, bin) %{_mandir}/man3
    210 %{_mandir}/man1/*
    211 %{_mandir}/man3/*
    212 
    213 %files libs
    214 %defattr (-, root, bin)
    215 %dir %attr (0755, root, bin) %{_libdir}
    216 %{_libdir}/libdbus*
    217 %ifarch amd64 sparcv9
    218 %dir %attr (0755, root, bin) %{_libdir}/%{_arch64}
    219 %{_libdir}/%{_arch64}/libdbus*
    220 %endif
    221 
    222 %files root
    223 %defattr (-, root, bin)
    224 %dir %attr (0755, root, sys) %{_sysconfdir}
    225 %config %{_sysconfdir}/dbus-1
    226 %dir %attr (0755, root, sys) %{_sysconfdir}/X11
    227 %dir %attr (0755, root, sys) %{_sysconfdir}/X11/xinit
    228 %dir %attr (0755, root, sys) %{_sysconfdir}/X11/xinit/xinitrc.d
    229 %{_sysconfdir}/X11/xinit/xinitrc.d/0070.dbus
    230 %dir %attr (0755, root, sys) %{_localstatedir}
    231 %dir %attr (0755, root, other) %{_localstatedir}/lib
    232 %attr (0755, root, root) %{_localstatedir}/lib/dbus
    233 %dir %attr (0755, root, sys) /var/svc
    234 %dir %attr (0755, root, sys) /var/svc/manifest
    235 %dir %attr (0755, root, sys) /var/svc/manifest/system
    236 %class(manifest) %attr (0444, root, sys) /var/svc/manifest/system/dbus.xml
    237 %attr (0555, root, bin) /lib/svc/method/svc-dbus
    238 %dir %attr (0755, root, sys) /etc/security
    239 %config %class (rbac) %attr (0644, root, sys) /etc/security/auth_attr
    240 %config %class (rbac) %attr (0644, root, sys) /etc/security/prof_attr
    241 
    242 %files devel
    243 %defattr (-, root, bin)
    244 %dir %attr (0755, root, bin) %{_libdir}
    245 %dir %attr (0755, root, other) %{_libdir}/pkgconfig
    246 %{_libdir}/pkgconfig/*
    247 %{_libdir}/dbus*/include
    248 %dir %attr (0755, root, bin) %{_includedir}
    249 %{_includedir}/*
    250 %ifarch amd64 sparcv9
    251 %dir %attr (0755, root, bin) %{_libdir}/%{_arch64}
    252 %dir %attr (0755, root, other) %{_libdir}/%{_arch64}/pkgconfig
    253 %dir %attr (0755, root, bin) %{_libdir}/%{_arch64}/dbus-1.0
    254 %{_libdir}/%{_arch64}/pkgconfig/*.pc
    255 %{_libdir}/%{_arch64}/dbus-1.0/*
    256 %endif
    257 
    258 %changelog
    259 * Mon Mar 02 2009 - dave.lin@sun.com
    260 - Add man/man3.
    261 * Thu Feb 05 2009 - brian.cameron@sun.com
    262 - Do not package /var/run files.  Fixes bug #6799059.
    263 * Wed Feb 04 2009 - takao.fujiwara@sun.com
    264 - Renamed 0005.dbus to 0070.dbus.
    265 * Thu Oct 02 2008 - ghee.teo@sun.com
    266 - Add /etc/X11/xinit/xinitrc.d/0005.dbus to fix 6755007 so that gdm can launch
    267   dbus session for the user. This can be used for both gdm on nevada and
    268   OpenSolaris.
    269 * Sun Sep 14 2008 - brian.cameron@sun.com
    270 - Add new copyright files.
    271 * Tue Sep 02 2008 - brian.cameron@sun.com
    272 - Place the library in a separate package, so that people who just
    273   want to write their own D-Bus services don't need to depend on the
    274   daemon.
    275 * Wed Aug 20 2008 - brian.cameron (at] sun.com
    276 - Move dbus-daemon.3 manpage to dbus-daemon.1 manpage.
    277 * Thu Mar 27 2008 - brian.cameron (at] sun.com
    278 - Add SUNW_Copyright.
    279 * Wed Mar 19 2008 - brian.cameron (at] sun.com
    280 - Remove the symlinks that point from /usr/lib/libdbus-1.so.2 to
    281   /usr/lib/libdbus-1.so.3.  Now that ON updated their build machines to use the
    282   new D-Bus library, the symlinks are no longer needed.
    283 * Fri Jan 11 2008 - damien.carbery (at] sun.com
    284 - Fix amd64/sparcv9 symlink to point to libdbus-1.so.3 (2nd half of Brian's
    285   change on Aug 6. Fixes 6624762.
    286 * Tue Nov 20 2007 - brian.cameron@sun.com
    287 - Add dbus manpages.
    288 * Mon Oct  8 2007 - damien.carbery@sun.com
    289 - Remove %{_libdir}/dbus-1 line from base package as it only contains a header
    290   file and is duplicated in the devel package. Fixes 6613798.
    291 * Mon Oct  1 2007 - laca@sun.com
    292 - change 64-bit libexecdir to /usr/lib
    293 * Mon Oct  1 2007 - damien.carbery@sun.com
    294 - Fix %files, adding %{_libdir}/%{_arch64}/dbus-1.
    295 * Sun Sep 30 2007 - laca@sun.com
    296 - fix %install
    297 * Fri Sep 28 2007 - laca@sun.com
    298 - convert to new style multi-ISA build
    299 - delete SUNWxwrtl dep
    300 * Mon Aug 06 2007 - brian.cameron@sun.com
    301 - Fix packaging after bumping to 1.1.2.  Also fix the symlink so we
    302   link to libdbus-1.so.3 rather than libdbus-1.so.3.# so we don't have
    303   to update the link each time we upgrade the D-Bus library.
    304 * Sun Feb 25 2007 - dougs@truemail.co.th
    305 - updated to include 64-bit build RFE: #6480511
    306 * Fri Dec 15 2006 - damien.carbery@sun.com
    307 - Create symlink to support hal which was built with an older version of dbus.
    308 * Mon Nov 27 2006 - brian.cameron@sun.com
    309 - Update to 1.0.1.
    310 * Fri Nov 24 2006 - damien.carbery@sun.com
    311 - Update %files - remove python dir, add %{_localstatedir}/lib/dbus.
    312 * Mon Sep 18 2006 - laca@sun.com
    313 - revert to normal optimisation flags, the build problems were caused by
    314   ld(1) bug 6467925
    315 - change /var/run/dbus permissions to root:root, fixes 6460949
    316 * Mon Aug 28 2006 - damien.carbery@sun.com
    317 - Use '-xO2' optimization (not -xO4) as the latter causes seg faults in build.
    318 * Fri Aug 25 2006 - padraig.obriain@sun.com
    319 - Use c99 compiler
    320 * Fri Jul 28 2006 - laca@sun.com
    321 - add pre and post scripts for enabling the dbus svc upon installation
    322   but leaving it as is upon upgrade (Artem Kachitchkine, David Bustos)
    323 * Fri Jul 21 2006 - laca@sun.com
    324 - Add dbus RBAC entries to auth_attr and prof_attr
    325 * Mon May 08 2006 - damien.carbery@sun.com
    326 - Add Build/Requires dependency on SUNWPython-extra (for Pyrex) so that python
    327   bindings are built.
    328 * Tue May 02 2006 - laca@sun.com
    329 - add SMF support (from Artem Kachitchkine)
    330 * Fri Feb 17 2006 - damien.carbery@sun.com
    331 - Update Build/Requires after running check-deps.pl script.
    332 * Tue Oct 25 2005 - damien.carbery@sun.com
    333 - Add the include dir under _libdir.
    334 * Fri Oct 21 2005 - damien.carbery@sun.com
    335 - Initial spec file created.
    336 
    337