# Fedora Documentation Specfile
%define docbase
%{!?fdpdir:%define localbuild 1}
%{!?fdpdir:%define fdpdir %{_datadir}/fedora/doc}
Summary: Fedora Documentation: %{docbase}
Name: fedora-doc-%{docbase}
Version:
Release:
License:
Url: http://fedora.redhat.com/projects/docs
Source0: %{docbase}-%{version}.src.tar.gz
Source1: %{name}-gnome.desktop
Source2: %{name}-kde.desktop
Source3: %{name}-khelp.desktop
Source: %{name}-C.omf
Group: Documentation
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: scrollkeeper >= 0.3.11
Requires: fedora-doc-common
BuildRequires: xmlto
BuildRequires: kdelibs
# Used if builder does not specify common files locally
%{?localbuild:%{expand:BuildRequires: fedora-doc-common}}
%description
%package
Summary: Fedora Documentation -
Group: Documentation
%description
%prep
%setup -q -n %{docbase}-%{version}
%build
export FDPDIR=%{fdpdir}
# Remove hard-coded FDPDIR locations from CVS docs
for i in $RPM_BUILD_DIR/%{docbase}-%{version}/{*.xml,*/*.xml,Makefile}
do
%{__sed} -i 's;\(\.\./\)\{1,\}docs-common;%{fdpdir}/docs-common;g' "$i"
done
eval `make showvars | grep '\(PRI_LANG\|OTHERS\|DOC_ENTITIES\)'`
# Create entities (.ent files)
mkdir po/CVS # This is to make the Makefile.common happy
for i in $PRI_LANG $OTHERS ; do
make set-locale-$i
for j in $DOC_ENTITIES ; do
make ${i}/${j}.ent
done
done
LANG=.UTF-8 xmllint --xinclude /%{docbase}.xml > /%{docbase}.xml-parsed || :
# After XInclude, may need to scour FDPDIR misdirections again
%{__sed} 's;\(\.\./\)\{1,\}docs-common;%{fdpdir}/docs-common;g' /%{docbase}.xml-parsed > /%{docbase}.xml
LANG=.UTF-8 xmlto -o %{docbase}- \
-x %{fdpdir}/docs-common/xsl/main-html.xsl html \
/%{docbase}.xml
make khelp
%install
for DIR in $RPM_BUILD_ROOT%{_datadir}/applications/kde \
$RPM_BUILD_ROOT%{_datadir}/apps/khelpcenter/plugins/Fedora \
$RPM_BUILD_ROOT%{_datadir}/omf/fedora-doc-%{docbase} \
$RPM_BUILD_ROOT%{_docdir}/HTML/en/fedora-doc-%{docbase} \
$RPM_BUILD_ROOT%{_datadir}/fedora/doc/fedora-doc-%{docbase}/C \
; do
install -d -m 755 "$DIR"
done
export GLOBIGNORE=rpm-info.xml
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
%{SOURCE1}
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/applications/kde
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/apps/khelpcenter/plugins/Fedora
install -m 644 /*.{xml,ent} $RPM_BUILD_ROOT%{_datadir}/fedora/doc/fedora-doc-%{docbase}/C
install -m 644 %{SOURCE} $RPM_BUILD_ROOT%{_datadir}/omf/fedora-doc-%{docbase}
install -m 644 /*.{xml,ent} $RPM_BUILD_ROOT%{_datadir}/fedora/doc/fedora-doc-%{docbase}/
pushd %{docbase}-
find . -type d | xargs -i \
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/HTML/en/fedora-doc-%{docbase}/{}
find -L . -type f | xargs -i \
install -D -m 644 {} $RPM_BUILD_ROOT%{_docdir}/HTML/en/fedora-doc-%{docbase}/{}
popd
%clean
/bin/rm -rf $RPM_BUILD_ROOT
%post
/usr/bin/scrollkeeper-update || true
%postun
/usr/bin/scrollkeeper-update || true
%files
%defattr(-, root, root, -)
%{_datadir}/fedora/doc/fedora-doc-%{docbase}/
%{_datadir}/applications/*.desktop
%{_datadir}/applications/kde/*.desktop
%{_datadir}/apps/khelpcenter/
%{_datadir}/omf/fedora-doc-%{docbase}/
%{_docdir}/HTML/en/fedora-doc-%{docbase}/
%files
%defattr(-, root, root, -)
%dir %{_datadir}/fedora/doc/fedora-doc-%{docbase}/
%{_datadir}/fedora/doc/fedora-doc-%{docbase}//*
%{_datadir}/omf/fedora-doc-%{docbase}/fedora-doc-%{docbase}-.omf
%{_docdir}/HTML/en/fedora-doc-%{docbase}/*
%changelog
* Fedora Docs Project <fedora-docs-list@redhat.com> - -
-