summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6e125f77092f809f68b2bf4e94421148f6b9f6b7 (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
# Maintainer: Jonathon Fernyhough <jonathon at_manjaro_org>

pkgname=swatchbooker-git
_pkgname=SwatchBooker
pkgver=latest
pkgrel=1
pkgdesc='Colour swatch book viewer/convertor/editor'
arch=('any')
url='http://www.selapa.net/swatchbooker/'
license=('GPL3')
depends=('python2' 'python2-pyqt4')
makedepends=('git')
provides=("${pkgname/-git/}")
conflicts=("${pkgname/-git/}")
source=("${_pkgname}::git+https://github.com/olivierberten/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
	cd "$_pkgname"
	# https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver.28.29_function
	( set -o pipefail
		git describe --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

build() {
    cd "${srcdir}/${_pkgname}"
    python2 ./setup.py build
}

package() {
    cd "${srcdir}/${_pkgname}"
    python2 ./setup.py install -O2 --prefix="${pkgdir}"/usr

	# Tidy
	rm "${pkgdir}"/usr/bin/swatchbooker_w32_postinst.py

	# Fix up
	chmod a+x "${pkgdir}"/usr/bin/*
	for exe in "${pkgdir}"/usr/bin/*; do
		sed -i '4s|python|python2|' "$exe"
	done
}