summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1d08b88c72049396a36a06c948e676af5f5b446f (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
# Maintainer: robertfoster

pkgname=openbazaar-git
pkgver=v2.1.0.rc5.r0.ga692b00a
pkgrel=1
pkgdesc="Front-end Electron application for talking with the OpenBazaar daemon (Latest devel version)" 
arch=(any)
url="http://openbazaar.org"
license=('MIT')
depends=(electron)
makedepends=(git npm)
conflicts=('openbazaar')
source=("${pkgname%%-git}::git+https://github.com/OpenBazaar/openbazaar-desktop.git"
        "${pkgname%%-git}.js"
        "${pkgname%%-git}.desktop"
)
install=${pkgname%%-git}.install
options=('!strip')

build(){
  cd $srcdir/${pkgname%%-git}
	npm install --silent
	npm run build
	npm prune --production
}

package(){
	cd $srcdir
	appdir="usr/lib/${pkgname%%-git}"

	msg2 "Installing Openbazaar data"
	install -d $pkgdir/${appdir%%/${pkgname%%-git}}
	cp -rf ${pkgname%%-git} $pkgdir/$appdir

	msg2 "Installing execution script"
	install -Dm755 ${pkgname%%-git}.js $pkgdir/usr/bin/${pkgname%%-git}

	msg2 "Installing icons and desktop menu entry"
	install -Dm644 ${pkgname%%-git}/imgs/icon.png $pkgdir/usr/share/pixmaps/${pkgname%%-git}2.png
	install -Dm644 ${pkgname%%-git}.desktop $pkgdir/usr/share/applications/${pkgname%%-git}.desktop
	
	# Cleanup
	cd $pkgdir/$appdir
	rm -rf .git*
	rm -rf .travis
	cp -rf prod/* js/
    	find "${pkgdir}"/${appdir} \
        	-name "bin" -prune -exec rm -r '{}' \; \
        	-or -name "example" -prune -exec rm -r '{}' \; \
       	 	-or -name "examples" -prune -exec rm -r '{}' \; \
        	-or -name "test" -prune -exec rm -r '{}' \; \
        	-or -executable -type f -exec rm -r '{}' \;
}

pkgver() {
  cd $srcdir/${pkgname%%-git}
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

md5sums=('SKIP'
         '446ad1e41acd07468c3750a9027dc8f8'
         'a278f17aa965510cadb534df49b245dd')