File scrollkeeper.spec of Package scrollkeeper
#
# spec file for package scrollkeeper (Version 0.3.14)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: scrollkeeper
BuildRequires: docbook_4 fdupes intltool libxslt-devel perl-XML-Parser sgml-skel
%define xmlcatalog %{_sysconfdir}/xml/catalog
%define my_localstatedir /var
Summary: Cataloging System for Documentation
Version: 0.3.14
Release: 227
Source0: scrollkeeper-%{version}.tar.bz2
Source1: logrotate.%{name}
# PATCH-FIX-OPENSUSE scrollkeeper-0.3.14-rebuilddb.diff bnc96609 ke@suse.de
Patch: scrollkeeper-0.3.14-rebuilddb.diff
# PATCH-FIX-UPSTREAM scrollkeeper-0.3.14-createdbdir.diff bnc230786 prusnak@suse.cz
Patch1: scrollkeeper-0.3.14-createdbdir.diff
Requires: docbook_4
Requires: libxml2 >= 2.4.19
Requires: libxslt
Requires: %{name}-lang = %{version}
License: LGPL v2.1 or later
Group: Development/Libraries/C and C++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://scrollkeeper.sourceforge.net/
PreReq: /bin/touch sgml-skel /usr/bin/xmlcatalog libxml2 docbook_4 libxslt
%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.
Authors:
--------
Dan Mueth <muet@alumni.uchicago.edu>
Eric Fischer <eric@eazel.com>
Gregory Leblanc <gleblanc@cu-portland.edu>
Laszlo Kovacs <laszlo.kovacs@sun.com>
%define INSTALL install -m755 -s
%define INSTALL_DIR install -d -m755
%define INSTALL_DATA install -m644
%define INSTALL_SCRIPT install -m755
%lang_package
%prep
%setup -q
#%setup -q -a 1
%patch -p1 -b .rebuilddb
%patch1
%build
rename no nb po/no.*
sed "s/\(ALL_LINGUAS.*\) no /\1 nb /" configure.in > configure.in.tmp && \
mv configure.in.tmp configure.in
%{?suse_update_config:%{suse_update_config}}
libtoolize --copy --force
intltoolize --copy --force
aclocal
autoconf
%if %suse_version < 910
for f in /etc/xml/for-catalog-*; do
cp /etc/xml/catalog /etc/xml/catalog.susebuild
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
--add $f
done
%endif
CFLAGS=$RPM_OPT_FLAGS \
./configure \
--localstatedir=%{my_localstatedir} \
--sysconfdir=%{_sysconfdir} \
--libdir=%{_libdir} \
--prefix=%{_prefix} \
--mandir=%{_mandir} \
--with-omfdirs=/usr/share/omf:/usr/local/share/omf
make
xmlcatbin=/usr/bin/xmlcatalog
CATALOG=scrollkeeper.xml
$xmlcatbin --noout --create $CATALOG
$xmlcatbin --noout --add "public" \
"-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" \
"file://%{_datadir}/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" $CATALOG
# $xmlcatbin --noout --add "system" \
# "http://..."
# "file://%{_datadir}/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" $CATALOG
%define FOR_ROOT_CAT for-catalog-%{name}-%{version}-%{release}.xml
CATALOG=etc/xml/$CATALOG
rm -f %{FOR_ROOT_CAT}.tmp
$xmlcatbin --noout --create %{FOR_ROOT_CAT}.tmp
# $xmlcatbin --noout --add "delegateSystem" \
# "http://www.oasis-open.org/docbook/xml/simple/" \
# "file:///$CATALOG" %{FOR_ROOT_CAT}.tmp
$xmlcatbin --noout --add "delegatePublic" \
"-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" \
"file:///$CATALOG" %{FOR_ROOT_CAT}.tmp
# Create tag
sed '/<catalog/a\
<group id="%{name}-%{version}-%{release}">
/<\/catalog/i\
</group>' \
%{FOR_ROOT_CAT}.tmp > %{FOR_ROOT_CAT}
%install
if [ ! $RPM_BUILD_ROOT = "/" ]; then rm -rf $RPM_BUILD_ROOT; fi
make DESTDIR=$RPM_BUILD_ROOT install
# scrollkeepr does not export headers or a .pc,
# so it can't be used outside of scrollkeeper
rm $RPM_BUILD_ROOT%{_prefix}/%_lib/libscrollkeeper.*a
rm $RPM_BUILD_ROOT%{_prefix}/%_lib/libscrollkeeper.so
# Unwanted doc stuff
rm -fr $RPM_BUILD_ROOT/var/log/scrollkeeper.log \
$RPM_BUILD_ROOT%{_datadir}/doc \
$RPM_BUILD_ROOT%{_localstatedir}/lib
#
%find_lang %{name}
install -d $RPM_BUILD_ROOT/etc/logrotate.d
install -m 644 %{S:1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
/sbin/ldconfig -n $RPM_BUILD_ROOT%_libdir
### cat <<'EOF' >SuSEconfig.%{name}
### #! /bin/sh
### # Copyright (c) 2002, 2004, 2005 SuSE Linux AG Nuremberg, Germany.
### # All rights reserved.
### #
### # Authors: Karl Eichwalder <ke@suse.de>, 2002, 2005
### # Holger Hetterich <hhetter@suse.de>, 2002
### # check if we are started as root
### # only one of UID and USER must be set correctly
### export LC_ALL=
### export LANGUAGE=
### if test "$UID" != 0 -a "$USER" != root; then
### echo "You must be root to start $0."
### exit 1
### fi
### #
### # SuSEconfig sometimes sets the variable CHECK_NEWPACKAGE. If it is set
### # to false, we don't have to do anything.
### #
### test "$CHECK_NEWPACKAGE" = false && exit 0
### #
### test -n "$ROOT" && exit 0
### xmlcatbin=/usr/bin/xmlcatalog
### : ${localstated_r:=/var}
### [ -x $r/$xmlcatbin ] || exit 0
### [ -f /etc/xml/catalog ] || exit 0
### if $xmlcatbin /etc/xml/catalog "-//OASIS//DTD DocBook XML V4.1.2//EN" \
### | grep "No entry" >/dev/null; then
### exit 0
### fi
### if [ -f /var/adm/SuSEconfig/run-scrollkeeper-update ]; then
### scrollkeeper-update \
### && rm -f /var/adm/SuSEconfig/run-scrollkeeper-update
### fi
### # scrollkeeper-rebuilddb -q -p $localstated_r/lib/scrollkeeper || true
### rm -f /var/adm/SuSEconfig/run-%{name}-update
### exit 0
### EOF
### #
### %{INSTALL_DIR} %{buildroot}/sbin/conf.d
### %{INSTALL_SCRIPT} SuSEconfig.%{name} \
### %{buildroot}/sbin/conf.d/SuSEconfig.%{name}
### # %{INSTALL_DIR} %{buildroot}/var/adm/SuSEconfig
### # touch %{buildroot}/var/adm/SuSEconfig/run-%{name}
cat_dir=%{buildroot}/etc/xml
%{INSTALL_DIR} $cat_dir
# %{INSTALL_DATA} %{name}.xml $RPM_BUILD_ROOT/etc/xml/%{name}.xml
%{INSTALL_DATA} %{FOR_ROOT_CAT} %{name}.xml $cat_dir
%fdupes $RPM_BUILD_ROOT
%clean
%if %suse_version < 910
[ -f /etc/xml/catalog.susebuild ] \
&& mv /etc/xml/catalog.susebuild /etc/xml/catalog
%endif
rm -rf $RPM_BUILD_ROOT
# %pre
# # rm -rf %{_datadir}/scrollkeeper/Templates || true
%post
/sbin/ldconfig
# touching run-%{name}-update is probably superfluous; check after 9.0
# touch var/adm/SuSEconfig/run-%{name}-update
localstated_r=$(echo %{my_localstatedir}|sed 's:^/::')
# rm -rf /var/lib/scrollkeeper
# mkdir -p var/lib/scrollkeeper
# scrollkeeper-update -p var/lib/scrollkeeper
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
--add /etc/xml/%{FOR_ROOT_CAT}
### On SL, yelp does not make use of the SK system
### if [ $1 = 2 ]; then
### # Upgrading
### echo "$(date +"%b %d %X") Upgrading to ScrollKeeper $(scrollkeeper-config --version)..." \
### >> $localstated_r/log/scrollkeeper.log
### fi
### if [ $1 = 1 ]; then
### # Installing
### echo "$(date +"%b %d %X") Installing ScrollKeeper $(scrollkeeper-config --version)..." \
### >> $localstated_r/log/scrollkeeper.log
### scrollkeeper-rebuilddb -q -p %{_localstatedir}/lib/scrollkeeper || true
### exit 0
### fi
# # Only run the update script after package installation via SuSEconfig
# # or if the user installs it directly with rpm.
# # echo "$YAST_IS_RUNNING"
# [ -z "$YAST_IS_RUNNING" ] || exit 0
# if [ -x sbin/conf.d/SuSEconfig.%{name} ]; then
# sbin/conf.d/SuSEconfig.%{name}
# fi
%postun
localstated_r=$(echo %{my_localstatedir}|sed 's:^/::')
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
--del %{name}-%{version}-%{release}
### if [ $1 = 0 ]; then
### # SK is being removed, not upgraded.
### # Remove all generated files
### rm -rf $localstated_r/lib/scrollkeeper
### rm -f $localstated_r/log/scrollkeeper.log
### rm -f $localstated_r/log/scrollkeeper.log.1
### [ -x $r/$xmlcatbin ] || {
### echo "$r/$xmlcatbin is missing"
### echo "Cleanup $xmlcatal_g manually"
### exit 0
### }
### fi
#rm -rf %{_datadir}/scrollkeeper/templates
/sbin/ldconfig
exit 0
%files
%defattr(-,root,root)
%doc COPYING AUTHORS README NEWS INSTALL
%config(noreplace) /etc/logrotate.d/%{name}
%config %{_sysconfdir}/%{name}.conf
%config %{_sysconfdir}/xml
### /sbin/conf.d/SuSEconfig.%{name}
%{_datadir}/omf
%{_bindir}/*
%{_libdir}/lib*
%{_mandir}/*/*
%{_datadir}/xml/scrollkeeper
%{_datadir}/scrollkeeper
# %{_datadir}/locale/*/*
%files lang -f %{name}.lang
%changelog
* Fri Jul 18 2008 jpr@novell.com
- Tag patches
* Tue Aug 07 2007 maw@suse.de
- Use %%fdupes
- Use /sbin/ldconfig in %%post and add it to %%postun
- Split off a -lang subpackage.
* Mon Jan 29 2007 sbrabec@suse.cz
- Removed references to /opt/gnome.
* Wed Jan 10 2007 prusnak@suse.cz
- removed "-g" flag from CFLAGS in spec file (added accidentaly by last update)
* Wed Jan 10 2007 prusnak@suse.cz
- fix segfault on database directory creation (createdbdir.diff) [#230786]
* Thu Aug 17 2006 ke@suse.de
- Remove SuSEconfig calls and do not build the SK database; yelp on
openSUSE does not make use of the SK database.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Nov 02 2005 dmueller@suse.de
- don't build as root
* Mon Oct 03 2005 jpr@suse.de
- don't package the .a, .la or .so files
* Wed Aug 24 2005 ke@suse.de
- Reset LC_ALL and LANGUAGE before running scrollkeeper-update. See bug
[#] 112642.
* Fri Jul 15 2005 ke@suse.de
- Patch scrollkeeper-rebuilddb.in to prevent %%post from segfaulting in
the build system; debugged by Stanislav Brabec [# 96609].
* Wed Nov 10 2004 ro@suse.de
- fixed file list
* Sun Nov 07 2004 ro@suse.de
- fix last change
* Mon Oct 18 2004 ro@suse.de
- locale rename: no -> nb
* Fri Feb 13 2004 ke@suse.de
- Stop touching /var/adm/SuSEconfig/run-scrollkeeper-update; run
scrollkeeper-rebuilddb at installation time immediately.
* Wed Dec 10 2003 ke@suse.de
- Update to version 0.3.14; many a lot bug fixes.
* By default, don't retrieve DTDs from the net.
* Fix various memory leaks.
* Update translations.
* Fri Sep 19 2003 ke@suse.de
- Logrotate /var/log/scrollkeeper.log; reported by Stanislav Brabec [#
31413].
* Tue Sep 16 2003 ke@suse.de
- Do not call scrollkeeper-rebuilddb unnecessarily in
SuSEconfig.scrollkeeper and use the trigger file more consistently;
cf. [# 30792].
- In SuSEconfig.scrollkeeper respect SuSEconfig's --nonewpackage
option; reported by Ulrich Windl [# 30861].
* Tue Sep 09 2003 ke@suse.de
- Add $YAST_IS_RUNNING check to %%post; do not call scrollkeeper-update
during package installation with YaST; reported by Ulrich Windl
[# 30235].
* Fri Aug 15 2003 ke@suse.de
- Call %%run_ldconfig in %%post
- Fix SuSEconfig.scrollkeeper to install the database in /var/lib
instead of /lib; reported by Ludwig Nussel [# 28690].
* Mon Jul 14 2003 sbrabec@suse.cz
- GNOME prefix change to /opt/gnome.
* Mon Jun 16 2003 ke@suse.de
- Add missing directories: %%{_datadir}/omf and %%{_datadir}/xml .
* Tue May 27 2003 ke@suse.de
- Cleanup $RPM_BUILD_ROOT.
- Use edit-xml-catalog in %%post/%%postun for managing /etc/xml/catalog.
- Use /etc/xml/suse-catalog.xml instead of /etc/xml/catalog.
* Fri May 02 2003 ke@suse.de
- PreReq: sgml-skel; it is also neededforbuild.
* Mon Mar 03 2003 ke@suse.de
- Create var/adm/SuSEconfig/run-%%{name} in %%post and remove from %%files
list; reported by Sebastian Vollath [# 24564].
* Thu Jan 23 2003 ke@suse.de
- Update to version 0.3.12beta-0:
* Translation updates.
* Update GNOME categories.
* Mon Jan 20 2003 ke@suse.de
- Update to version 0.3.12beta-0:
* Translation updates.
* Fix temp file handling (cf. below Mon Aug 19 16:18:49 CEST 2002).
- Drop obsolete patches: scrollkeeper-0.3.10-tempfiles.patch,
scrollkeeper-0.3.10-auto.patch.
* Thu Sep 05 2002 ke@suse.de
- Fix variable assignment in SuSEconfig.scrollkeeper [# 18915].
* Fri Aug 23 2002 ke@suse.de
- Add more checks to SuSEconfig.scrollkeeper to prevent the update call
from connecting to the net.
Reported by Olaf Hering [# 17646].
* Mon Aug 19 2002 ke@suse.de
- Fix insecure temporary file handling that can lead to elevated
privileges; apply scrollkeeper-0.3.10-tempfiles.patch provide by Red
Hat.
Thanks for help to Roman Drahtmueller.
* Fri Aug 09 2002 ke@suse.de
- In %%postun check whether xmlcatalog is still installed; if not,
tell the user to fix the catalog manually.
* Thu Aug 01 2002 ke@suse.de
- Provide PreReq: libxml2 libxslt docbook_4.
* Thu Jul 25 2002 ke@suse.de
- Update to version 0.3.11:
* Update translations.
* Get GNOME categories from the Panel.
* Wed Jul 17 2002 ke@suse.de
- Drop obsolete %%pre script to make patchrpm work.
Reported by "build"; fix proposed by Micheal Schroeder.
* Wed Jul 03 2002 ke@suse.de
- Don't require intltool any longer.
* Mon Jun 24 2002 ke@suse.de
- Update to version 0.3.10 (adjust .auto patch).
* Mon Jun 17 2002 meissner@suse.de
- full auto* and intltool rerun, so it works on ppc64.
- removed # lines from Makefile.am targets.
* Wed May 15 2002 hhetter@suse.de
- fix omfdirs
- the SuSEconfig script now runs scrollkeeper-update
if packages set the run-scrollkeeper-update flag while
installation / uninstallation
* Mon May 06 2002 ke@suse.de
- Set %%_libdir to make it build on x86_64.
* Fri May 03 2002 ke@suse.de
- Update to version 0.3.8.
- Provide SuSEconfig scripts to update XML catalogs and to maintain the
scrollkeeper database.
- Spec file nearly re-written (add Requires, move configure call in
build section, update %%post/%%postun script.
* Fri Apr 27 2001 hhetter@suse.de
- added libscrollkeeper to filelist
* Tue Apr 24 2001 ke@suse.de
- Update to version 0.2.0; prepared by Daniel Egger (thanks).
* Tue Mar 06 2001 ke@suse.de
- New package: Version 0.1.4.