summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD83
-rw-r--r--zeronet.conf3
-rw-r--r--zeronet.install20
-rw-r--r--zeronet.service12
5 files changed, 91 insertions, 43 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4defb3b67a3..007170215bc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,10 +1,12 @@
+# Generated by mksrcinfo v8
+# Thu Mar 3 19:49:39 UTC 2016
pkgbase = zeronet-git
pkgdesc = Decentralized websites using Bitcoin crypto and the BitTorrent network.
- pkgver = 1
+ pkgver = 0.3.5.r26.g5b821c4
pkgrel = 1
- url = https://github.com/HelloZeroNet/ZeroNet
- arch = i686
- arch = x86_64
+ url = https://zeronet.io/
+ install = zeronet.install
+ arch = any
license = GPL2
makedepends = git
depends = python2>=2.7.10
@@ -12,8 +14,14 @@ pkgbase = zeronet-git
depends = python2-msgpack
provides = zeronet
conflicts = zeronet
+ options = !strip
+ backup = etc/zeronet.conf
source = git://github.com/HelloZeroNet/ZeroNet.git
+ source = zeronet.conf
+ source = zeronet.service
md5sums = SKIP
+ md5sums = 1c2281156533c912e407cf64f6a57e96
+ md5sums = 35a1d8325701eb000a4c3a28b7499096
pkgname = zeronet-git
diff --git a/PKGBUILD b/PKGBUILD
index e16e0dab5e4..eb7ec2bfb0c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,61 +1,66 @@
-#Maintainer: Lothar_m <lothar_m at riseup dot net>
+# Maintainer: redfish <redfish at galactica dot pw>
+# Contributor: Lothar_m <lothar_m at riseup dot net>
pkgname='zeronet-git'
_gitname='ZeroNet'
_gitroot='https://github.com/HelloZeroNet/ZeroNet.git'
+pkgver=0.3.5.r26.g5b821c4
pkgrel=1
-arch=('i686' 'x86_64')
-url="https://github.com/HelloZeroNet/ZeroNet"
+arch=('any')
+url="https://zeronet.io/"
depends=('python2>=2.7.10'
- 'python2-gevent'
- 'python2-msgpack'
- )
-# optdepends=(': ')
+ 'python2-gevent'
+ 'python2-msgpack'
+ )
makedepends=('git')
license=('GPL2')
pkgdesc="Decentralized websites using Bitcoin crypto and the BitTorrent network."
provides=(zeronet)
conflicts=(zeronet)
-source=("git://github.com/HelloZeroNet/ZeroNet.git")
-md5sums=('SKIP')
+source=("git://github.com/HelloZeroNet/ZeroNet.git"
+ "zeronet.conf"
+ "zeronet.service")
+md5sums=('SKIP'
+ '1c2281156533c912e407cf64f6a57e96'
+ '35a1d8325701eb000a4c3a28b7499096')
+install="zeronet.install"
+backup=("etc/zeronet.conf")
+options=(!strip) # attempt to strip binaries fromA dependent libs fial
pkgver() {
cd "$srcdir/$_gitname"
- # Use the tag of the last commit
- git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+
+ # Most recent unannotated tag reachable from last commit without 'v' prefix
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
- cd ${srcdir}
- msg "Connecting to GIT server...."
-
- if [ -d "$_gitname" ] ; then
- cd "$_gitname" && git pull origin master
- msg "The local files are updated."
- else
- git clone ${_gitroot}
- fi
- msg "GIT checkout done or server timeout"
-
- # cd "${_gitname}"
-# cd "$srcdir/$_gitname"
-
-# run setup.py
-# cd "$srcdir/$_gitname"
-# python2 setup.py build
+ cd ${srcdir}
+ msg "Connecting to GIT server...."
+
+ if [ -d "$_gitname" ] ; then
+ cd "$_gitname" && git pull origin master
+ msg "The local files are updated."
+ else
+ git clone ${_gitroot}
+ fi
+ msg "GIT checkout done or server timeout"
}
package() {
-# install python scripts
cd "$srcdir/$_gitname"
- install -D -d "$srcdir/$_gitname/src" "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/src"
- install -D -d "$srcdir/$_gitname/tools" "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/tools"
- install -D -d "$srcdir/$_gitname/plugins" "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/plugins"
- install -D "$srcdir/$_gitname/start.py" "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/start.py"
- install -D "$srcdir/$_gitname/zeronet.py" "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/zeronet.py"
- ln -s "/usr/lib/python2.7/site-packages/$_gitname/zeronet.py" "/usr/bin/zeronet.py"
-
-# install license
- install -D -m644 "$srcdir/$_gitname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
+ mkdir -p "$pkgdir/opt/zeronet"
+
+ # zeronet.py expects log directory to exist
+ mkdir -p "$pkgdir/opt/zeronet/log"
+
+ # 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"
+ install -D -m644 "$srcdir/zeronet.service" "$pkgdir/usr/lib/systemd/system/zeronet.service"
+
+ # install license
+ install -D -m644 "$srcdir/$_gitname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+} \ No newline at end of file
diff --git a/zeronet.conf b/zeronet.conf
new file mode 100644
index 00000000000..1eacf720632
--- /dev/null
+++ b/zeronet.conf
@@ -0,0 +1,3 @@
+[global]
+# ui_ip = *
+# ui_password = anypassword
diff --git a/zeronet.install b/zeronet.install
new file mode 100644
index 00000000000..891781a887d
--- /dev/null
+++ b/zeronet.install
@@ -0,0 +1,20 @@
+post_install() {
+ getent passwd zeronet &>/dev/null || {
+ echo -n ">>> Creating zeronet user... "
+ useradd --system --user-group --home /opt/zeronet zeronet
+ echo "done"
+ }
+ post_upgrade
+}
+
+post_upgrade() {
+ chown -R zeronet:zeronet /opt/zeronet
+}
+
+pre_remove() {
+ getent passwd zeronet &>/dev/null && {
+ echo -n ">>> Removing zeronet user... "
+ userdel zeronet
+ echo "done"
+ }
+}
diff --git a/zeronet.service b/zeronet.service
new file mode 100644
index 00000000000..82afee10ea7
--- /dev/null
+++ b/zeronet.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=ZeroNet: a decentralized web platform
+
+[Service]
+User=zeronet
+Group=zeronet
+WorkingDirectory=~
+ExecStart=/usr/bin/env python2 zeronet.py --config_file /etc/zeronet.conf
+Restart=on-failure
+
+[Install]
+WantedBy=default.target