/
PKGBUILD
83 lines (70 loc) · 3.04 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# $Id: PKGBUILD 151284 2012-02-25 12:42:20Z pierre $
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Description: Man pages and docs for OpenGL 3.3 and GLSL
pkgname=opengl-man-pages
_svndate=20130425
pkgver=0.${_svndate}
pkgrel=1
pkgdesc="OpenGL Man Pages"
arch=('any')
url="http://www.opengl.org/wiki/Getting_started/XML_Toolchain_and_Man_Pages"
license=('custom')
makedepends=('libxslt' 'docbook-xsl' 'w3c-mathml2' 'docbook-mathml')
options=('!makeflags')
source=("${pkgname}_${_svndate}.tar.xz"
'LICENSE')
md5sums=('92337f4267fedd87267b3dd1ab9e0494'
'cb856abe5968300057e650096ba25b2f')
# source PKGBUILD && mksource
mksource() {
[[ -d ${pkgname}-source ]] || mkdir -d ${pkgname}-source
pushd ${pkgname}-source
[[ -x /usr/bin/svn ]] || (echo "svn not found. Install subversion." && return 1)
svn co --username anonymous --password anonymous \
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/docs/man3/ man3
svn co --username anonymous --password anonymous \
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/docs/manglsl/ manglsl
find . -maxdepth 2 -type d -name .svn -exec rm -rf {} \;
tar -cvJf ../${pkgname}_${_svndate}.tar.xz man3/* manglsl/*
popd
}
build() {
export ROOT="${srcdir}/man3"
cd "${srcdir}/man3"
make
# OpenGL 3.3 xml manpages: convert xml to 3G
find . -maxdepth 1 -type f -name "*.xml" \
-exec xsltproc --noout --nonet \
/usr/share/xml/docbook/xsl-stylesheets-1.78.1/manpages/docbook.xsl {} \;
# OpenGL 3.3 3G manpages: fix docbook's manual and source variables
find . -maxdepth 1 -type f -name "*.3G" \
-exec sed -i 's/\[FIXME: manual\]/OpenGL 3.3 Reference/' {} \; \
-exec sed -i 's/\[FIXME: source\]/opengl-man-pages/' {} \;
cd ../manglsl
make
# GLSL xml manpages: fix xml mismatches, convert xml to 3G
find . -maxdepth 1 -type f -name "*.xml" \
-exec sed -i 's/#VARTABLECOLS#/<tgroup cols="1"> #VARTABLECOLS#/' {} \; \
-exec xsltproc --noout --nonet \
/usr/share/xml/docbook/xsl-stylesheets-1.78.1/manpages/docbook.xsl {} \;
# GLSL 3G manpages: fix docbook's manual and source variables
find . -maxdepth 1 -type f -name "*.3G" \
-exec sed -i 's/\[FIXME: manual\]/OpenGL Shading Language (GLSL) Reference/' {} \; \
-exec sed -i 's/\[FIXME: source\]/opengl-man-pages/' {} \;
# GLSL xhtml docs: fix index's css href, open links in current window
sed -i 's/href=".*opengl-man\.css"/href="opengl-man.css"/' xhtml/index.html
}
package() {
cd "${srcdir}"
# Install man pages
install -dm755 "${pkgdir}/usr/share/man/man3"
install -Dm644 man3/*.3G "${pkgdir}/usr/share/man/man3/"
install -Dm644 manglsl/*.3G "${pkgdir}/usr/share/man/man3/"
# Install docs
install -dm755 "${pkgdir}/usr/share/doc/${pkgname}/opengl3"
install -Dm644 man3/xhtml/* "${pkgdir}/usr/share/doc/${pkgname}/opengl3"
install -dm755 "${pkgdir}/usr/share/doc/${pkgname}/glsl"
install -Dm644 manglsl/xhtml/* "${pkgdir}/usr/share/doc/${pkgname}/glsl"
# Install license
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}