[SOLVED] Creating a font package for Ooolatex in libreoffice

Advertisement
Dear all,
I would like to pack up a font package for rendering latex equation in Libreoffice.
The relevant fonts are:
http://sourceforge.net/projects/ooolate … urce=files-
containing both ttf and otf fonts.
The aim is to use makepkg -s, pacman -U xxx route instead of copying by hand so that pacman can manage the fonts.
I have to admit that I have no experience in PKGBUILD. And would like some help for the correct PKGBUILD file and ttf-ooolatex.install file.
Here is what I have right now:
PKGBUILD
pkgname=ttf-ooolatex
pkgver=1.0
pkgrel=1
depends=('fontconfig' 'xorg-font-utils')
pkgdesc="custom fonts"
arch=('any')
source=(./$pkgname) -> I am not sure how to write the source line
install=$pkgname.install
build()
  mkdir -p $pkgdir/usr/share/fonts/ooolatex
  cp $srcdir/$pkgname/*.ttf $pkgdir/usr/share/fonts/ooolatex
  cp $srcdir/$pkgname/*.otf $pkgdir/usr/share/fonts/ooolatex
ttf-ooolatex.install
post_install() {
  echo -n "Updating font cache... "
  fc-cache -fs >/dev/null
-> not sure what to do with the mkfontscale and mkfontdirectory
  echo "done"
post_upgrade() {
  post_install
As you can see, I am trying to copy all fonts to /usr/share/fonts/ooolatex folder and do a
#  fc-cache -vf
in that folder.
Any help on writing the two files are greatly appreciated. Thanks in advance for helping.
For more details about ooolatex in arch linux
see
https://wiki.archlinux.org/index.php/Ooolatex
I will be adding the relevant instruction once I figure out how to install the fonts using pacman.
Pok
Last edited by pokpig (2012-08-14 11:50:19)
Advertisement

Replay

I put together a PKGBUILD and .install for you. I'm not positive if it's totally correct and about the depends, but it seems to work. If someone else could look at it first, that would be great.
# Maintainer: pokpig <[email protected]>
pkgname=OOoLatexFonts
pkgver=4.0.0_beta
pkgrel=1
pkgdesc="A set of macros to provide latex support in OpenOffice."
arch=('any')
url="http://sourceforge.net/projects/ooolatex"
license=('GPL')
depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils')
install=OOoLatexFonts.install
source=("http://sourceforge.net/projects/ooolatex/files/OOoLatex/OOoLatex-4.0.0-beta/OOoLatexFonts.zip")
build () {
cd "$srcdir"
install -d "$pkgdir/usr/share/fonts/TTF"
install -d "$pkgdir/usr/share/doc/$pkgname"
install -m644 *.ttf *.otf "$pkgdir/usr/share/fonts/TTF"
install -m644 README "$pkgdir/usr/share/doc/$pkgname"
md5sums=('dcfd6ab5750d89393a0002687b751c48')
and the .install:
# arg 1: the new package version
post_install() {
echo "Updating font cache... "
fc-cache -fs >/dev/null 2>&1
mkfontscale /usr/share/fonts/TTF
mkfontdir /usr/share/fonts/TTF
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install $1
# arg 1: the old package version
post_remove() {
fc-cache -fs >/dev/null 2>&1
mkfontscale /usr/share/fonts/TTF
mkfontdir /usr/share/fonts/TTF
hope that helps