mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-13 23:19:06 +08:00
xorg:mkfontdir: port to hook
This commit is contained in:
parent
ff2651fe0c
commit
e5a7ce0178
@ -3,7 +3,7 @@
|
||||
|
||||
pkgname=xorg-mkfontdir
|
||||
pkgver=1.0.7
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Create an index of X font files in a directory"
|
||||
arch=(any)
|
||||
url="http://xorg.freedesktop.org/"
|
||||
@ -11,7 +11,10 @@ license=('custom')
|
||||
depends=('sh' 'xorg-mkfontscale')
|
||||
makedepends=('xorg-util-macros')
|
||||
groups=('xorg' 'xorg-apps')
|
||||
source=(http://xorg.freedesktop.org/archive/individual/app/mkfontdir-${pkgver}.tar.bz2)
|
||||
install=xorg-mkfontdir.install
|
||||
source=(http://xorg.freedesktop.org/archive/individual/app/mkfontdir-${pkgver}.tar.bz2
|
||||
xorg-mkfontdir.hook
|
||||
xorg-mkfontdir.script)
|
||||
sha1sums=('3c06dad8a5fbf7362b51fb7d6b1ab805eba40336')
|
||||
|
||||
build() {
|
||||
@ -25,4 +28,8 @@ package() {
|
||||
make DESTDIR="${pkgdir}" install
|
||||
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
|
||||
|
||||
# pacman hook
|
||||
install -Dm644 ../xorg-mkfontdir.hook "${pkgdir}/usr/share/libalpm/hooks/xorg-mkfontdir.hook"
|
||||
install -D ../xorg-mkfontdir.script "${pkgdir}/usr/share/libalpm/scripts/xorg-mkfontdir"
|
||||
}
|
||||
|
13
xorg-mkfontdir/xorg-mkfontdir.hook
Normal file
13
xorg-mkfontdir/xorg-mkfontdir.hook
Normal file
@ -0,0 +1,13 @@
|
||||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/share/fonts/*/
|
||||
Target = !usr/share/fonts/encodings/*
|
||||
|
||||
[Action]
|
||||
Description = Updating X fontdir indices...
|
||||
When = PostTransaction
|
||||
Exec = /usr/share/libalpm/scripts/xorg-mkfontdir
|
||||
NeedsTargets
|
8
xorg-mkfontdir/xorg-mkfontdir.install
Normal file
8
xorg-mkfontdir/xorg-mkfontdir.install
Normal file
@ -0,0 +1,8 @@
|
||||
post_install() {
|
||||
if [[ -d /usr/share/fonts ]]; then
|
||||
echo -n "Creating X fontdir indices..."
|
||||
find /usr/share/fonts -mindepth 1 -path /usr/share/fonts/encodings -prune \
|
||||
-o -type d -printf '%p/\n' | /usr/share/libalpm/scripts/xorg-mkfontdir
|
||||
echo " done."
|
||||
fi
|
||||
}
|
9
xorg-mkfontdir/xorg-mkfontdir.script
Normal file
9
xorg-mkfontdir/xorg-mkfontdir.script
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
sort -r | while read -r d; do
|
||||
[[ -d $d ]] || continue
|
||||
mkfontscale "$d"
|
||||
mkfontdir "$d"
|
||||
find "$d"fonts.{scale,dir} -maxdepth 0 -size -3c -delete
|
||||
rmdir --ignore-fail-on-non-empty "$d"
|
||||
done
|
Loading…
Reference in New Issue
Block a user