610c9e
%global codate 20161227
610c9e
610c9e
Name:           gl-manpages
610c9e
Version:        1.1
610c9e
Release:        15.%{codate}%{?dist}
610c9e
Summary:        OpenGL manpages
610c9e
610c9e
License:        MIT and Open Publication
610c9e
URL:            http://www.opengl.org/wiki/Getting_started/XML_Toolchain_and_Man_Pages
610c9e
# see Source1
610c9e
Source0:        gl-manpages-%{version}-%{codate}.tar.xz
610c9e
Source1:        make-gl-man-snapshot.sh
610c9e
# FIXME: Bundle mathml and the Oasis dbmathl until they are packaged
610c9e
Source2:        http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd
610c9e
Source3:        http://www.w3.org/Math/DTD/mathml2.tgz
610c9e
# FIXME  These are the old gl-manpages source which 
610c9e
# still have some manpages that khronos doesn't. 
610c9e
# Ship until somebody in the know helps figuring whats what.
610c9e
# When matching install the kronos version.
610c9e
Source4:        gl-manpages-1.0.1.tar.bz2
610c9e
#Silence author/version/manual etc. warnings
610c9e
Source5:        metainfo.xsl
610c9e
610c9e
BuildArch:      noarch
610c9e
610c9e
BuildRequires:  libxslt docbook-style-xsl docbook5-style-xsl
610c9e
610c9e
%description
610c9e
OpenGL manpages
610c9e
610c9e
%prep
610c9e
%setup -q -n %{name}-%{version}-%{codate}
610c9e
tar xzf %{SOURCE3}
610c9e
cp -av %{SOURCE2} mathml2/
610c9e
tar xjf %{SOURCE4}
610c9e
610c9e
610c9e
%build
610c9e
# FIXME Figure out what to do about the GLSL builtin functions
610c9e
export BD=`pwd`
610c9e
xmlcatalog --create --noout \
610c9e
	--add public "-//W3C//DTD MathML 2.0//EN" "file://$BD/mathml2/mathml2.dtd" \
610c9e
	--add system "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd" "file://$BD/mathml2/mathml2.dtd" \
610c9e
	--add public "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" "file://$BD/mathml2/dbmathml.dtd" \
610c9e
	--add system "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd" "file://$BD/mathml2/dbmathml.dtd" \
610c9e
	mathml2.cat
610c9e
export XML_CATALOG_FILES="$BD/mathml2.cat /etc/xml/catalog"
610c9e
for MAN in man3 man2 ; do
610c9e
	pushd $MAN
610c9e
	for MANP in gl*.xml ; do
610c9e
		xsltproc --nonet %{SOURCE5} $MANP | xsltproc --nonet /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl -
610c9e
	done
610c9e
	popd
610c9e
done
610c9e
pushd man4
610c9e
for MANP in gl*.xml ; do
610c9e
	xsltproc --xinclude --nonet %{SOURCE5} $MANP | xsltproc --xinclude --nonet /usr/share/sgml/docbook/xsl-ns-stylesheets/manpages/docbook.xsl -
610c9e
done
610c9e
popd
610c9e
610c9e
610c9e
%install
610c9e
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3/
610c9e
cp -n {man4,man3,man2}/*.3G $RPM_BUILD_ROOT%{_mandir}/man3/
610c9e
# install the old manpages source with 3gl -> 3G
610c9e
# when matchin don't clobber the khronos version
610c9e
for MANP in `find gl-manpages-1.0.1 -name *.3gl` ; do
610c9e
	FN=${MANP//*\//}
610c9e
	cp -a -n $MANP $RPM_BUILD_ROOT%{_mandir}/man3/${FN/.3gl/.3G}
610c9e
done
610c9e
find $RPM_BUILD_ROOT%{_mandir}/man3/ -type f -size -100b | xargs sed -i -e 's/\.3gl/\.3G/' -e 's,^\.so man3G/,.so man3/,'
610c9e
610c9e
610c9e
%files
610c9e
%{_mandir}/man3/*
610c9e
610c9e
610c9e
%changelog
610c9e
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-15.20161227
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
610c9e
610c9e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-14.20161227
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
610c9e
610c9e
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-13.20161227
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
610c9e
610c9e
* Wed Dec 28 2016 Yanko Kaneti <yaneti@declera.com> - 1.1-12.20161227
610c9e
- Use docbook5-style-xsl for building the GL4 manpages
610c9e
610c9e
* Tue Dec 27 2016 Yanko Kaneti <yaneti@declera.com> - 1.1-11.20161227
610c9e
- New upstream snapshot.
610c9e
610c9e
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-11.20140424
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
610c9e
610c9e
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-10.20140424
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
610c9e
610c9e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-9.20140424
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
610c9e
610c9e
* Thu Apr 24 2014 Yanko Kaneti <yaneti@declera.com> - 1.1-8.%{codate}
610c9e
- New upstream snapshot
610c9e
- GLSL folded into man4.
610c9e
- tarball tweaks
610c9e
610c9e
* Tue Nov  5 2013 Yanko Kaneti <yaneti@declera.com> - 1.1-7.%{codate}
610c9e
- New upstream snapshot.
610c9e
610c9e
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-7.20130122
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
610c9e
610c9e
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-6.20130122
610c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
610c9e
610c9e
* Tue Jan 22 2013 Yanko Kaneti <yaneti@declera.com> - 1.1-5.%{codate}
610c9e
- Newer upstream snapshot. Minor upstream rearrangement.
610c9e
- Remove checkout script from sources and add to git.
610c9e
- Try to actually use the bundled mathml2. Fix warnings.
610c9e
610c9e
* Wed Jan 16 2013 Yanko Kaneti <yaneti@declera.com> - 1.1-4.%{codate}
610c9e
- Fix symlinked man references some more (#895986) 
610c9e
610c9e
* Mon Oct 15 2012 Yanko Kaneti <yaneti@declera.com> - 1.1-3.%{codate}
610c9e
- Fix symlinked man variants. 
610c9e
- Preserve timestamps on the older gl-manpages.
610c9e
610c9e
* Tue Oct  9 2012 Yanko Kaneti <yaneti@declera.com> - 1.1-2.%{codate}
610c9e
- Re-add the older gl-manpages for those not present in khronos
610c9e
610c9e
* Tue Oct  9 2012 Yanko Kaneti <yaneti@declera.com> - 1.1-1.%{codate}
610c9e
- Try building from source
610c9e
610c9e
* Wed Sep  5 2012 Yanko Kaneti <yaneti@declera.com> - 1.0.1-1
610c9e
- Initial split from mesa