summaryrefslogtreecommitdiff
path: root/pcr/firejail/PKGBUILD
blob: d0efc4613fd262f6663c96aad8bde0c0206af1f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Luke R. <g4jc@openmailbox.org> GPG: rsa4096/3EAE8697
# Contributor (Arch): ajs124 < aur AT ajs124 DOT de > 

pkgname=firejail
pkgver=0.9.28
pkgrel=2
pkgdesc="Linux namespaces sandbox program"
arch=('i686' 'x86_64' 'armv7h')
license=(GPL2)
url=https://l3net.wordpress.com/projects/firejail/
source=("https://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgname-$pkgver.tar.bz2"
'PKGBUILD'
'PKGBUILD.sig'
'001-addmoresecurity-firefox.patch'
"$pkgname.install")
install=("$pkgname.install")
validpgpkeys=('CB6E213A349B8DF9E96B622AC3F4FFCF3EAE8697') # PKGBUILD Maintainer's key
sha512sums=('a0c6715cbaf1043f2ea92b33da5884b6ed0993b3e5d03a3edd181b6663a696a2a60a44e0ad39fc9fcfd50d79eb5acb2f0f33452467bf50912f558ec23ebfc125'
            'SKIP'
            'SKIP'
            'b1ce36df78882e9e3a9b9a6b043ce0c11b4de71cf400abf19ee808d45081f9bfc6a56911bc5befae9ac374e88fb1a57326770781b3aedb2fdd54a95e8443a441'
            'f573592cc977cc739d2913f75ebe1ab2642d1d7d638706c56bca792dce6014d88c8789341ddeae59307aa94f72f3ab178299652b71a62804b1b674433a89ec21')
whirlpoolsums=('84792b384d4e578347a859354d5639be24c3b370c3c6c07d245bbd35b7d6adcac8f5f382e92dec55a3a53cc68ea00fb7071be01aa390b37df5e0768f00efd90e'
'SKIP'
'SKIP'
'66ba5f7ca349c63170bd7ac83b7bc0c9472ad5bb18c243842f969f40475ebbb84c37bd3b837f21058294dc5da14674d07b74026dbcc324324fb94b6a8abfee4f'
'8f6848ad73bb498cb6a4f754a55094629443e7f56d669990e8e3f33415ba723d7ba47eb65737dd3ed918299665bf9bd455c25b5005caa74bb8c8dbb5e02ab4dc')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	sed -i '\|bash -c "if \[ ! -f /etc/firejail/login\.users | s|bash -c ".*"$|install -c -m 0644 etc/login.users $(DESTDIR)/etc/firejail/\.|' Makefile.in ## Fix "backup entry file not in packag" warning.
	patch ${srcdir}/${pkgname}-${pkgver}/etc/firefox.profile $srcdir/001-addmoresecurity-firefox.patch ## Add additional blacklists to FireFox profile for more security

	## Remove non-libre program profiles.
	rm ${srcdir}/${pkgname}-${pkgver}/etc/dropbox.profile
	sed -i 's|install -c -m 0644 etc/dropbox.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile
	sed -i 's|install -c -m 0644 etc/dropbox.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile.in

	rm ${srcdir}/${pkgname}-${pkgver}/etc/chromium.profile
	sed -i 's|install -c -m 0644 etc/chromium.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile
	sed -i 's|install -c -m 0644 etc/chromium.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile.in

	rm ${srcdir}/${pkgname}-${pkgver}/etc/chromium-browser.profile
	sed -i 's|install -c -m 0644 etc/chromium-browser.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile
	sed -i 's|install -c -m 0644 etc/chromium-browser.profile $(DESTDIR)/etc/firejail/.||'  ${srcdir}/${pkgname}-${pkgver}/Makefile.in
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	# fix build
	export CFLAGS=${CFLAGS/-fsanitize=undefined/}
	./configure --prefix=/usr
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
}