[arch-commits] Commit in ttf-dejavu/trunk (PKGBUILD ttf-dejavu.install)

Jan de Groot jgc at archlinux.org
Sat Mar 6 14:39:30 EST 2010


    Date: Saturday, March 6, 2010 @ 14:39:30
  Author: jgc
Revision: 71355

upgpkg: ttf-dejavu 2.30-2
Add fontconfig configuration files. Configuration handling is taken from the fontconfig package

Modified:
  ttf-dejavu/trunk/PKGBUILD
  ttf-dejavu/trunk/ttf-dejavu.install

--------------------+
 PKGBUILD           |   16 ++++++++++------
 ttf-dejavu.install |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-06 18:47:30 UTC (rev 71354)
+++ PKGBUILD	2010-03-06 19:39:30 UTC (rev 71355)
@@ -5,21 +5,25 @@
 
 pkgname=ttf-dejavu
 pkgver=2.30
-pkgrel=1
+pkgrel=2
 pkgdesc="Font family based on the Bitstream Vera Fonts with a wider range of characters"
 arch=('any')
 url="http://dejavu.sourceforge.net/"
 license=('custom')
 depends=('fontconfig' 'xorg-fonts-encodings')
 install=ttf-dejavu.install
-source=(http://downloads.sourceforge.net/project/dejavu/dejavu/$pkgver/dejavu-fonts-ttf-$pkgver.tar.bz2)
+source=(http://downloads.sourceforge.net/project/dejavu/dejavu/${pkgver}/dejavu-fonts-ttf-${pkgver}.tar.bz2)
 md5sums=('545b3bfc69893075a90a7c6e6f4a7e67')
 
 build() {
-  cd "$srcdir/dejavu-fonts-ttf-$pkgver"
+  cd "${srcdir}/dejavu-fonts-ttf-${pkgver}"
 
-  mkdir -p "$pkgdir/usr/share/fonts/TTF" || return 1
-  install -m644 ttf/*.ttf "$pkgdir/usr/share/fonts/TTF" || return 1
+  install -m755 -d "${pkgdir}/usr/share/fonts/TTF"
+  install -m644 ttf/*.ttf "${pkgdir}/usr/share/fonts/TTF/" || return 1
 
-  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/ttf-dejavu/LICENSE" || return 1
+  install -m755 -d "${pkgdir}/etc/fonts/conf.avail"
+  install -m644 fontconfig/*.conf "${pkgdir}/etc/fonts/conf.avail/" || return 1
+
+  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
+  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/" || return 1
 }

Modified: ttf-dejavu.install
===================================================================
--- ttf-dejavu.install	2010-03-06 18:47:30 UTC (rev 71354)
+++ ttf-dejavu.install	2010-03-06 19:39:30 UTC (rev 71355)
@@ -1,13 +1,56 @@
+configs=(20-unhint-small-dejavu-sans-mono.conf
+         20-unhint-small-dejavu-sans.conf
+         20-unhint-small-dejavu-serif.conf
+         57-dejavu-sans-mono.conf
+         57-dejavu-sans.conf
+         57-dejavu-serif.conf)
 post_install() {
+  pushd /etc/fonts/conf.d > /dev/null
+  for config in "${configs[@]}"; do
+    ln -sf ../conf.avail/${config} .
+  done
+  popd > /dev/null
   fc-cache -fs
   mkfontscale usr/share/fonts/TTF
   mkfontdir usr/share/fonts/TTF
 }
 
 post_upgrade() {
-  post_install
+  if [ `vercmp 2.30-2 $2` -gt 0 ]; then 
+    pushd /etc/fonts/conf.d > /dev/null
+    for config in "${configs[@]}"; do
+      ln -sf ../conf.avail/${config} .
+    done
+    popd > /dev/null
+  fi
+  for config in /etc/fonts/conf.d/*; do
+    if [ ! -f ${config} ]; then
+      rm -f ${config}
+    fi
+  done
+  fc-cache -fs
+  mkfontscale usr/share/fonts/TTF
+  mkfontdir usr/share/fonts/TTF
 }
 
+pre_upgrade() {
+  # Link new config files not present on system yet
+  pushd /etc/fonts/conf.d > /dev/null
+  for config in "${configs[@]}"; do
+    if [ ! -f ../conf.avail/${config} ]; then
+      ln -sf ../conf.avail/${config} .
+    fi
+  done
+  popd > /dev/null
+}
+
 post_remove() {
-  post_install
+  pushd /etc/fonts/conf.d > /dev/null
+  for config in "${configs[@]}"; do
+    rm -f ${config}
+  done
+  popd > /dev/null
+  fc-cache -fs
+  mkfontscale usr/share/fonts/TTF
+  mkfontdir usr/share/fonts/TTF
 }



More information about the arch-commits mailing list