summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31d748c7bc7b16223109402b4ca76343d29c98a3 (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
pkgname=dnf
pkgver=4.4.0
pkgrel=1
pkgdesc="Package manager forked from Yum, using libsolv as a dependency resolver"
arch=('any')
url="https://github.com/rpm-software-management/$pkgname"
license=('GPL2')
depends=('libdnf>=0.54.1' 'libcomps>=0.1.8'
         'python' 'python-gpgme' 'rpm-tools>=4.14.0')
makedepends=('bash-completion' 'cmake>=3.13' 'python-sphinx')
checkdepends=('python-nose')
optdepends=('python-unbound: for gpgkey_dns_verification option')
backup=("etc/$pkgname/automatic.conf"
        "etc/$pkgname/$pkgname.conf"
        "etc/$pkgname/aliases.d/zypper.conf"
        "etc/$pkgname/protected.d/$pkgname.conf"
        "etc/$pkgname/protected.d/yum.conf"
        "etc/libreport/events.d/collect_$pkgname.conf"
        "etc/logrotate.d/$pkgname")
options=('!emptydirs')
source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
md5sums=('9c2ef7103e54e9d92bdf7c817fe73c36')

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

	# sphinx-build-3 does not exist on Arch Linux,
	# use sphinx-build instead
	sed -e 's/sphinx-build-3/sphinx-build/' \
	    -i doc/CMakeLists.txt
}

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

	cmake -B build \
	      -DCMAKE_INSTALL_PREFIX=/usr \
	      -DPYTHON_DESIRED=3

	make -C build
	make -C build doc-man
}

# Tests seem to need a non-empty RPM database installed on the system
#check() {
#	cd "$pkgname-$pkgver"
#
#	make -C build ARGS="-V" test
#}

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

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

	install -Dp -m644 README.rst "$pkgdir/usr/share/doc/$pkgname/README.rst"

	rm "$pkgdir/usr/share/man/man8/yum.8" \
	   "$pkgdir/usr/share/man/man5/yum.conf.5" \
	   "$pkgdir/usr/share/man/man1/yum-aliases.1" \
	   "$pkgdir/usr/share/man/man8/yum-shell.8"
	ln -s $pkgname-3 "$pkgdir/usr/bin/$pkgname"
	ln -s $pkgname-automatic-3 "$pkgdir/usr/bin/$pkgname-automatic"

	rm "$pkgdir/etc/$pkgname/$pkgname-strict.conf"
}

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