summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoryar2017-04-12 11:39:27 -0700
committeryar2017-04-12 11:39:27 -0700
commitf8f3a10cd13c8a4b15f196c451354488a541df8d (patch)
tree1c5a2d28ad70799afb70898ccdec473af9502c1a
parentfa963a3280e1ae1e3710eb1a7cfce54185005870 (diff)
downloadaur-f8f3a10cd13c8a4b15f196c451354488a541df8d.tar.gz
use ALPM hook instead of install file
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD19
-rw-r--r--font.install13
-rw-r--r--fontconfig-ttf.hook11
4 files changed, 31 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ed44c67f866..dc6e5944d3d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,21 @@
# Generated by mksrcinfo v8
-# Wed Apr 12 17:47:30 UTC 2017
+# Wed Apr 12 18:38:44 UTC 2017
pkgbase = ttf-code2000
pkgdesc = Unicode TT font with extensive glyph coverage
pkgver = 1.171
pkgrel = 3
url = https://web.archive.org/web/20101122141939/http://code2000.net/
- install = font.install
arch = i686
arch = x86_64
license = custom
depends = fontconfig
depends = xorg-fonts-encodings
+ depends = xorg-mkfontscale
+ depends = xorg-mkfontdir
source = https://web.archive.org/web/20101122142710/http://code2000.net/CODE2000.ZIP
+ source = fontconfig-ttf.hook
md5sums = 1fa4e4b61d7ac0980b038e9260667a77
+ md5sums = 91867dbfdbc2df620f596e8bc5ba908f
pkgname = ttf-code2000
diff --git a/PKGBUILD b/PKGBUILD
index 21cd26fdf7a..f96afe550ff 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,12 +7,23 @@ pkgdesc="Unicode TT font with extensive glyph coverage"
arch=('i686' 'x86_64')
url="https://web.archive.org/web/20101122141939/http://code2000.net/"
license=('custom')
-depends=('fontconfig' 'xorg-fonts-encodings')
-install=font.install
-source=(https://web.archive.org/web/20101122142710/http://code2000.net/CODE2000.ZIP)
-md5sums=('1fa4e4b61d7ac0980b038e9260667a77')
+depends=(
+ 'fontconfig'
+ 'xorg-fonts-encodings'
+ 'xorg-mkfontscale'
+ 'xorg-mkfontdir'
+)
+source=(
+ 'https://web.archive.org/web/20101122142710/http://code2000.net/CODE2000.ZIP'
+ 'fontconfig-ttf.hook'
+)
+md5sums=(
+ '1fa4e4b61d7ac0980b038e9260667a77'
+ '91867dbfdbc2df620f596e8bc5ba908f'
+)
package() {
install -D -m644 CODE2000.TTF "$pkgdir/usr/share/fonts/TTF/Code2000.ttf"
install -D -m644 CODE2000.HTM "$pkgdir/usr/share/licenses/ttf-code2000/Code2000.html"
+ install -D -m644 "fontconfig-ttf.hook" "${pkgdir}/usr/share/libalpm/hooks/fontconfig-ttf.hook"
}
diff --git a/font.install b/font.install
deleted file mode 100644
index 18666d2a3d6..00000000000
--- a/font.install
+++ /dev/null
@@ -1,13 +0,0 @@
-post_install() {
- fc-cache -fs
- mkfontscale usr/share/fonts/TTF
- mkfontdir usr/share/fonts/TTF
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
diff --git a/fontconfig-ttf.hook b/fontconfig-ttf.hook
new file mode 100644
index 00000000000..24d3596b839
--- /dev/null
+++ b/fontconfig-ttf.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Type = File
+Operation = Install
+Operation = Upgrade
+Operation = Remove
+Target = usr/share/fonts/TTF/*
+
+[Action]
+Description = Updating TTF fonts...
+When = PostTransaction
+Exec = /bin/sh -c '/usr/bin/fc-cache -fs; /usr/bin/mkfontscale usr/share/fonts/TTF; /usr/bin/mkfontdir usr/share/fonts/TTF'