From bb71c5c6832aab47c96cf370a62e2a96d3e8597f Mon Sep 17 00:00:00 2001 From: yjun Date: Fri, 13 Aug 2021 00:07:15 +0800 Subject: [PATCH] pkgbuild: simpilfied PKGBUILD --- PKGBUILD | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 91be0af8138..dbd8fea86c0 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -28,6 +28,10 @@ sha256sums_x86_64=('b7d1a34d1054e9708fab1dcd59a4e3f1253c39887c2c2e53f8a7e64f424a sha256sums_aarch64=('526a0debdca1305da291e9da6fc450874dc4ca70538ba111a5b2224ed8b29a29') sha256sums_armv7h=('de2820a57c2fd4a0efb84513e0deceb0265d181e407149dad2c42c271932a53e') +_install() { + find ${@: 2} -type f -exec install -Dm$1 {} ${pkgdir}/{} \; +} + build() { mkdir -p ${srcdir}/build @@ -38,26 +42,22 @@ package() { cd ${srcdir}/build/ # binary wrapper - install -Dm 755 usr/local/bin/${_pkgname} -t ${pkgdir}/usr/bin/ + install -Dm755 usr/local/bin/${_pkgname} -t ${pkgdir}/usr/bin/ # lib - find opt/${_pkgname}/lib -type f -exec install -Dm644 {} ${pkgdir}/{} \; - # find opt/${_pkgname}/plugins -type f -exec install -Dm644 {} ${pkgdir}/{} \; + # find opt/${_pkgname}/lib -type f -exec install -Dm644 {} ${pkgdir}/{} \; + _install 644 opt/${_pkgname}/lib # icon - find opt/${_pkgname}/res -maxdepth 1 -type f -exec install -Dm644 {} ${pkgdir}/{} \; + # find opt/${_pkgname}/res -maxdepth 1 -type f -exec install -Dm644 {} ${pkgdir}/{} \; + _install 644 opt/${_pkgname}/res -maxdepth 1 # config # empty dir install -dm755 ${pkgdir}/opt/${_pkgname}/config # binary & scripts - install -Dm755 opt/${_pkgname}/bin/${_pkgname} -t ${pkgdir}/opt/${_pkgname}/bin - install -Dm755 opt/${_pkgname}/bin/${_pkgname}d -t ${pkgdir}/opt/${_pkgname}/bin - install -Dm755 opt/${_pkgname}/bin/${_pkgname}c -t ${pkgdir}/opt/${_pkgname}/bin - - # qt.conf - # install -Dm644 opt/${_pkgname}/bin/qt.conf -t ${pkgdir}/opt/${_pkgname}/bin + install -Dm755 opt/${_pkgname}/bin/${_pkgname}{,c,d} -t ${pkgdir}/opt/${_pkgname}/bin # desktop entry install -Dm644 usr/share/applications/${_pkgname}.desktop -t ${pkgdir}/usr/share/applications @@ -66,8 +66,7 @@ package() { install -Dm644 etc/systemd/system/${_pkgname}d.service -t ${pkgdir}/usr/lib/systemd/system # icon - # install -Dm644 usr/share/pixmaps/${_pkgname}.png -t ${pkgdir}/usr/share/pixmaps - find usr/share/icons -type f -exec install -Dm644 {} ${pkgdir}/{} \; - + # find usr/share/icons -type f -exec install -Dm644 {} ${pkgdir}/{} \; + _install 644 usr/share/icons } # vim: set sw=2 ts=2 et: