summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 21fc9b0630a47e70ac2231fd2aabbd4bb7128e6d (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Maintainer: Samuel Forestier <dev+archey@samuel.domains>


##################### How to package latest release ? #####################
#### Install required dependencies...
##
## $ pacman -S base-devel pacman-contrib namcap
## $ pacman -S python-setuptools python-distro python-netifaces
##
#### Clone this very repository...
##
## $ git clone https://aur.archlinux.org/archey4.git
## $ cd archey4/
##
#### Edit PKGBUILD as needed...
##
## $ updpkgsums
## $ makepkg
## $ namcap PKGBUILD
## $ pacman -U ./archey4-*-any.pkg.tar.xz
## $ archey
## $ makepkg --printsrcinfo > .SRCINFO
## $ git commit -a
## $ git push
###########################################################################


pkgname=archey4
pkgver=v4.8.1
pkgrel=1
pkgdesc="A simple system information tool written in Python"
arch=('any')
url="https://github.com/HorlogeSkynet/archey4.git"
license=('GPLv3')
groups=('utils')
depends=('procps-ng' 'python>=3.4' 'python-distro' 'python-netifaces')
makedepends=('python-setuptools')
optdepends=('bind-tools: WAN_IP would be detected faster'
            'lm_sensors: Temperature would be more accurate'
            'pciutils: GPU wouldn'"'"'t be detected without it'
            'wmctrl: WindowManager would be more accurate'
            'virt-what: Model would contain details about the hypervisor')
provides=('archey')
conflicts=('archey-git' 'archey2' 'archey3-git' 'pyarchey')
install="${pkgname}.install"
backup=("etc/${pkgname}/config.json")
source=("${pkgname}_${pkgver}-${pkgrel}.tar.gz::https://github.com/HorlogeSkynet/${pkgname}/archive/${pkgver}.tar.gz")
md5sums=('9f74e0a67c6dba7b4936eeaecb895e26')
sha1sums=('86a300fa9f30f9b87b0995ca9d4ef17b32ab34e7')


build() {
	cd "${srcdir}/${pkgname}-${pkgver:1}"

	# Prepare and compress the manual page.
	sed -e "s/\${DATE}/$(date +'%B %Y')/1" archey.1 | \
		sed -e "s/\${VERSION}/${pkgver:1}/1" | \
			gzip -c --best - > dist/archey.1.gz

	python3 setup.py build
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver:1}"

	python3 setup.py -q install \
		--root="$pkgdir" \
		--optimize=1 \
		--skip-build

	# Configuration file.
	install -D -m0644 archey/config.json "${pkgdir}/etc/${pkgname}/config.json"

	# Manual page.
	install -D -m0644 dist/archey.1.gz "${pkgdir}/usr/share/man/man1/archey.1.gz"

	# Meta-data files.
	install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -D -m0644 README.md "${pkgdir}/usr/share/${pkgname}/README.md"
	install -D -m0644 COPYRIGHT.md "${pkgdir}/usr/share/${pkgname}/COPYRIGHT.md"
}

check() {
	cd "${srcdir}/${pkgname}-${pkgver:1}"

	python3 -m unittest
}