summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD60
1 files changed, 42 insertions, 18 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1887fa423a56..b48670cb4d4f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,27 +1,51 @@
-# Maintainer: BrLi <brli@chakraos.org>
+# Maintainer: BrLi <brli@chakralinux.org>
-pkgname=ttf-twcns-fonts
-pkgdesc='Chinese TrueType fonts by Taiwan government, support CNS11643 standard, including Kai and Sung fontface'
-pkgver=98.1
-pkgrel=2
+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=20170307
+pkgrel=1
arch=('any')
-url='http://www.cns11643.gov.tw/AIDB/'
-depends=(freetype2 fontconfig)
-makedepends=(libarchive)
-source=('AIDB_soft-100-1.linux.sh::http://www.cns11643.gov.tw/AIDB/file.do?path=download/個人電腦造字處理工具`1q`Unicode平台`1q`全字庫軟體包(Linux版)/name/AIDB_soft-100-1.linux.sh'
+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=('36a7489c9bb1cb2cb7e09951617c7719ac83786b'
- 'f7bd9f63e62492e0be4c7ef44916f6d5e0efbcf2')
+sha1sums=('f7bfcdef78bb539c42e9419f7b38f4afac5c3152'
+ '08c5ee06a2248340613d9bd7314a824883851bd1'
+ '6be77081aa46e90e417ec73027e0477c3297a1c9')
prepare() {
- sh AIDB_soft-100-1.linux.sh || true # We don't have yum
- mkdir -p twcns-fonts && cd twcns-fonts
- bsdtar -xf ../twcns-fonts-98.1-1.noarch.rpm
+ 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
+ iconv --verbose -f BIG5 -t UTF8 'Properties/全字庫屬性資料說明文件.txt' -o 'Properties/全字庫屬性資料說明文件.txt'
+ iconv --verbose -f BIG5 -t UTF8 'Fonts/全字庫字型說明文件.txt' -o 'Fonts/全字庫字型說明文件.txt'
}
-package() {
- for dir in usr etc; do
- cp -rv ${srcdir}/twcns-fonts/${dir} ${pkgdir}/${dir}
- done
+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
}