summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmiel Wiedijk2018-08-10 12:15:08 +0200
committerEmiel Wiedijk2018-08-10 12:20:34 +0200
commit0b03a3ffe47983da61d099719ddbfaa12e4c1f5b (patch)
tree5420ab45e4146deb3c488e38edea890180231444
parent2967e2e8b137e6b24a42469509d94dd3488df3db (diff)
downloadaur-0b03a3ffe47983da61d099719ddbfaa12e4c1f5b.tar.gz
Move extraction/patching to prepare()
According to the PKGBUILD documantation, this should happen in prepare() instead of in package(). Additionally, this allows us to automatically get the permissions right in "$pkgdir" without hacks.
-rw-r--r--PKGBUILD24
1 files changed, 12 insertions, 12 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1b34c982745..3aa83744bbb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,22 +20,22 @@ options=('!strip')
source=("https://protonmail.com/download/protonmail-bridge_${_pkgver}-${_pkgrel}_amd64.deb")
sha256sums=('d4f5cffda8952cbae4a08ae9d69cdce79101c351411cff1c3823c6c40a254ebb')
-package() {
- tar xvJf data.tar.xz -C "$pkgdir"
+prepare() {
+ tar xvJf data.tar.xz
- # Tarball files are owned by UID:1000
- chown -R root:root "$pkgdir"
+ mv usr/share/applications/Desktop-Bridge.desktop \
+ usr/share/applications/protonmail-bridge.desktop
+ sed -i "s|Icon=/usr/share/icons/protonmail/Desktop-Bridge.svg|Icon=protonmail-bridge|" \
+ usr/share/applications/protonmail-bridge.desktop
# Don't pollute /usr/share/icons
- install -D "$pkgdir/usr/share/icons/protonmail/Desktop-Bridge.svg" \
- "$pkgdir/usr/share/icons/hicolor/scalable/apps/protonmail-bridge.svg"
- rm -rf "$pkgdir/usr/share/icons/protonmail"
-
- # Update desktop entry with appropriate values
- mv "$pkgdir/usr/share/applications/Desktop-Bridge.desktop" \
- "$pkgdir/usr/share/applications/protonmail-bridge.desktop"
- sed -i "s|Icon=/usr/share/icons/protonmail/Desktop-Bridge.svg|Icon=protonmail-bridge|" "$pkgdir/usr/share/applications/protonmail-bridge.desktop"
+ mv usr/share/icons/protonmail/Desktop-Bridge.svg \
+ usr/share/icons/hicolor/scalable/apps/protonmail-bridge.svg
+ rmdir usr/share/icons/protonmail
+}
+package() {
+ cp -r usr/ "$pkgdir"
install -Dm644 "$pkgdir"/usr/lib/protonmail/bridge/{eula.txt,LICENSE} \
-t "$pkgdir/usr/share/licenses/$pkgname"
}