summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 36048738c51d60f1ba5c35b0e9b1fedbd2ea637f (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
60
61
62
63
64
65
66
67
68
69
70
pkgname=openwsman
pkgver=2.7.2
pkgrel=1
pkgdesc="Opensource Implementation of WS-Management"
arch=('i686' 'x86_64')
url="https://$pkgname.github.io/"
license=('custom:BSD')
depends=('curl' 'libxml2' 'openssl' 'sblim-sfcc')
makedepends=('cmake>=3.13' 'swig'
             'perl'
             'python'
             'ruby' 'ruby-rdoc')
optdepends=('perl: for perl bindings'
            'python: for python bindings'
            'ruby: for ruby bindings')
backup=("etc/$pkgname/$pkgname.conf"
        "etc/$pkgname/${pkgname}_client.conf"
        "etc/$pkgname/ssleay.cnf"
        "etc/pam.d/$pkgname")
source=("https://github.com/Openwsman/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('f916b20956a64426c60a34fa2eaf2c8a13c7047ea2d2585329a6f33e00113be1')

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

	cmake -B build \
	      -DCMAKE_BUILD_TYPE=Release \
	      -DCMAKE_C_FLAGS_RELEASE='-DNDEBUG' \
	      -DCMAKE_CXX_FLAGS_RELEASE='-DNDEBUG' \
	      -DCMAKE_INSTALL_PREFIX=/usr \
	      -DPACKAGE_ARCHITECTURE=$CARCH \
	      -DLIB=lib \
	      -DBUILD_PYTHON=OFF \
	      -DBUILD_PYTHON3=ON \
	      -DBUILD_RUBY_GEM=OFF \
	      -DBUILD_JAVA=OFF

	make -C build
}

# TODO: find out why tests fail for python/perl/ruby bindings
#       and report a bug upstream if needed
check() {
	cd "$pkgname-$pkgver"

	 make -n -C build ARGS="-V" test
}

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

	make -C build DESTDIR="$pkgdir/" install

	mv "$pkgdir/usr/sbin/"* "$pkgdir/usr/bin"
	rmdir "$pkgdir/usr/sbin/"

	install -Dp -m644 build/package/"$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
	install -Dp -m644 package/"$pkgname.firewalld"     "$pkgdir/usr/lib/firewalld/services/$pkgname.xml"

	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cp -Rp build/bindings/ruby/html/ "$pkgdir/usr/share/doc/$pkgname/rdoc"

	install -Dp -m644 COPYING   "$pkgdir/usr/share/licenses/$pkgname/COPYING"
	install -Dp -m644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"

	install -Dp -m644 AUTHORS   "$pkgdir/usr/share/doc/$pkgname/AUTHORS"
	install -Dp -m644 ChangeLog "$pkgdir/usr/share/doc/$pkgname/ChangeLog"
}

# vim: set ft=sh ts=4 sw=4 noet: