blob: 11447bc05daf578a2ade17be5496bdb9db750954 (
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# Maintainer: Moses Narrow <moe_narrow@use.startmail.com>
pkgname=privateness
_pkgname=privateness
_pkgname1=skycoin
_githuborg=NESS-Network
_githuborg1=skycoin
pkgdesc="NESS Core and Wallet. privateness.network"
pkgver='0.27.1'
pkgrel=1
arch=('x86_64' 'aarch64' 'armv8' 'armv7' 'armv7l' 'armv7h' 'armv6h' 'armhf' 'armel' 'arm')
_pkggopath="github.com/${_githuborg}/${_pkgname}"
_pkggopath1="github.com/${_githuborg1}/${_pkgname1}"
url="https://${_pkggopath}"
_url1="https://${_pkggopath1}"
makedepends=('git' 'go' 'musl' 'kernel-headers-musl')
source=("git+${_url1}.git#branch=${BRANCH:-develop}"
"git+${url}.git#branch=${BRANCH:-karen}"
"privateness.png"
"com.privateness.Privateness.desktop")
sha256sums=('SKIP'
'SKIP'
'cb8a2696110ef59f97d5cd31d0bf77342a4f114fa30cb507c960b55783de331f'
'd2f7c042c64477ddede76734cc3316a754b70ea6c091fbc11a92e94de2b1e2d1')
#tar -czvf privateness-scripts.tar.gz privateness-scripts
#updpkgsums
#pkgver='autogenerated'
#pkgver() {
# cd "${srcdir}/${_pkgname}"
# local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
# local count=$(git rev-list --count HEAD)
# local commit=$(git rev-parse --short HEAD)
# echo "$date.${count}_$commit"
# }
prepare() {
mkdir -p ${srcdir}/go/src/github.com/${_githuborg1}/ ${srcdir}/go/bin
ln -rTsf ${srcdir}/${_pkgname1} ${srcdir}/go/src/${_pkggopath1}
}
#build binary from the skycoin sources with newcoin using ness fiber.toml.
build() {
export GOPATH=${srcdir}/go
export GOBIN=${GOPATH}/bin
export CC=musl-gcc
export CGO_ENABLED=1
mv ${srcdir}/${_pkgname}/fiber.toml ${srcdir}/${_pkgname1}/fiber.toml
_cmddir=${srcdir}/go/src/${_pkggopath1}/cmd
cd ${srcdir}/go/src/${_pkggopath1}/
go run cmd/newcoin/newcoin.go createcoin --coin ${_pkgname}
#_buildbins address_gen
_buildbins cipher-testdata
_buildbins monitor-peers
_buildbins newcoin
_buildbins privateness
_buildbins skycoin-cli
#binary transparency
cd $GOBIN
_msg2 'binary sha256sums'
sha256sum $(ls)
#create wallet launcher script
echo -e "#!/bin/bash
#launch ness wallet
privateness -gui-dir=/opt/privateness/src/gui/static/ -launch-browser=true -enable-all-api-sets=true -enable-gui=true -log-level=debug" > ness-wallet
}
_buildbins() {
_binname=$1
_msg2 "building ${_binname} binary"
cd ${_cmddir}/${_binname}
go build -trimpath --ldflags '-linkmode external -extldflags "-static" -buildid=' -o $GOBIN/ .
}
#package includes the privateness gui sources
package() {
#create directory trees
_nesssrcdir=${srcdir}/${_pkgname}
_nesspath=${pkgdir}/opt/${_pkgname}
_nessgobin=${_nesspath}/bin
_nessguidir=${_nesspath}/src/gui
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${_nessgobin}
mkdir -p ${_nessguidir}
#install binaries & symlink to /usr/bin
_msg2 'installing binaries'
_nessbin="${srcdir}"/go/bin
#collect the binaries & install
_nessbins=$( ls "$_nessbin")
for i in $_nessbins; do
install -Dm755 ${srcdir}/go/bin/${i} ${_nessgobin}/${i}
ln -rTsf ${_nessgobin}/$i ${pkgdir}/usr/bin/${i}
chmod 755 ${pkgdir}/usr/bin/${i}
done
_msg2 'installing gui sources'
#install the web dir (UI)
cp -r ${_nesssrcdir}/src/gui/static ${_nessguidir}
_msg2 'correcting symlink names'
#correct symlink names
cd ${pkgdir}/usr/bin/
mv newcoin privateness-newcoin
mv skycoin-cli privateness-cli
install -Dm644 "${srcdir}"/com.privateness.Privateness.desktop ${pkgdir}/usr/share/applications/com.privateness.Privateness.desktop
install -Dm644 "${srcdir}"/privateness.png ${pkgdir}/usr/share/icons/hicolor/48x48/apps/privateness.png
#mv address_gen privateness-address-gen
mv cipher-testdata privateness-cipher-testdata
mv monitor-peers privateness-monitor-peers
_msg2 'available binaries and scripts in /usr/bin :'
ls
}
_msg2() {
(( QUIET )) && return
local mesg=$1; shift
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
}
|