summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
Diffstat (limited to 'pcr')
-rw-r--r--pcr/zeronet-git/PKGBUILD31
-rw-r--r--pcr/zeronet-git/zeronet.install20
-rw-r--r--pcr/zeronet-git/zeronet.service3
3 files changed, 29 insertions, 25 deletions
diff --git a/pcr/zeronet-git/PKGBUILD b/pcr/zeronet-git/PKGBUILD
index 54f68bd89..266c5d3d7 100644
--- a/pcr/zeronet-git/PKGBUILD
+++ b/pcr/zeronet-git/PKGBUILD
@@ -1,18 +1,16 @@
# Maintainer: Luke R. <g4jc@openmailbox.org> GPG: rsa4096/3EAE8697
# Maintainer (Arch): redfish <redfish at galactica dot pw>
# Contributor: Lothar_m <lothar_m at riseup dot net>
-
+# Contributor: Freemor <freemor@freemor.ca>
+
pkgname='zeronet-git'
_gitname='ZeroNet'
_gitroot='https://github.com/HelloZeroNet/ZeroNet.git'
-pkgver=r1080
+pkgver=0.6.5.r3866.g7418400b
pkgrel=1
arch=('any')
url="https://zeronet.io/"
-depends=('python2>=2.7.10'
- 'python2-gevent'
- 'python2-msgpack'
- )
+depends=('python2' 'python2-gevent' 'python2-msgpack')
optdepends=('tor: anonymity')
makedepends=('git')
license=('GPL2')
@@ -22,32 +20,29 @@ conflicts=(zeronet)
source=("git+https://github.com/HelloZeroNet/ZeroNet.git"
"zeronet.conf"
"zeronet.service")
-sha512sums=('SKIP'
- '5366a15c596854a14b344480a7c8e2d7a62311d336f72915e04d73d40419dc0690d4451ab0a2f673fb7f60e4ce2651de469bc64bc4b35ba1855dbba9a1d24a6c'
- '8c2ff5e00e425aeb28da2b25e2ac43ebbe27aa966a983423e3ae717caecd2458473a1e993797df6f90394415afa769eadffc3dfdd76b5b486a70f3a698b7fcd5')
+
install="zeronet.install"
backup=("etc/zeronet.conf")
-options=(!strip)
-
+options=(!strip) # attempt to strip binaries fromA dependent libs fial
+sha256sums=('SKIP'
+ 'ea735e82dbb10a2c1fda7abfeb2f38c2429044d8254f9e2396c50cecb6f778f8'
+ '22dfda6233d0477a63247ae3ebb2ccd0b8a181f1628bd2969a9f979f0b9e7ca8')
pkgver() {
- cd "$_gitname"
- printf "r%s" $(git rev-list --count HEAD)
+ cd "$srcdir/$_gitname"
+
+ # Extract version and revision from src/Config.py and append commit
+ echo -n $(grep -oP '(?<=self.version = ").+(?=")' src/Config.py).r$(grep -oP '(?<=self.rev = )\w+$' src/Config.py).g$(git rev-parse --short HEAD)
}
package() {
cd "$srcdir/$_gitname"
mkdir -p "$pkgdir/opt/zeronet"
- mkdir -p "$pkgdir/var/lib/zeronet"
- mkdir -p "$pkgdir/var/log/zeronet"
# There is no setup.py shipped, so brute-force copy
cp -a "$srcdir/$_gitname/." "$pkgdir/opt/zeronet/"
install -D -m644 "$srcdir/zeronet.conf" "$pkgdir/etc/zeronet.conf"
- ## Fix TOR connection by using default ports
- echo "tor_controller = 127.0.0.1:9051" >> $pkgdir/etc/zeronet.conf
- echo "tor_proxy = 127.0.0.1:9050" >> $pkgdir/etc/zeronet.conf
install -D -m644 "$srcdir/zeronet.service" "$pkgdir/usr/lib/systemd/system/zeronet.service"
# install license
diff --git a/pcr/zeronet-git/zeronet.install b/pcr/zeronet-git/zeronet.install
index 659e8e0c6..8d94885f9 100644
--- a/pcr/zeronet-git/zeronet.install
+++ b/pcr/zeronet-git/zeronet.install
@@ -1,19 +1,25 @@
post_install() {
getent passwd zeronet &>/dev/null || {
echo -n ">>> Creating zeronet user... "
- useradd --system --user-group --home /var/lib/zeronet zeronet
+ useradd --system --user-group -m --home /var/lib/zeronet zeronet
echo "done"
} # NOTE: we do not autoremove user due to security concerns (Arch policy)
- post_upgrade
+
+ mkdir -p /var/log/zeronet
+ chown zeronet:zeronet /var/log/zeronet
+
+ # This is not usual practice but to editting from web interface
+ chown zeronet:zeronet /etc/zeronet.conf
+
# Don't run thesre operations automatically, because they are security-sensitive
echo ">>> Default mode is clearnet+Tor. Give zeronet permissions to configure hidden service:"
echo ">>> sudo usermod -a -G tor zeronet"
- echo ">>> sudo mkdir -m 750 /var/lib/tor-auth && sudo chown tor:tor /var/lib/tor-auth"
echo ">>> Add/edit the following options in /etc/tor/torrc:"
echo ">>> ControlPort 9051"
+ echo ">>> DataDirectoryGroupReadable 1"
echo ">>> CookieAuthentication 1"
echo ">>> CookieAuthFileGroupReadable 1"
- echo ">>> CookieAuthFile /var/lib/tor-auth/control_auth_cookie"
+ echo ">>> CookieAuthFile /var/lib/tor/control_auth_cookie"
echo ">>> Restart tor (reload not enough):"
echo ">>> sudo systemctl restart tor"
echo ">>> Run daemon and check status and view log:"
@@ -30,8 +36,10 @@ post_install() {
echo ">>> python2 zeronet.py --config_file /etc/zeronet.conf ..."
}
+## each separate version number must be less than 3 digit wide !
+function version { echo "$@" | gawk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
+
post_upgrade() {
chown -R zeronet:zeronet /opt/zeronet
- chown zeronet:zeronet /var/lib/zeronet
- chown zeronet:zeronet /var/log/zeronet
+ chown zeronet:zeronet /etc/zeronet.conf
}
diff --git a/pcr/zeronet-git/zeronet.service b/pcr/zeronet-git/zeronet.service
index 03556054c..e8c51642e 100644
--- a/pcr/zeronet-git/zeronet.service
+++ b/pcr/zeronet-git/zeronet.service
@@ -1,11 +1,12 @@
[Unit]
-Description=Decentralized websites using Bitcoin crypto and the BitTorrent network
+Description=ZeroNet: a decentralized web platform
[Service]
User=zeronet
Group=zeronet
WorkingDirectory=/opt/zeronet
ExecStart=/usr/bin/env python2 zeronet.py --config_file /etc/zeronet.conf
+SyslogIdentifier=zeronet
Restart=on-failure
[Install]