From 99627e168ad38dbbe3e31cf2f60f5bf34f16d9d4 Mon Sep 17 00:00:00 2001 From: Arinerron Date: Sat, 20 Jul 2019 13:22:10 -0700 Subject: [PATCH] Add PKGBUILD --- PKGBUILD | 68 +++++++++++++++++++++++++++++++++++++++----------- onionr.install | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 onionr.install diff --git a/PKGBUILD b/PKGBUILD index a3dfd0fb..37809bb9 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,22 +1,60 @@ -url="https://onionr.net/" +# Maintainer: Kevin Froman pkgname="onionr" -pkgver=0.0.0 -pkgrel=1 -pkgdesc="P2P anonymous storage network" -arch=("x86_64") -license=('GPL') -source=("onionr-${pkgver}::git+https://gitlab.com/beardog/onionr.git#branch=master") -md5sums=('SKIP') -makedepends=('git' 'python' 'python-pip') -depends=('tor' 'python' 'python-pip') +pkgver="0.1" +pkgrel="1" +conflicts=("onionr2") +license=("GPL") +arch=("i686" "x86_64") +md5sums=("SKIP") +url="https://onionr.net/" +pkgdesc="anonymous P2P communication platform" +source=("${pkgname}-${pkgver}::git+https://gitlab.com/beardog/onionr.git#branch=master") +makedepends=("python" "python-setuptools" "python-pip") +depends=("git" "curl" "tor") + +rinstall() { + if [ -f "$1" ]; then + install -D "$1" "$2/" "$3" "$4" + return 0 + fi + + for file in $(find "$1" -type f -printf '%P\n'); do + install -D "$1/$file" "$2/$file" "$3" "$4" + done + + return 0 +} + +prepare() { + # pre_build + + cd "${srcdir}/${pkgname}-${pkgver}" + +} build() { - cd "$pkgname-${pkgver}" - cd install - ./install_arch.sh + # build + + cd "${srcdir}/${pkgname}-${pkgver}" + sh install/build.sh +} + +check() { + # post_build + + cd "${srcdir}/${pkgname}-${pkgver}" + } package() { - cd "$pkgname-${pkgver}" - # make install + # "movements" + # ensure target directories exist + mkdir -p "$pkgdir//usr/bin/" + mkdir -p "$pkgdir//etc/systemd/system/" + mkdir -p "$pkgdir//usr/share/onionr" + + # copy files over and change perms + rinstall "${srcdir}/${pkgname}-${pkgver}/install/onionr" "${pkgdir}//usr/bin/" --mode=755 --owner="root" --group="root" + rinstall "${srcdir}/${pkgname}-${pkgver}/install/onionr.service" "${pkgdir}//etc/systemd/system/" --mode=644 --owner="root" --group="root" + rinstall "${srcdir}/${pkgname}-${pkgver}/." "${pkgdir}//usr/share/onionr" --mode=755 --owner="root" --group="root" } diff --git a/onionr.install b/onionr.install new file mode 100644 index 00000000..0e3b38db --- /dev/null +++ b/onionr.install @@ -0,0 +1,48 @@ + +pre_install { + # pre_install + + cd "${srcdir}/${pkgname}-${pkgver}" + sh install/pre_install.sh + +} + +post_install { + # post_install + + cd "${srcdir}/${pkgname}-${pkgver}" + sh install/post_install.sh + +} + +pre_upgrade { + # pre_upgrade + + cd "${srcdir}/${pkgname}-${pkgver}" + + +} + +post_upgrade { + # post_upgrade + + cd "${srcdir}/${pkgname}-${pkgver}" + + +} + +pre_remove { + # pre_remove + + cd "${srcdir}/${pkgname}-${pkgver}" + + +} + +post_remove { + # post_remove + + cd "${srcdir}/${pkgname}-${pkgver}" + + +}