summaryrefslogtreecommitdiffstats
path: root/abs/extra/texlive-pictures/PKGBUILD
blob: bf41cf11d974ecd143108dd8f3149893ca6ddf14 (plain)
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
# $Id: PKGBUILD$
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=texlive-pictures
pkgver=2017.46740
_revnr=${pkgver#2017.}
pkgrel=1
pkgdesc="TeX Live - Packages for drawings graphics"
license=('GPL')
arch=(any)
depends=('texlive-core')
groups=('texlive-most')
url='http://tug.org/texlive/'
source=("https://sources.archlinux.org/other/texlive/$pkgname-$pkgver-src.zip"
        "$pkgname.maps"
        "xypdf-rev1.21.patch")
options=('!emptydirs')
sha256sums=('2dccd8d34c097dedd3dba8f8f26f141afd5bc90f86d5f6106f39e993fe8144c1'
            '847676e2322065219992ef249a68cddb26d71e192e8d59db58f264c5e11c8be9'
            '4e5cedf4775542461b442c06bdabb3eb4e20a04f54e493bc753a958577e78175')

build() {
   cd "$srcdir"
   for p in *.tar.xz; do
	   bsdtar -xf $p
   done
   rm -rf {tlpkg,doc,source} || true

   patch -Np1 -i "${srcdir}/xypdf-rev1.21.patch" -d "${srcdir}/tex/generic/xypic"
}

package() {
   cd "$srcdir"
   install -m755 -d $pkgdir/var/lib/texmf/arch/installedpkgs
   sed -i '/^#/d' CONTENTS
   install -m644 CONTENTS $pkgdir/var/lib/texmf/arch/installedpkgs/${pkgname}_${_revnr}.pkgs
   install -m644 $pkgname.maps $pkgdir/var/lib/texmf/arch/installedpkgs/
   install -m755 -d $pkgdir/usr/share
   wanteddirs=$(for d in *; do test -d $d && [[ $d != texmf* ]] && echo $d; done) || true
   for dir in $wanteddirs; do
     find $dir -type d -exec install -d -m755 $pkgdir/usr/share/texmf-dist/'{}' \;
     find $dir -type f -exec install -m644 '{}' $pkgdir/usr/share/texmf-dist/'{}' \;
   done
   if [[ -d texmf-dist ]]; then
     find texmf-dist -type d -exec install -d -m755 $pkgdir/usr/share/'{}' \;
     find texmf-dist -type f -exec install -m644 '{}' $pkgdir/usr/share/'{}' \;
   fi
   if [[ -d $pkgdir/usr/share/texmf-dist/scripts ]]; then
     find $pkgdir/usr/share/texmf-dist/scripts -type f -exec chmod a+x '{}' \;
   fi

    _linked_scripts="
cachepic/cachepic.tlu
epspdf/epspdftk.tcl
epspdf/epspdf.tlu
fig4latex/fig4latex
getmap/getmapdl.lua
mathspic/mathspic.pl
mkpic/mkpic
petri-nets/pn2pdf
"
    install -m755 -d $pkgdir/usr/bin
    for _script in ${_linked_scripts}; do
        _scriptbase=$(basename $_script)
        _scriptbase=${_scriptbase%.*}
        ln -s /usr/share/texmf-dist/scripts/${_script} ${pkgdir}/usr/bin/${_scriptbase}
    done
}