PKGBUILD 1.73 KB
Newer Older
philm's avatar
philm committed
1
pkgname=opengl-man-pages
2 3
pkgver=20190305
_commit=3e3580afb5d0634e71582c0d691f6cc756d31a5d
philm's avatar
philm committed
4 5 6
pkgrel=1
pkgdesc="OpenGL Man Pages"
arch=('any')
7
url="https://github.com/KhronosGroup/OpenGL-Refpages"
philm's avatar
philm committed
8
license=('custom')
9 10 11 12 13 14 15 16 17 18 19 20
# OpenGL 4.x (current) API and GLSL pages - libxslt' 'docbook-xsl'
# OpenGL 3.x and older 'w3c-mathml2' 'docbook-mathml'
makedepends=('libxslt' 'docbook-xsl' 'w3c-mathml2' 'docbook-mathml' 'git')
source=(${pkgname}::git+https://github.com/KhronosGroup/OpenGL-Refpages#commit=$_commit
        'LICENSE')
md5sums=('SKIP'
         'cb856abe5968300057e650096ba25b2f')

# gl2.1 = OpenGL 2.1 (including fixed functionality)
# es3   = OpenGL ES 3.x (will always be the latest ES, currently 3.2)
# gl4   = OpenGL 4.x (current) API and GLSL pages
_mandirs=(gl4 es3 gl2.1)
philm's avatar
philm committed
21

22 23
pkgver() {
  date +%Y%m%d
philm's avatar
philm committed
24 25 26
}

build() {
27 28 29 30 31 32 33 34 35 36 37 38 39
  export WD=`pwd`
  xmlcatalog --create --noout \
    --add public "-//W3C//DTD MathML 2.0//EN" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    --add public "-//W3C//DTD MathML//EN" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    --add system "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd" "file:///usr/share/xml/w3c/mathml2/mathml2.dtd" \
    mathml2.cat
  export XML_CATALOG_FILES="$WD/mathml2.cat /etc/xml/catalog"
 
  for manpages in ${_mandirs[@]}; do
    cd "${srcdir}/${pkgname}/${manpages}"
    for file in gl*.xml; do
      xsltproc --noout --nonet /usr/share/xml/docbook/xsl-stylesheets-*/manpages/docbook.xsl ${file}
    done
philm's avatar
philm committed
40 41 42 43 44
  done
}

package() {
  install -d "${pkgdir}/usr/share/man/man3"
45 46 47 48 49
  for manpages in ${_mandirs[@]}; do
    cd "${srcdir}/${pkgname}/${manpages}"
    install -m644 *.3G "${pkgdir}/usr/share/man/man3/"
  done
  # license
philm's avatar
philm committed
50 51
  install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}