aboutsummaryrefslogtreecommitdiffstats
path: root/main/mtr/APKBUILD
blob: cea68d5a1cddc4ed3e7f6f0bc168ee6ebc542a9a (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
# Contributor: John Keith Hohm <john@hohm.net>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=mtr
pkgver=0.93
pkgrel=2
pkgdesc="Full screen ncurses traceroute tool"
url="http://www.bitwizard.nl/mtr/"
arch="all"
license="GPL-2.0-only"
makedepends="ncurses-dev autoconf gtk+2.0-dev libcap-dev"
options="suid"
subpackages="$pkgname-doc $pkgname-gtk $pkgname-bash-completion:bashcomp:noarch"
source="ftp://ftp.bitwizard.nl/mtr/mtr-$pkgver.tar.gz
	mtr-gtk.desktop
	"

build() {
	cd "$builddir"
	mkdir -p mtr curses gtk

	export GIT_DIR="$builddir"
	cd "$builddir"/curses
	../configure --prefix=/usr \
		--without-gtk
	make

	cd "$builddir"/gtk
	../configure --prefix=/usr \
		--with-gtk \
		--program-suffix=-gtk
	make
	unset GIT_DIR
}

package() {
	cd "$builddir"/curses
	make DESTDIR="$pkgdir" install
	cd "$builddir"/gtk
	make DESTDIR="$pkgdir" install
	install -D -m 644 "$srcdir"/mtr-gtk.desktop \
		"$pkgdir"/usr/share/applications/mtr-gtk.desktop
	install -D -m 644 "$builddir"/img/mtr_icon.xpm \
		"$pkgdir"/usr/share/pixmaps/mtr_icon.xpm
}

gtk() {
	pkgdesc="The GTK+ interface for mtr"
	mkdir -p "$subpkgdir"/usr/sbin "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/sbin/mtr*-gtk "$subpkgdir"/usr/sbin/
	mv "$pkgdir"/usr/share/applications "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/pixmaps "$subpkgdir"/usr/share/
}

bashcomp() {
	depends=""
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion
	mv "$pkgdir"/usr/share/bash-completion/completions \
		"$subpkgdir"/usr/share/bash-completion
	rm -rf "$pkgdir"/usr/share/bash-completion
}

sha512sums="046e98a661bd6248ce819411ceb6e2b875b92877de38523594898df507836c113573cf40d7d4cc548370f515abe99e0aa4d8b3ba44ad54dd00f8e93c8a96c021  mtr-0.93.tar.gz
ecf7543e0125fad6d3f17c30f29f1fc8a3b1e2e477802fe8464e436c3cdfa30d0630b8543cc3f022c475228e94ac8f92981df4d8fb08fe01d004be3d78d6da77  mtr-gtk.desktop"