Blame SPECS/docbook-simple.spec

8be206
Name: docbook-simple
8be206
Version: 1.1
8be206
Release: 12%{?dist}
8be206
Group: Applications/Text
8be206
Summary: Simplified DocBook is a small subset of the DocBook XML DTD
8be206
License: Freely redistributable without restriction
8be206
URL: http://www.oasis-open.org/docbook/xml/simple/
8be206
Source0: http://www.docbook.org/xml/simple/1.1/%{name}-%{version}.zip
8be206
Source1: %{name}.README.redhat
8be206
Source2: %{name}.xml
8be206
Source3: %{name}.cat
8be206
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
8be206
BuildArch: noarch
8be206
BuildRequires: unzip
8be206
Requires: sgml-common
8be206
Requires(post): sed
8be206
Requires(post): libxml2 >= 2.4.8
8be206
Requires(postun): libxml2 >= 2.4.8
8be206
Requires: docbook-dtds
8be206
8be206
%description
8be206
Simplified DocBook is an attempt to provide a proper subset of DocBook
8be206
that is simultaneously smaller and still useful. Documents written in
8be206
the subset must be 100% legal DocBook documents. This is a subset for
8be206
single documents (articles, white papers, etc.), so there's no need
8be206
for books or sets, just 'articles'. Simplified DocBook documents are 
8be206
viewable in online browsers if styled with CSS. (it's XML not SGML).
8be206
8be206
8be206
%prep
8be206
# splatter the files into a version-numbered directory
8be206
%setup -q -c -n %{version}
8be206
8be206
# see http://rpm-devel.colug.net/max-rpm/s1-rpm-inside-macros.html
8be206
# setup -c creates the dir then changes to it to expand SOURCE0
8be206
8be206
%build
8be206
8be206
%install
8be206
8be206
rm -rf $RPM_BUILD_ROOT
8be206
8be206
########## install versioned-numbered directory of dtd files ############
8be206
8be206
DESTDIR=$RPM_BUILD_ROOT%{_datadir}/xml/docbook/simple
8be206
mkdir -p $DESTDIR
8be206
cp -a ../%{version} $DESTDIR
8be206
8be206
########## install package catalogs  ################
8be206
8be206
XML_CAT_DIR=$RPM_BUILD_ROOT%{_sysconfdir}/xml
8be206
mkdir -p $XML_CAT_DIR
8be206
install -p -m 644 %{SOURCE2} $XML_CAT_DIR
8be206
8be206
SGML_CAT_DIR=$RPM_BUILD_ROOT%{_sysconfdir}/sgml
8be206
mkdir -p $SGML_CAT_DIR
8be206
install -p -m 644 %{SOURCE3} $SGML_CAT_DIR
8be206
8be206
####### FIXME: must copy README.redhat to source directory ########
8be206
#######        for %doc to find it, ${SOURCE1} doesn't work ########
8be206
8be206
cp -p %{SOURCE1} ./README
8be206
8be206
%clean
8be206
rm -rf $RPM_BUILD_ROOT
8be206
rm -rf ../%{version}
8be206
8be206
%files
8be206
%defattr (-,root,root,-)
8be206
%doc sdocbook.css
8be206
%doc README
8be206
%dir %{_datadir}/xml/docbook/simple/
8be206
%{_datadir}/xml/docbook/simple/%{version}
8be206
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sgml/docbook-simple.cat
8be206
%config(noreplace) %{_sysconfdir}/xml/docbook-simple.xml
8be206
8be206
8be206
%post
8be206
8be206
##################  XML catalog registration #######################
8be206
8be206
## Define handy variables ##
8be206
8be206
ROOT_XML_CATALOG=%{_sysconfdir}/xml/catalog
8be206
PKG_XML_CATALOG=%{_sysconfdir}/xml/docbook-simple.xml
8be206
8be206
#### Root XML Catalog Entries ####
8be206
#### Delegate appropriate lookups to package catalog ####
8be206
8be206
if [ -w $ROOT_XML_CATALOG ]
8be206
then
8be206
        %{_bindir}/xmlcatalog --noout --add "delegatePublic" \
8be206
                "-//OASIS//DTD Simplified" \
8be206
                "file://$PKG_XML_CATALOG" $ROOT_XML_CATALOG
8be206
8be206
        %{_bindir}/xmlcatalog --noout --add "delegateURI" \
8be206
                "http://www.oasis-open.org/docbook/xml/simple/1.1/" \
8be206
                "file://$PKG_XML_CATALOG" $ROOT_XML_CATALOG
8be206
8be206
  # Next line because some resolvers misinterpret uri entries
8be206
        %{_bindir}/xmlcatalog --noout --add "delegateSystem" \
8be206
                "http://www.oasis-open.org/docbook/xml/simple/1.1/" \
8be206
                "file://$PKG_XML_CATALOG" $ROOT_XML_CATALOG
8be206
fi
8be206
8be206
####################################################################
8be206
8be206
8be206
#################  SGML catalog registration  ######################
8be206
8be206
ROOT_SGML_CATALOG=%{_sysconfdir}/sgml/catalog
8be206
PKG_SGML_CATALOG=%{_sysconfdir}/sgml/docbook-simple.cat
8be206
8be206
#### Root SGML Catalog Entries ####
8be206
#### "Delegate" appropriate lookups to package catalog ####
8be206
8be206
8be206
############## use install-catalog ######################
8be206
8be206
if [ -w $ROOT_SGML_CATALOG ]
8be206
then
8be206
# xmlcatalog deletes OVERRIDE YES directive, use install-catalog instead
8be206
#         /usr/bin/xmlcatalog --sgml --noout --add \
8be206
#     "/etc/sgml/docbook-simple.cat"
8be206
8be206
  install-catalog --add \
8be206
  "$PKG_SGML_CATALOG" \
8be206
  "$ROOT_SGML_CATALOG" 1>/dev/null
8be206
8be206
# Hack to workaround bug in install-catalog
8be206
  sed -i '/^CATALOG.*log\"$/d' $PKG_SGML_CATALOG
8be206
  sed -i '/^CATALOG.*log$/d' $PKG_SGML_CATALOG   
8be206
fi
8be206
8be206
####################################################################
8be206
8be206
8be206
# Finally, make sure everything in /etc/*ml is readable!
8be206
/bin/chmod a+r  %{_sysconfdir}/sgml/*
8be206
/bin/chmod a+r  %{_sysconfdir}/xml/*
8be206
8be206
%postun
8be206
##
8be206
## SGML and XML catalogs
8be206
##
8be206
## Jobs: remove package catalog entries from both root catalogs &
8be206
##       remove package catalogs
8be206
8be206
# remove catalog entries only on removal of package
8be206
if [ "$1" = 0 ]; then
8be206
  %{_bindir}/xmlcatalog --sgml --noout --del \
8be206
     %{_sysconfdir}/sgml/catalog \
8be206
     %{_sysconfdir}/sgml/docbook-simple.cat
8be206
8be206
  %{_bindir}/xmlcatalog --noout --del \
8be206
    "file://%{_sysconfdir}/xml/docbook-simple.xml" \
8be206
     %{_sysconfdir}/xml/catalog 
8be206
fi
8be206
8be206
%changelog
8be206
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1-12
8be206
- Mass rebuild 2013-12-27
8be206
8be206
* Tue Nov 27 2012 Ondrej Vasik <ovasik@redhat.com> 1.1-11
8be206
- avoid using Fedora in the README file (portability)
8be206
8be206
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-10
8be206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
8be206
8be206
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-9
8be206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
8be206
8be206
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-8
8be206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
8be206
8be206
* Tue May 18 2010 Ondrej Vasik <ovasik@redhat.com> - 1.1-7
8be206
- post scriptlet requires sed (#593083)
8be206
8be206
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-6
8be206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
8be206
8be206
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-5
8be206
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
8be206
8be206
* Fri Jul 18 2008 Ondrej Vasik <ovasik@redhat.com> - 1.1-4
8be206
- fix loop in post catalog registration(incomplete sed
8be206
  coverage) #455680
8be206
- fix broken catalogs for package updates
8be206
- fix removal of files during updates
8be206
8be206
* Mon Nov 05 2007 Ondrej Vasik <ovasik@redhat.com> - 1.1-3
8be206
- merge review(#225701)
8be206
- spec modified to follow guidelines
8be206
8be206
* Wed Oct 24 2007 Ondrej Vasik <ovasik@redhat.com> - 1.1-2
8be206
- rpmlint check
8be206
- /etc/ files marked as config, fixed bad requirements
8be206
- cosmetic cleanup of spec file
8be206
8be206
* Thu May 24 2007 Ondrej Vasik <ovasik@redhat.com> - 1.1-1.02
8be206
- fixed added error in docbook-simple.xml(wrong catalog version)
8be206
8be206
* Thu May 24 2007 Ondrej Vasik <ovasik@redhat.com> - 1.1-1
8be206
- rebuilt with latest stable upstream release(1.1)
8be206
8be206
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.0-2.1.1
8be206
- rebuild
8be206
8be206
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
8be206
- rebuilt
8be206
8be206
* Tue Sep 07 2004 Mark Johnson <mjohnson@redhat.com> 1.0-1
8be206
- Initial release
8be206