summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD55
-rw-r--r--fatd.install8
3 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d9d48bd065d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = fatd
+ pkgdesc = Factom Asset Tokens Daemon
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/Factom-Asset-Tokens/fatd
+ install = fatd.install
+ arch = x86_64
+ license = MIT
+ makedepends = go-pie
+ makedepends = git
+ depends = glibc
+ optdepends = factomd
+ options = emptydirs
+ source = git+https://github.com/Factom-Asset-Tokens/fatd#tag=v1.0.0
+ md5sums = SKIP
+
+pkgname = fatd
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..bbd0afc61f1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Adam Levy <adam@canonical-ledgers.com>
+pkgname=fatd
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Factom Asset Tokens Daemon"
+url="https://github.com/Factom-Asset-Tokens/fatd"
+license=(MIT)
+
+options=(emptydirs)
+
+install=fatd.install
+
+arch=('x86_64')
+depends=("glibc")
+optdepends=("factomd")
+makedepends=("go-pie" "git")
+source=("git+https://github.com/Factom-Asset-Tokens/fatd#tag=v${pkgver}")
+md5sum=('skip')
+
+prepare() {
+ # Generate completion files. Each cmd is its own completion program.
+ cd "$srcdir"
+ mkdir -p completions
+ rm -f completions/fatd
+ for cmd in fatd fat-cli; do
+ echo "complete -C /usr/bin/$cmd $cmd" >> completions/fatd
+ done
+}
+
+build() {
+ export LDFLAGS
+ export CGO_LDFLAGS=$LDFLAGS
+ cd "$srcdir/fatd"
+ make
+}
+
+package() {
+ install -Dm644 "$srcdir/completions/fatd" \
+ "$pkgdir/usr/share/bash-completion/completions/fatd"
+
+ cd "$srcdir/fatd"
+
+ bin_dir="$pkgdir/usr/bin"
+ install -dm755 "$bin_dir"
+ install -m755 fatd fat-cli "$bin_dir"
+
+ install -dm755 "$pkgdir/var/lib/fatd"
+
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/fatd/LICENSE"
+
+ install -Dm644 fatd@.service "$pkgdir/usr/lib/systemd/system/fatd@.service"
+ install -Dm644 sysusers-fatd.conf "$pkgdir/usr/lib/sysusers.d/fatd.conf"
+
+}
+md5sums=('SKIP')
diff --git a/fatd.install b/fatd.install
new file mode 100644
index 00000000000..6fd9b9fc851
--- /dev/null
+++ b/fatd.install
@@ -0,0 +1,8 @@
+post_install() {
+ post_upgrade
+}
+
+post_upgrade() {
+ systemd-sysusers
+ chown fatd:fatd -R /var/lib/fatd
+}