summaryrefslogtreecommitdiff
path: root/libre/texlive-latexextra-libre/texlive.install
blob: 3416a27328d73ab40cc60fa4055b0bbfb2a4142d (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
PKGNAME="texlive-latexextra"
UPDMAP="etc/texmf/web2c/updmap.cfg"
UPDMAPLOCAL="etc/texmf/web2c/updmap-local.cfg"
SYNCWITHTREES=''

MAPFILE="var/lib/texmf/arch/installedpkgs/$PKGNAME.maps"

post_install() {
  TMPFILE=`mktemp`
  echo    ">>> texlive: saving updmap.cfg as $TMPFILE..."
  cp "$UPDMAP" "$TMPFILE"
  echo    ">>> texlive: regenerating updmap.cfg (custom additions should go"
  echo    "             into /etc/texmf/web2c/updmap-local.cfg"
  cp usr/share/texmf/web2c/updmap-hdr.cfg $UPDMAP
  cat var/lib/texmf/arch/installedpkgs/*.maps >> $UPDMAP
  [ -f "$UPDMAPLOCAL" ] && cat "$UPDMAPLOCAL" >> $UPDMAP
  echo    ">>> texlive: updating the filename database..."
  usr/bin/mktexlsr
  echo    ">>> texlive: updating the fontmap files with updmap..."
  usr/bin/updmap-sys --quiet --nohash
  echo    " done." 
}

post_upgrade() {
  TMPFILE=`mktemp`
  echo    ">>> texlive: saving updmap.cfg as $TMPFILE..."
  cp "$UPDMAP" "$TMPFILE"
  echo    ">>> texlive: regenerating updmap.cfg (custom additions should go"
  echo    "             into /etc/texmf/web2c/updmap-local.cfg"
  cp usr/share/texmf/web2c/updmap-hdr.cfg $UPDMAP
  cat var/lib/texmf/arch/installedpkgs/*.maps >> $UPDMAP
  [ -f "$UPDMAPLOCAL" ] && cat "$UPDMAPLOCAL" >> $UPDMAP
  echo    ">>> texlive: updating the filename database..."
  usr/bin/mktexlsr
  echo    ">>> texlive: updating the fontmap files with updmap..."
  usr/bin/updmap-sys --quiet --nohash $SYNCWITHTREES
  echo    " done." 
}

pre_remove() {
for m in `cut -d' ' -f2 $MAPFILE`; do 
  sed -i "/\s$m/d" $UPDMAP ; 
done
}

post_remove() {
  echo    ">>> texlive: updating the filename database..."
  usr/bin/mktexlsr
  echo    ">>> texlive: updating the fontmap files with updmap..."
  usr/bin/updmap-sys --quiet --nohash
  echo    " done." 
}