You are not logged in.
I'm trying to create a package for Google's Material Design Icons. This is my first time creating a PKGBUILD, so it was modified from ttf-font-awesome. Could someone review this?
PKGBUILD
# Maintainer: Jordi Pakey-Rodriguez <me@jordi.codes>
pkgname=ttf-material-design-icons
pkgver=3.0.1
pkgrel=1
pkgdesc="Material Design icons by Google"
arch=('any')
url="http://google.github.io/material-design-icons/"
license=('Apache-2.0')
depends=('fontconfig' 'xorg-font-utils')
source=("material-design-icons-${pkgver}.tar.gz::https://github.com/google/material-design-icons/archive/v${pkgver}.tar.gz")
sha256sums=('ea1996f82d39f56357754b2b3d9ad8b812065dc059ad488fb086233c360676a0')
install=${pkgname}.install
package() {
cd material-design-icons-${pkgver}/iconfont
install -d "${pkgdir}"/usr/share/fonts/TTF
install -m644 *.ttf "${pkgdir}"/usr/share/fonts/TTF
}
ttf-material-design-icons.install
post_install() {
printf 'Updating font cache...'
fc-cache -s > /dev/null
mkfontscale /usr/share/fonts/TTF
mkfontdir /usr/share/fonts/TTF
printf 'done\n'
}
post_upgrade() {
post_install $1
}
post_remove() {
post_install $1
}
op=$1
shift
$op $*
Thanks!
Last edited by 0xdec (2017-02-15 21:34:19)
Offline
You don't need (and should remove) the .install file. It's all handled by pacman hooks now. https://www.archlinux.org/todo/pacman-h … mkfontdir/
Offline
Looks good as-is... I tend to use the variables whenever possible but that is just personal preference. As well, you are only supplying one font so just call it out rather than the wildcard. Again, personal preference:
# Maintainer: Jordi Pakey-Rodriguez <me@jordi.codes>
pkgname=ttf-material-design-icons
_pkgname=material-design-icons
pkgver=3.0.1
pkgrel=1
pkgdesc="Material Design icons by Google"
arch=('any')
url="http://google.github.io/material-design-icons/"
license=('Apache-2.0')
depends=('fontconfig' 'xorg-font-utils')
source=("https://github.com/google/$_pkgname/archive/$pkgver.tar.gz")
sha256sums=('ea1996f82d39f56357754b2b3d9ad8b812065dc059ad488fb086233c360676a0')
package() {
install -d "$pkgdir/usr/share/fonts/TTF"
install -m644 "$_pkgname-$pkgver/iconfont/MaterialIcons-Regular.ttf" "$pkgdir/usr/share/fonts/TTF/MaterialIcons-Regular.ttf"
}
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Thanks for the advice! I've removed the .install file and have tested graysky's edited PKGBUILD. I think I'll go ahead and submit it at this point, thanks for the help!
Offline