summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 358f5cc0d738bd4af9ac6830d96755b2190ca572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Maintainer: BrLi <brli@chakralinux.org>

pkgbase=ttf-twcns-fonts
pkgname=("$pkgbase" "$pkgbase"-doc)
pkgdesc='Chinese TrueType fonts by Ministry of Education of Taiwan government, support CNS11643 standard, including Kai and Sung fontface.'
pkgver=20181012
pkgrel=1
arch=('any')
url='http://data.gov.tw/node/5961'
license=('custom')
makedepends=(dos2unix convmv)
source=('http://www.cns11643.gov.tw/AIDB/Open_Data.zip'
        'LICENSE-zh_TW'
        'LICENSE')
sha1sums=('9655b20ddfce2daa135e173b299e5d0898dc4474'
          '08c5ee06a2248340613d9bd7314a824883851bd1'
          '6be77081aa46e90e417ec73027e0477c3297a1c9')

prepare() {
    cd $srcdir/Open_Data/
    msg 'Converting every text file into UTF-8/Unix EOL'
    convmv -f big5 -t utf8 -r --notest --nfc .
    dos2unix -k */*.txt
    dos2unix -k */*/*.txt
}

package_ttf-twcns-fonts() {
    depends=(freetype2 fontconfig)
    cd $srcdir/Open_Data/
    msg 'Installing the fonts'
    install -dm755 $pkgdir/usr/share/fonts/TTF
    mv -v Fonts/TW-Kai* $pkgdir/usr/share/fonts/TTF/
    mv -v Fonts/TW-Sung* $pkgdir/usr/share/fonts/TTF/
    msg 'Installing the license'
    install -Dm644 ${srcdir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
    install -Dm644 ${srcdir}/LICENSE-zh_TW ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-zh_TW
}

package_ttf-twcns-fonts-doc() {
    options=('docs')
    cd $srcdir/Open_Data/
    msg 'Installing the documents'
    install -dm755 $pkgdir/usr/share/doc/$pkgname/
    for dir in Fonts MapingTables Properties; do
        cp -rv $dir $pkgdir/usr/share/doc/$pkgname/
    done
    install -dm755 $pkgdir/usr/share/licenses/
    ln -sf /usr/share/licenses/$pkgbase $pkgdir/usr/share/licenses/$pkgname
}