summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisha2022-01-18 01:04:57 -0500
committerMisha2022-01-18 01:04:57 -0500
commit2c91185425b29d037b7dbcaa6b4be5706d8b2375 (patch)
treeb768a21c94e3c3e3d47719c40e8627500dadc283
downloadaur-2c91185425b29d037b7dbcaa6b4be5706d8b2375.tar.gz
Create PKGBUILD for Algorand from RPM
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD27
-rw-r--r--algorand-bin.install30
3 files changed, 74 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c61a487ae568
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = algorand-bin
+ pkgdesc = Implementation of the Algorand protocol and node software
+ pkgver = 3.2.3
+ pkgrel = 1
+ url = https://www.algorand.com
+ install = algorand-bin.install
+ arch = x86_64
+ license = AGPL3
+ depends = systemd
+ provides = algorand
+ conflicts = algorand
+ backup = var/lib/algorand/genesis.json
+ backup = var/lib/algorand/system.json
+ source = http://algorand-dev-deb-repo.s3-website-us-east-1.amazonaws.com/releases/stable/f9e2a447d_3.2.3/algorand-3.2.3-1.x86_64.rpm
+ sha256sums = d00f8943ae30c0fe032aafe7b925529e27cfc978b1f37cb72fb6dec06da545b0
+
+pkgname = algorand-bin
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c4a8e094eeb3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,27 @@
+# Maintainer: Misha <mishakmak@gmail.com>
+
+pkgname=algorand-bin
+pkgver=3.2.3
+pkgrel=1
+pkgdesc="Implementation of the Algorand protocol and node software"
+arch=('x86_64')
+url="https://www.algorand.com"
+license=('AGPL3')
+backup=('var/lib/algorand/genesis.json' 'var/lib/algorand/system.json')
+depends=("systemd")
+provides=("algorand")
+conflicts=("algorand")
+install=algorand-bin.install
+source=("http://algorand-dev-deb-repo.s3-website-us-east-1.amazonaws.com/releases/stable/f9e2a447d_3.2.3/algorand-3.2.3-1.x86_64.rpm")
+sha256sums=('d00f8943ae30c0fe032aafe7b925529e27cfc978b1f37cb72fb6dec06da545b0')
+
+package(){
+ cd "${srcdir}"
+
+ install -Dm755 usr/bin/* -t "${pkgdir}/usr/bin/"
+
+ install -d "${pkgdir}/var/lib/algorand"
+ cp -r var/lib/algorand/ "${pkgdir}/var/lib/"
+
+ install -Dm644 lib/systemd/system/* -t "${pkgdir}/usr/lib/systemd/system/"
+}
diff --git a/algorand-bin.install b/algorand-bin.install
new file mode 100644
index 000000000000..bd89062b15d4
--- /dev/null
+++ b/algorand-bin.install
@@ -0,0 +1,30 @@
+post_install() {
+ getent passwd algorand >/dev/null || useradd --system --user-group \
+ --home-dir /var/lib/algorand --no-create-home algorand >/dev/null
+ chown -R algorand:algorand /var/lib/algorand
+ printf "%b\n" "$instdoc"
+}
+
+read -d '' instdoc <<'EOF'
+##############################################################
+##############################################################
+## ~~~~~~~~~~~~ ##
+## Algorand ##
+## ~~~~~~~~~~~~~~ ##
+## To start the node, run: ##
+## # systemctl start algorand.service ##
+## Or to also enable at startup: ##
+## # systemctl enable --now algorand.service ##
+## ----------------------------------------------- ##
+## Configure ALGORAND_DATA environment variable: ##
+## $ export ALGORAND_DATA=/var/lib/algorand ##
+## Check running node status: ##
+## $ goal node status ##
+## ----------------------------------------------- ##
+## Config/Files: /var/lib/algorand ##
+## Documentation: https://developer.algorand.org/ ##
+## Source Code: https://github.com/algorand/go-algorand ##
+## ##
+##############################################################
+##############################################################
+EOF