summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorlarchunix2016-06-16 22:59:48 +0200
committerlarchunix2016-06-16 22:59:48 +0200
commitd55754712fdbd768a62bd7e0cdd3db3882fc4367 (patch)
treef0313df213159709ce5e12ca7554156a9e4d72fa /PKGBUILD
parentf5fba2a392712a2d5f9ce75f257a0c2145bcf3b8 (diff)
downloadaur-d55754712fdbd768a62bd7e0cdd3db3882fc4367.tar.gz
Add optional usermode support
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD11
1 files changed, 11 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a99edaa59148..47dba2382cd1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,6 +2,9 @@
# Contributor: David Roheim < david dot roheim at gmail dot com >
# Contributor: Thomas Dziedzic < gostrc at gmail >
+# Set to 1 to enable usermode support
+_with_usermode=0
+
pkgname=mock
pkgver=1.2.17
pkgrel=1
@@ -10,6 +13,7 @@ url="http://fedoraproject.org/wiki/Projects/Mock"
arch=('any')
license=('GPL2')
depends=('python')
+((_with_usermode)) && depends+=('usermode')
optdepends=('createrepo_c: for mockchain command'
'dnf-plugins-core: to create RPMs for Fedora 23 and above'
'lvm2: for lvm_root plugin'
@@ -35,6 +39,13 @@ build() {
package() {
cd "$pkgname-$pkgver"
make DESTDIR="$pkgdir/" install
+
+ if ((_with_usermode)); then
+ mv "$pkgdir/usr/bin/$pkgname"{,.py}
+ sed -e "s|/usr/sbin/$pkgname|/usr/bin/$pkgname.py|" \
+ -i "$pkgdir/etc/security/console.apps/$pkgname"
+ ln -s /usr/bin/consolehelper "$pkgdir/usr/bin/$pkgname"
+ fi
}
# vim: set ft=sh ts=4 sw=4 noet: