diff options
author | M0Rf30 | 2015-06-17 16:02:22 +0200 |
---|---|---|
committer | M0Rf30 | 2015-06-17 16:02:22 +0200 |
commit | a89ef894ab9d522936dde06a94abf34db699e7b1 (patch) | |
tree | 83d9116b6df1888e59f1ab3e2a9dd90177d466c1 | |
download | aur-a89ef894ab9d522936dde06a94abf34db699e7b1.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 43 | ||||
-rw-r--r-- | PKGBUILD | 86 | ||||
-rw-r--r-- | openbazaar.conf | 9 | ||||
-rw-r--r-- | openbazaar.install | 48 | ||||
-rw-r--r-- | openbazaar.service | 12 | ||||
-rwxr-xr-x | openbazaar.sh | 5 |
6 files changed, 203 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b80504b85bbe --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,43 @@ +pkgbase = openbazaar-git + pkgdesc = A decentralized marketplace proof of concept. It is based off of the POC code by the darkmarket team and protected by the GPL + pkgver = 4054.05a993d + pkgrel = 1 + url = http://openbazaar.org + install = openbazaar.install + arch = any + license = MIT + makedepends = git + depends = curl + depends = jquery + depends = python2-bitcoin + depends = python2-dnschain + depends = python2-gnupg-hg + depends = python2-ipy + depends = python2-miniupnpc + depends = python2-obelisk + depends = python2-pillow + depends = python2-psutil + depends = python2-pycountry + depends = python2-pyee + depends = python2-pyelliptic + depends = python2-pystun + depends = python2-qrcode + depends = python2-requests + depends = python2-rfc3986 + depends = python2-tornado + optdepends = pybitmessage-git: Send and receive messages to anyone on the bitmessage network + provides = openbazaar + replaces = openbazaar + options = !strip + backup = etc/openbazaar.conf + source = openbazaar::git+https://github.com/OpenBazaar/OpenBazaar.git#branch=develop + source = openbazaar.service + source = openbazaar.sh + source = openbazaar.conf + md5sums = SKIP + md5sums = 1d1e3933c4fd26f565e47f475eede2b4 + md5sums = 87ad334f35bce82931151fa94c06bab1 + md5sums = 0741fc4c68e499b10cbf272f27efd3a0 + +pkgname = openbazaar-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..96df71b661d0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,86 @@ +#Maintainer: M0Rf30 + +_pkgname=openbazaar +pkgname=${_pkgname}-git +pkgver=4054.05a993d +pkgrel=1 +pkgdesc="A decentralized marketplace proof of concept. It is based off of the POC code by the darkmarket team and protected by the GPL" +arch=(any) +url="http://openbazaar.org" +license=('MIT') +depends=( + curl + #gnupg1 + jquery + python2-bitcoin + python2-dnschain + python2-gnupg-hg + python2-ipy + python2-miniupnpc + python2-obelisk + python2-pillow + python2-psutil + python2-pycountry + python2-pyee + python2-pyelliptic + python2-pystun + python2-qrcode + python2-requests + python2-rfc3986 + python2-tornado +) + +makedepends=(git) +optdepends=('pybitmessage-git: Send and receive messages to anyone on the bitmessage network') +source=("${_pkgname}::git+https://github.com/OpenBazaar/OpenBazaar.git#branch=develop" + ${_pkgname}.service + ${_pkgname}.sh + ${_pkgname}.conf +# gnupg1.patch +) +backup=('etc/openbazaar.conf') +install=${_pkgname}.install +options=('!strip') +provides=(${_pkgname}) +replaces=(${_pkgname}) + +package(){ + cd $srcdir/${_pkgname} + + # msg2 "Patch against Gnupg2" + # patch -Np1 -i ../gnupg1.patch + + msg2 "Install systemd service" + install -Dm644 $srcdir/${_pkgname}.service $pkgdir/usr/lib/systemd/system/${_pkgname}.service + + msg2 "Install ${_pkgname} sample conf in /etc/${_pkgname}.conf" + install -Dm644 $srcdir/${_pkgname}.conf $pkgdir/etc/${_pkgname}.conf + + msg2 "Install ${_pkgname} scripts" + install -Dm755 $srcdir/${_pkgname}.sh $pkgdir/usr/bin/${_pkgname} + + msg2 "Create folder for user ${_pkgname}" + cd installers/ubuntu + cat build | head -n -2 > create_folders + python2 create_folders + install -dm755 $pkgdir/var/lib/ + + cp -r output/usr/share/${_pkgname} $pkgdir/var/lib/ + cp -r $srcdir/${_pkgname}/rudp $pkgdir/var/lib/${_pkgname} + + msg2 "Jquery symlink" + ln -s -r /usr/share/jquery/jquery.min.js $pkgdir/var/lib/${_pkgname}/html/vendors + + msg2 "Python2 bytecode generation" + cd $pkgdir/var/lib/${_pkgname}/ && python2 -m compileall . +} + +pkgver() { + cd ${_pkgname} + echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) +} + +md5sums=('SKIP' + '1d1e3933c4fd26f565e47f475eede2b4' + '87ad334f35bce82931151fa94c06bab1' + '0741fc4c68e499b10cbf272f27efd3a0') diff --git a/openbazaar.conf b/openbazaar.conf new file mode 100644 index 000000000000..c2ba5e468f61 --- /dev/null +++ b/openbazaar.conf @@ -0,0 +1,9 @@ +# openbazaar sample configuration file. +# you can specify all arguments in a single line +# or if you prefer you can put arguments line by line +# so you can easily comment them out +--disable-open-browser +-q 8888 +-p 12345 +--enable-ip-checker +--db-path obdata/ob.db diff --git a/openbazaar.install b/openbazaar.install new file mode 100644 index 000000000000..191529222ec2 --- /dev/null +++ b/openbazaar.install @@ -0,0 +1,48 @@ +usr=openbazaar +home=/var/lib/openbazaar +log=/var/lib/openbazaar/logs +dbdata=obdata + +post_install() { + _mkuser + _mkdbfolder + _chown +} + +post_upgrade() { + _mkuser + _chown +} + +## arg 1: the old package version +post_remove() { + #_rmuser + echo "Please remove $home and user $usr manually" + echo "WARNING!!!" + echo "Be sure to save your db and gpg backup" +} + +_chown() { + chown -R $usr:$usr $home $log $home/$dbdata +} + +_mkuser() { + getent passwd $usr &>/dev/null || { + echo -n "Creating openbazaar user... " + grep -E "^openbazaar:" /etc/group >/dev/null || groupadd $usr + useradd -m -d $home -g $usr -s /usr/bin/nologin $usr 2>/dev/null + echo "done" + } +} + +_rmuser() { + echo -n "Removing openbazaar user... " + userdel -rf $usr 2>/dev/null + echo "done" +} + +_mkdbfolder() { + echo -n "Creating database folder... " + mkdir -p $home/$dbdata + echo "done" +} diff --git a/openbazaar.service b/openbazaar.service new file mode 100644 index 000000000000..bc6db875f358 --- /dev/null +++ b/openbazaar.service @@ -0,0 +1,12 @@ +[Unit] +Description=Openbazaar Marketplace + +[Service] +Type=forking +User=openbazaar +WorkingDirectory=/var/lib/openbazaar/ +ExecStart=/usr/bin/openbazaar start +ExecStop=/usr/bin/openbazaar stop + +[Install] +WantedBy=multi-user.target diff --git a/openbazaar.sh b/openbazaar.sh new file mode 100755 index 000000000000..4507855f6723 --- /dev/null +++ b/openbazaar.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd /var/lib/openbazaar/ +COMMANDS="--config-file /etc/openbazaar.conf" +export PYTHONPATH=/var/lib/openbazaar:/usr/lib/python2.7/site-packages/ +python2 -m node.openbazaar $COMMANDS "$@" & |