SUNWprint-monitor.spec
author dcarbery
Mon, 10 Sep 2007 06:44:29 +0000
branchgnome-2-18
changeset 18961 3fd33e55b06c
parent 18919 eb9867f50120
child 10173 b75cf692b129
permissions -rw-r--r--
2007-09-10 Damien Carbery <[email protected]> ==== JDS Nevada build 74 ====

#
# spec file for package SUNWprint-monitor
#
# includes module(s): ospm
#
# Copyright (c) 2007 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Owner: halton
#
%include Solaris.inc

%use ospm = ospm.spec

Name:                    SUNWprint-monitor
Summary:                 Print Monitor
Version:                 %{default_pkg_version}
SUNW_BaseDir:            %{_basedir}
BuildRoot:               %{_tmppath}/%{name}-%{version}-build
Source:                  %{name}-exec_attr
#Source3:		 %{name}-manpages-0.1.tar.gz

%include default-depend.inc
Requires: SUNWgnome-libs
Requires: SUNWgnome-base-libs
Requires: SUNWxwrtl
Requires: SUNWgnome-component
Requires: SUNWgnome-config
Requires: SUNWxwrtl
Requires: SUNWzlib
Requires: SUNWpostrun
Requires: SUNWgnome-panel
BuildRequires: SUNWgnome-component-devel
BuildRequires: SUNWgnome-config-devel
BuildRequires: SUNWgnome-libs-devel
BuildRequires: SUNWgnome-base-libs-devel
BuildRequires: SUNWgnome-panel-devel

%if %build_l10n
%package l10n
Summary:                 %{summary} - l10n files
SUNW_BaseDir:            %{_basedir}
%include default-depend.inc
Requires:                %{name}
%endif

%package root
Summary:                 %{summary} - / filesystem
SUNW_BaseDir:            /
%include default-depend.inc
Requires: SUNWpostrun-root
Requires: SUNWgnome-config

%prep
rm -rf %name-%version
mkdir %name-%version
%ospm.prep -d %name-%version

%build
export PKG_CONFIG_PATH=%{_pkg_config_path}
export MSGFMT="/usr/bin/msgfmt"
export ACLOCAL_FLAGS="-I %{_datadir}/aclocal"
export PERL5LIB=%{_prefix}/perl5/site_perl/5.6.1/sun4-solaris-64int
export CFLAGS="%optflags -I%{_includedir}"
export RPM_OPT_FLAGS="$CFLAGS"
export LDFLAGS="%_ldflags"

%ospm.build -d %name-%version

%install
rm -rf $RPM_BUILD_ROOT
%ospm.install -d %name-%version
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/security
install --mode=0644 %SOURCE $RPM_BUILD_ROOT%{_sysconfdir}/security/exec_attr

#delete some unused or not shipped binaries.
rm -rf $RPM_BUILD_ROOT%{_bindir}/ospm-pm
rm -rf $RPM_BUILD_ROOT%{_bindir}/test-queues

# install man page
#rm -rf $RPM_BUILD_ROOT%{_mandir}
#cd %{_builddir}/%name-%version/sun-manpages
#make install DESTDIR=$RPM_BUILD_ROOT

%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
%endif

%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):unsupported" $RPM_BUILD_ROOT}

%clean
rm -rf $RPM_BUILD_ROOT

%post
( echo 'test -x /usr/bin/update-desktop-database || exit 0';
  echo '/usr/bin/update-desktop-database'
) | $BASEDIR/lib/postrun -b -u -c JDS_wait

%postun
test -x $BASEDIR/lib/postrun || exit 0
( echo 'test -x /usr/bin/update-desktop-database || exit 0';
  echo '/usr/bin/update-desktop-database'
) | $BASEDIR/lib/postrun -b -u -c JDS

%post root
( echo 'test -x /usr/bin/gconftool-2 || {';
  echo '  echo "ERROR: gconftool-2 not found"';
  echo '  exit 0';
  echo '}';
  echo 'umask 0022';
  echo 'GCONF_CONFIG_SOURCE=xml:merged:/etc/gconf/gconf.xml.defaults';
  echo 'export GCONF_CONFIG_SOURCE';
  echo '/usr/bin/gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/*.schemas'
) | $BASEDIR/var/lib/postrun/postrun -u -c JDS_wait

%preun root
test -x $BASEDIR/var/lib/postrun/postrun || exit 0
( echo 'test -x $PKG_INSTALL_ROOT/usr/bin/gconftool-2 || {';
  echo '  echo "WARNING: gconftool-2 not found; not uninstalling gconf schemas"';
  echo '  exit 0';
  echo '}';
  echo 'umask 0022';
  echo 'GCONF_CONFIG_SOURCE=xml:merged:$BASEDIR/etc/gconf/gconf.xml.defaults';
  echo 'GCONF_BACKEND_DIR=$PKG_INSTALL_ROOT/usr/lib/GConf/2';
  echo 'LD_LIBRARY_PATH=$PKG_INSTALL_ROOT/usr/lib';
  echo 'export GCONF_CONFIG_SOURCE GCONF_BACKEND_DIR LD_LIBRARY_PATH';
  echo 'SDIR=$BASEDIR%{_sysconfdir}/gconf/schemas';
  echo 'schemas="$SDIR/ospm.schemas"';
  echo '$PKG_INSTALL_ROOT/usr/bin/gconftool-2 --makefile-uninstall-rule $schemas'
) | $BASEDIR/var/lib/postrun/postrun -i -c JDS -a

%files
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*
%dir %attr (0755, root, bin) %{_libdir}
%dir %attr (0755, root, bin) %{_libdir}/ospm
%{_libdir}/ospm/lib*.so*
%{_libdir}/ospm/ospm-applet
%{_libdir}/ospm/lp-queue-exists-by-serial.sh
%attr (0755, root, bin) %{_libdir}/ospm/lp-queue-helper
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/gnome
%dir %attr (0755, root, bin) %{_datadir}/gnome/autostart
%{_datadir}/gnome/autostart/ospm-applet.desktop
%dir %attr (0755, root, other) %{_datadir}/applications
%{_datadir}/applications/ospm-preferences.desktop
%{_datadir}/ospm

%if %build_l10n
%files l10n
%defattr (-, root, bin)
%dir %attr (0755, root, sys) %{_datadir}
%attr (-, root, other) %{_datadir}/locale
%endif

%files root
%defattr (-, root, sys)
%attr (0755, root, sys) %dir %{_sysconfdir}
%{_sysconfdir}/gconf/schemas/ospm.schemas
%config %class(rbac) %attr (0644, root, sys) %{_sysconfdir}/security/exec_attr

%changelog
* Mon May 21 2007 - [email protected]
- Renamed the spec file to SUNWprint-monitor.spec to match one pager.

* Thu May 17 2007 - [email protected]
- Added lp-queue-helper to exec_attr through the use of rbac class script
  Remove the need to make it setuid.

* Sat May 05 2007 - [email protected]
- Remove not shipped binaries ospm-pm and test-queues

* Fri Apr 27 2007 - [email protected]
- Initial spec file