scrollkeeper.spec
author dcarbery
Mon, 23 Oct 2006 12:46:17 +0000
branchgnome-2-14
changeset 19195 352a4716f1f3
parent 7610 b1299c5d8840
child 8564 df62c23d2955
permissions -rw-r--r--
2006-10-23 Damien Carbery <[email protected]> * docs/ssa/*: Remove these, as they're now up on the JDS project pages under 'Tasks/Single Sys Admin'.

#
# spec file for package scrollkeeper 
#
# Copyright (c) 2005 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
Name:         scrollkeeper 
License:      LGPL
Group:        Utilities/Text
Version:      0.3.14
Release:      44
Distribution: Java Desktop System
Vendor:	      Sun Microsystems, Inc.
Summary:      Cataloging System for Documentation 
Source:       http://ftp.gnome.org/pub/GNOME/sources/scrollkeeper/0.3/scrollkeeper-%{version}.tar.bz2
Source1:      scrollkeeper-update.1.gz
Source2:      scrollkeeper.1.gz
Source3:      scrollkeeper.conf.1.gz
Source4:      scrollkeeper-config.1.gz
Source5:      scrollkeeper-devel.1.gz
Source6:      scrollkeeper-extract.1.gz
Source7:      scrollkeeper-gen-seriesid.1.gz
Source8:      scrollkeeper-get-cl.1.gz
Source9:      scrollkeeper-get-content-list.1.gz
Source10:     scrollkeeper-get-extended-content-list.1.gz
Source11:     scrollkeeper-get-index-from-docpath.1.gz
Source12:     scrollkeeper-get-toc-from-docpath.1.gz
Source13:     scrollkeeper-get-toc-from-id.1.gz
Source14:     scrollkeeper-install.1.gz
Source15:     scrollkeeper-preinstall.1.gz
Source16:     scrollkeeper-rebuilddb.1.gz
Source17:     scrollkeeper-uninstall.1.gz
Patch1:	      scrollkeeper-01-merge-lang.diff
Patch2:	      scrollkeeper-02-help-sections.diff
Patch3:	      scrollkeeper-03-remove-man.diff
Patch4:       scrollkeeper-04-no-included-libintl.diff
Patch5:       scrollkeeper-05-rebuilddb-logdir.diff
Patch6:       scrollkeeper-06-write_omf_file.diff
URL:          http://www.gnome.org
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
Autoreqprov:  on
Prereq:       docbook_4

%define my_localstatedir /var
%define xmlcatalog      %{_sysconfdir}/xml/catalog
%define INSTALL_DIR install -d -m755
%define INSTALL_SCRIPT install -m75

%define intltool_version 0.30
%define docbook_4_version 4.2
%define libxml2_version 2.6.7
%define libxslt_version 1.1.2

Requires:     intltool >= %{intltool_version}
Requires:     docbook_4 >= %{docbook_4_version}
Requires:     libxml2 >= %{libxml2_version}
Requires:     libxslt >= %{libxslt_version}
BuildRequires: libxml2-devel >= %{libxml2_version}
BuildRequires: libxslt-devel >= %{libxslt_version}
BuildRequires: glib2-devel

%define my_localstatedir /var
%define xmlcatalog      %{_sysconfdir}/xml/catalog
%define INSTALL_DIR install -d -m755
%define INSTALL_SCRIPT install -m755

%description
ScrollKeeper is a cataloging system for documentation. It manages
documentation metadata (as specified by the Open Source Metadata
Framework (OMF)) and provides a simple API to allow help browsers to
find, sort, and search the document catalog.

It will also be able to communicate with catalog servers on the Net to
search for documents which are not on the local system.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1 -b .no-included-libintl
%patch5 -p1 -b .rebuilddb-logdir
%patch6 -p1


%build
%ifos linux
if [ -x /usr/bin/getconf ]; then
  CPUS=`getconf _NPROCESSORS_ONLN`
fi
%else
  CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
%endif
if test "x$CPUS" = "x" -o $CPUS = 0; then
  CPUS=1
fi

glib-gettextize -f
libtoolize --force
aclocal -I %{_datadir}/aclocal
automake -a -c -f
autoconf
CFLAGS="$RPM_OPT_FLAGS" \
  ./configure \
	--prefix=%{_prefix} \
	--sysconfdir=%{_sysconfdir} \
	--mandir=%{_mandir} \
	--localstatedir=%{my_localstatedir} \
	--with-omfdirs=%{_datadir}/omf
LANG=C LC_ALL=C make -j $CPUS

%install
LANG=C LC_ALL=C make DESTDIR=$RPM_BUILD_ROOT install
%ifos linux
%find_lang %{name}
%endif
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE1 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE2 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE3 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE4 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE5 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE6 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE7 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE8 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE9 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE10 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE11 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE12 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE13 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE14 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE15 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE16 $RPM_BUILD_ROOT%{_mandir}/man1
install --mode=0644 %SOURCE17 $RPM_BUILD_ROOT%{_mandir}/man1
#FIXME - should this be packaged or not ?
rm $RPM_BUILD_ROOT/var/log/scrollkeeper.log
rm -rf $RPM_BUILD_ROOT/%{my_localstatedir}

%post
if [ $1 = 2 ]; then
  # Upgrading
  echo "`date +"%b %d %X"` Upgrading to ScrollKeeper `scrollkeeper-config --version`..." >> %{my_localstatedir}/log/scrollkeeper.log
fi
if [ $1 = 1 ]; then
  # Installing
  echo "`date +"%b %d %X"` Installing ScrollKeeper `scrollkeeper-config --version`..." >> %{my_localstatedir}/log/scrollkeeper.log
fi
scrollkeeper-rebuilddb -p %{my_localstatedir}/lib/scrollkeeper >> %{my_localstatedir}/log/scrollkeeper.log 2>&1

hkdir="`scrollkeeper-config --pkglocalstatedir`"
[ -n "$hkdir" ] && rm -rf $hkdir/zh_HK && ln -s zh_TW  $hkdir/zh_HK

/sbin/ldconfig

#
# Add OMF DTD to XML catalog. In theory, we should be updating the SGML
# catalog as well and
#
CATALOG=/etc/xml/catalog
/usr/bin/xmlcatalog --noout --add "rewriteSystem" \
 "http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd" \
 "%{_datadir}/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteURI" \
 "http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd" \
 "%{_datadir}/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" $CATALOG

%postun
rm -rf /var/lib/scrollkeeper/zh_HK

if [ $1 = 0 ]; then
  # Scrollkeeper is being removed, not upgraded.
  #  ie. erase {my_localstatedir}/lib/scrollkeeper.
  rm -rf %{my_localstatedir}/lib/scrollkeeper
  rm -rf %{my_localstatedir}/log/scrollkeeper.log
  rm -rf %{my_localstatedir}/log/scrollkeeper.log.1

  CATALOG=/etc/xml/catalog
  /usr/bin/xmlcatalog --noout --del \
    "%{_datadir}/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" $CATALOG
fi
/sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING AUTHORS README NEWS INSTALL
%{_bindir}/*
%{_libdir}/*
%{_sysconfdir}/*
%{_mandir}/*
%{_datadir}/xml/scrollkeeper
%{_datadir}/scrollkeeper
%{_datadir}/doc/scrollkeeper-%{version}/*

%changelog
* Wed Jul 12 2006 - [email protected]
- remove binddomain.diff, fixes 4915772
* Tue Aug 16 2005 - [email protected]
- Add glib2-devel build dependency so that glib-gettextize is available.
* Wed Jun 08 2005 - [email protected]
- Remove /var to %files for packageing as rpmbuild was failing
* Sat Jul 10 2004 - [email protected]
- Remove omf/scrollkeeper dir from %files because the docs have been removed.
* Thu Jul 08 2004 - [email protected]
- Updated l10n content to scrollkeeper-l10n-po-1.2.tar.bz2
* Thu Jul 08 2004 - [email protected]
- ported to rpm4
* Wed Jul 07 2004 - [email protected]
- added "-j $CPUS" to make to speed up builds
* Wed May 12 2004 - [email protected]
- Updated l10n content to scrollkeeper-l10n-po-1.1.tar.bz2
* Mon Mar 29 2004 - [email protected]
- Updated l10n content to scrollkeeper-l10n-po-1.0.tar.bz2
* Sun Feb 15 2004 - [email protected]
- Add patch to disable building the included libintl on Solaris
- Add patch to create the log in $DESTDIR during make install
* Mon Feb 09 2004 - [email protected]
- Bump l10n tarball version, and update for Cinnabar
* Mon Dec 15 2003 - [email protected]
- Bump to 0.3.14 and merge patches.
* Tue Oct 07 2003 - [email protected]
- Update for Java Desktop System Tag
* Fri Sep 12 2003 - [email protected]
- Bug 4915914
* Tue Aug 26 2003 - [email protected]
- upgrade to new tarball (pulling in a number of fixes we need)
  and reorder the patches
* Thu Aug 21 2003 - [email protected]
- Changing the section searching behaviour to use categorycode 
  attribute instead of the l10n'd title/text(). This fixes bug
  4901844.
* Mon Aug 18 2003 - [email protected]
- Help sections patch
* Thu Jul 10 2003 - [email protected]
- Added .po tarball
- Removed temporary zh_HK cp hack.
* Wed Jun 26 2003 - [email protected]
- Add -p1 to the patches, remove %patch5 cause it's one too many (-;
* Wed Jun 26 2003 - [email protected]
- Add patches 01-05 from sun-patches
* Wed May 14 2003 - [email protected]
- Initial Sun release