Solaris/SUNWgnome-pdf-viewer.spec
author dcarbery
Fri, 24 Nov 2006 16:37:59 +0000
branch217update
changeset 19096 d542fc2c823e
parent 8565 b102e7809c6e
child 8653 0b6e2b6f62fb
permissions -rw-r--r--
Merged trunk changes r9797:9829 into 217update branch.

#
# spec file for package SUNWgnome-pdf-viewer
#
# includes module(s): poppler, evince
#
# Copyright (c) 2004 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Owner: mattman
#
%include Solaris.inc

%use poppler = poppler.spec
%use evince = evince.spec

Name:                    SUNWgnome-pdf-viewer
Summary:                 GNOME PDF document viewer
Version:                 %{default_pkg_version}
SUNW_BaseDir:            %{_basedir}
BuildRoot:               %{_tmppath}/%{name}-%{version}-build
Source1:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-arabic.tar.gz
Source2:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz
Source3:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-traditional.tar.gz
Source4:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-cyrillic.tar.gz
Source5:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-greek.tar.gz
Source6:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-hebrew.tar.gz
Source7:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-japanese.tar.gz
Source8:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-korean.tar.gz
Source9:                ftp://ftp.foolabs.com/pub/xpdf/xpdf-latin2.tar.gz
Source10:               ftp://ftp.foolabs.com/pub/xpdf/xpdf-thai.tar.gz
Source11:               ftp://ftp.foolabs.com/pub/xpdf/xpdf-turkish.tar.gz


%include default-depend.inc
BuildRequires: SUNWlibpopt-devel
BuildRequires: SUNWgnome-base-libs-devel
BuildRequires: SUNWgnome-libs-devel
BuildRequires: SUNWgnome-print-devel
BuildRequires: SUNWgnome-file-mgr-devel
BuildRequires: SUNWgnome-component-devel
BuildRequires: SUNWPython
BuildRequires: SUNWfontconfig
BuildRequires: SUNWTiff-devel
BuildRequires: SUNWdbus-devel
BuildRequires: SUNWgnome-config-devel
BuildRequires: SUNWgnome-vfs-devel
BuildRequires: SUNWjpg-devel
BuildRequires: SUNWlibpopt-devel
Requires: SUNWlibpopt
Requires: SUNWgnome-base-libs
Requires: SUNWgnome-libs
Requires: SUNWgnome-print
Requires: SUNWgnome-file-mgr
Requires: SUNWgnome-component
Requires: SUNWgnome-pdf-viewer-root
Requires: SUNWfontconfig
Requires: SUNWTiff
Requires: SUNWdbus
Requires: SUNWfreetype2
Requires: SUNWgnome-config
Requires: SUNWgnome-vfs
Requires: SUNWjpg
Requires: SUNWlibC
Requires: SUNWlibms
Requires: SUNWlibpopt
Requires: SUNWlxml
Requires: SUNWxwrtl
Requires: SUNWzlib
Requires: SUNWpostrun

%package devel
Summary:                 %{summary} - development files
SUNW_BaseDir:            %{_basedir}
%include default-depend.inc
Requires: SUNWperl584usr
Requires: SUNWgnome-base-libs-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
%poppler.prep -d %name-%version
%evince.prep -d %name-%version
gzcat %SOURCE1  |tar -xf -
gzcat %SOURCE2  |tar -xf -
gzcat %SOURCE3  |tar -xf -
gzcat %SOURCE4  |tar -xf -
gzcat %SOURCE5  |tar -xf -
gzcat %SOURCE6  |tar -xf -
gzcat %SOURCE7  |tar -xf -
gzcat %SOURCE8  |tar -xf -
gzcat %SOURCE9  |tar -xf -
gzcat %SOURCE10 |tar -xf -
gzcat %SOURCE11 |tar -xf -


%build
export PKG_CONFIG_PATH=%{_pkg_config_path}
export LDFLAGS="%_ldflags -L/usr/X11/lib -R /usr/X11/lib -L/usr/sfw/lib -R/usr/sfw/lib -lX11 -lm"
export MSGFMT="/usr/bin/msgfmt"
export CFLAGS="%optflags -I/usr/sfw/include"
%if %cc_is_gcc
%else
export CXX="${CXX} -norunpath"
%endif
export CXXFLAGS="%cxx_optflags"
export RPM_OPT_FLAGS="$CFLAGS"
export ACLOCAL_FLAGS="-I %{_datadir}/aclocal"
export PERL5LIB=%{_prefix}/perl5/site_perl/5.6.1/sun4-solaris-64int

%poppler.build -d %name-%version

export PKG_CONFIG_PATH=../poppler-%{poppler.version}:%{_pkg_config_path}
%evince.build -d %name-%version

%install
rm -rf $RPM_BUILD_ROOT
%poppler.install -d %name-%version
%evince.install -d %name-%version

mkdir -p $RPM_BUILD_ROOT%{_datadir}/xpdf
for file in xpdf-*/add-to-xpdfrc ; do
  sed -e "s|/usr/local/share/xpdf|%{_datadir}/xpdf|" $file >$file.new
  mv -f $file.new $file
  dir=`dirname $file`
  lang=`echo $dir|sed -e "s|xpdf-||"`
  cp -r $dir $RPM_BUILD_ROOT%{_datadir}/xpdf/$lang
  echo >>$RPM_BUILD_ROOT%{_sysconfdir}/xpdfrc
  cat $file >>$RPM_BUILD_ROOT%{_sysconfdir}/xpdfrc
done

# Remove unneeded scrollkeeper dirs
rm -rf $RPM_BUILD_ROOT%{_localstatedir}

