You are not logged in.

#1 2012-08-08 14:17:16

pokpig
Member
Registered: 2009-05-17
Posts: 9

[SOLVED] Creating a font package for Ooolatex in libreoffice

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)

Offline

#2 2012-08-10 21:42:04

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,250

Re: [SOLVED] Creating a font package for Ooolatex in libreoffice

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 <pokpig@youremail.com>

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

Offline

#3 2012-08-14 11:47:21

pokpig
Member
Registered: 2009-05-17
Posts: 9

Re: [SOLVED] Creating a font package for Ooolatex in libreoffice

Thank you stlarch, I think it works perfectly, will be adding the relevant info on wiki.

Pok

Offline

Board footer

Powered by FluxBB