summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 27d2e886b94eb9070e1ac6bb2757b6e723fc900e (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
# Maintainer: Quey-Liang Kao <s101062801@m101.nthu.edu.tw>

pkgname=openscap
pkgver=1.2.8
pkgrel=4
pkgdesc="Open Source Security Compliance Solution"

# i686 is theoretically bulitable, if anyone needs it
arch=('x86_64')
url="www.open-scap.org"
license=('GPL')

# The official site suggested the dependencies in terms of Fedora's rpm.
# Some of the corresponding packages in Arch remain unclear, which are listed 
# here for now.
# packege missing: libselinux-devel
depends=('swig' 'python' 'acl' 'libcap' 'curl' 'libgcrypt' 'libxml2' 'libxslt'
         'libldap' 'pcre' 'bzip2' 'procps-ng' 'gconf' 'perl' 'perl-xml-parser' 'perl-xml-xpath')

optdepends=()
source=("https://github.com/OpenSCAP/openscap/releases/download/$pkgver/$pkgname-$pkgver.tar.gz"
        "fails_and_fix.patch"
        "xpath.patch")
md5sums=('d26a148d834635363ac8cdd707828302'
         '7882c8b0010db0920d1cabbd2aabcc07'
         '6dc765fcfba0e5c4ee277635d58584e2')

prepare() {
	cd "$pkgname-$pkgver"

	# This is for Red Hat/Fedora family, we don't need it.
	sed -e "s/^.*default_cpe.*$/\\\/" -i $srcdir/$pkgname-$pkgver/tests/API/XCCDF/Makefile.am
	patch -f -p1 -i "$srcdir/fails_and_fix.patch"
	patch -f -p2 -i "$srcdir/xpath.patch"
}

build() {
	cd "$pkgname-$pkgver"
	CPPFLAGS="-I/usr/include/python3.5m" ./configure --disable-valgrind --disable-python --enable-python3 --prefix=/usr 
	make # -j4
}

check() {
	# Notice: It may take a long time to complete the check.
	cd "$pkgname-$pkgver"
	make check
}

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

	# That's what the guideline says.
	mv $pkgdir/usr/libexec/* $pkgdir/usr/lib/$pkgname/
	rm -fr $pkgdir/usr/libexec/
}