cd $RPM_BUILD_ROOT%{_bindir}
ln -s evince gpdf

%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]*
rm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf
%endif

%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $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
( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
  echo '/usr/bin/scrollkeeper-update'
) | $BASEDIR/lib/postrun -b -u -c JDS

%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
( echo 'test -x /usr/bin/scrollkeeper-update || exit 0';
  echo '/usr/bin/scrollkeeper-update'
) | $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/evince.schemas';
  echo '         $SDIR/evince-thumbnailer.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}
%{_libdir}/nautilus
%{_libdir}/lib*.so*
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/applications
%{_datadir}/applications/*
%{_datadir}/evince
%dir %attr (0755, root, other) %{_datadir}/gnome
%{_datadir}/gnome/help/evince/C
%{_datadir}/omf/evince/*-C.omf
%attr (-, root, other) %{_datadir}/icons
%dir %attr (0755, root, other) %{_datadir}/xpdf
%{_datadir}/xpdf/*
%dir %attr(0755, root, bin) %{_mandir}
%dir %attr(0755, root, bin) %{_mandir}/*
%{_mandir}/*/*

%if %build_l10n
%files l10n
%defattr (-, root, bin)
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/gnome
%attr (-, root, other) %{_datadir}/locale
%{_datadir}/gnome/help/*/[a-z]*
%{_datadir}/omf/*/*-[a-z]*.omf
%endif

%files devel
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_libdir}
%dir %attr (0755, root, other) %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/*
%dir %attr (0755, root, bin) %{_includedir}
%{_includedir}/*
%dir %attr (0755, root, sys) %{_datadir}
%{_datadir}/gtk-doc/html

%files root
%defattr (0755, root, sys)
%attr (0755, root, sys) %dir %{_sysconfdir}
%{_sysconfdir}/gconf/schemas/evince.schemas
%{_sysconfdir}/gconf/schemas/evince-thumbnailer.schemas
%{_sysconfdir}/xpdfrc

%changelog
* Mon Nov 06 2006 - [email protected]
- Add XPDF Language Support Packages that are used by poppler to correctly
  view localised PDF files. Fixes Bug#2143558. (forward port from Stable)
- Also fix FIXME comments (same as stable)
* Fri Nov  3 2006 - [email protected]
- add -lm to LDFLAGS so that libpoppler links against it, fixes 6470804
* Fri Sep 08 2006 - [email protected]
- Remove "rm" of _mandir during %install, Deliver community pages, pdf*.1
* Sat Aug 12 2006 - [email protected]
- change datadir/icons permissions back to root:other since it's a stable
  interface and wasn't supposed to be changed
* Fri Jul 14 2006 - [email protected]
- update %post/%postun/etc scripts to support diskless client setup,
  part of 6448317
* Thu Jun 29 2006 - [email protected]
- update postrun scripts
* Sun Jun 11 2006 - [email protected]
- change group from other to bin/sys
* Fri Jun  2 2006 - [email protected]
- use post/preun scripts to install schemas into the merged gconf files
* Wed May 10 2006 - [email protected]
- merge -share pkg(s) into the base pkg(s)
* Wed Mar 15 2006 - [email protected]
- Add Build/Requires SUNWgnome-component/-devel for ORBit2.
* Tue Mar 14 2006 - [email protected]
- Remove unneeded scrollkeeper files before packaging.
* Mon Feb 20 2006 - [email protected]
- Complete update of Build/Requires after running check-deps.pl script.
* Fri Feb 17 2006 - [email protected]
- Update Build/Requires after running check-deps.pl script.
* Tue Jan 24 2006 - [email protected]
- Set perms for %{_datadir} in devel package.
* Sun Jan 22 2006 - [email protected]
- Add gtk-doc dir to devel package.
* Wed Dec  7 2005 - [email protected]
- add /usr/sfw/lib to LDFLAGS because without this running evince complains
  it cannot find libfreetype.so.6
* Sat Dec  3 2005 - [email protected]
- add %post script that runs update-desktop-database
* Thu Dec 01 2005 - [email protected]
- Add include dir to CFLAGS to find ft2build.h, a dir missing from freetype2.pc
* Tue Nov 29 2005 - [email protected]
- remove javahelp stuff
* Sat Oct 02 2004 - [email protected]
- added %pkgbuild_postprocess
* Fri Oct 01 2004 - [email protected]
- Added xpdfrc
* Mon Aug 23 2004 - [email protected]
- s/SUNWpl5u/SUNWperl584usr/
* Fri Aug 20 2004 - [email protected]
- Fix 5089628: mark two %gconf.xml files as volatile in root package.
* Mon Jul 26 2004 - [email protected]
- Return mime-info %files line to match Glynn's change to gpdf.spec.
* Fri Jul 23 2004 - [email protected]
- Remove mime-info %files line to match Glynn's change to gpdf.spec.
* Wed Jul 14 2004 - [email protected]
- add xpdf language support packs. #4921809
* Sat Jun 26 2004  [email protected]
- Changed install location to /usr/...
* Tue Jun 22 2004 - [email protected]
- add xpdf language support packs. #4921809
* Wed Jun  2 2004 - [email protected]
- Added %{_datadir}/locale to install l10n messages
* Mon Apr 05 2004 - [email protected]
- Added %_libdir to %files
* Wed Mar 24 2004 - [email protected]
- Added SGML man page integration
* Wed Mar 03 2004 - <[email protected]>
- fix %files share
- fix gconf files in root subpkg
* Mon Mar 01 2004 - <[email protected]>
- fix dependencies
* Mon Feb 23 2004 - <[email protected]>
- install gconf schemas at end of install stage.