arch-packaging-hubot-sans/PKGBUILD
2024-10-30 13:28:04 -04:00

55 lines
1.7 KiB
Bash

# Copyright 2024 Foster Hangdaan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
pkgbase='hubot-sans'
pkgname=("otf-${pkgbase}" "ttf-${pkgbase}" "woff2-${pkgbase}")
pkgver=1.0.1
pkgrel=1
pkgdesc="A variable font from Github and Mona San's robotic sidekick."
arch=('any')
url='https://github.com/mona-sans'
makedepends=('git')
license=('OFL-1.1')
source=("${pkgbase}::git+https://code.fosterhangdaan.com/foster/hubot-sans.git#tag=v${pkgver}")
sha512sums=('f75659b919f84c6ed515239e29471e0ce77d5640a902bc7f7484daf27cdcbe3194a7ee26e7cddc40bd88fb271bc9143abf377f7126cad7f5fffa54a012b28b24')
_package() {
local basedir="${srcdir}/${pkgbase}"
cd "$basedir"
local ext="${1%%-*}"
local installdir="${ext^^}"
local fonts
if [[ "$ext" = "woff2" ]]; then
fonts=("${basedir}/fonts/webfonts"/*."${ext}")
else
fonts=("${basedir}/fonts/${ext}"/*."${ext}")
fi
# Install fonts
install -d "${pkgdir}/usr/share/fonts/${installdir}"
local font
for font in "${fonts[@]}"; do
install -m644 "${font}" "${pkgdir}/usr/share/fonts/${installdir}"
done
# Install license
install -Dm644 "${basedir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
for _pkgname in "${pkgname[@]}"; do
eval "function package_${_pkgname}() { _package ${_pkgname}; }"
done