summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-05-05 21:39:31 +0300
committerCaleb Maclennan2021-05-05 21:39:31 +0300
commitc7760019a8b4379e62930eaa53a1bb34e8bd5353 (patch)
treef46cb52ccace63442fed20e7aa440512f9a5ea0b
downloadaur-c7760019a8b4379e62930eaa53a1bb34e8bd5353.tar.gz
Initial upload: listmonk-git 0.9.0.beta.r78.g68b80d0-1
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD72
-rw-r--r--listmonk.conf1
-rw-r--r--listmonk.install30
-rw-r--r--listmonk.service16
5 files changed, 145 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d0beb9717a4b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = listmonk-git
+ pkgdesc = Self-hosted newsletter and mailing list manager with a modern dashboard
+ pkgver = 0.9.0.beta.r78.g68b80d0
+ pkgrel = 1
+ url = https://listmonk.app
+ install = listmonk.install
+ arch = x86_64
+ license = AGPL3
+ makedepends = git
+ makedepends = go
+ makedepends = node-gyp
+ makedepends = nodejs-lts-fermium
+ makedepends = yarn
+ depends = postgresql
+ provides = listmonk
+ conflicts = listmonk
+ backup = etc/listmonk/config.toml
+ source = listmonk-git::git+https://github.com/knadh/listmonk.git
+ source = listmonk.conf
+ source = listmonk.service
+ sha256sums = SKIP
+ sha256sums = 5cfc186438df2408ed88a5bec3a9a4b5f2afb0d3aec41c4cc63b2f5eb810b3cb
+ sha256sums = 809ede70c932183889b2fa567b340fb82cce1ada76c7b0a0b9efb82b87c92fa0
+
+pkgname = listmonk-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1f4feb3a8db1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
+
+pkgname=listmonk-git
+_pkgname=${pkgname%-git}
+pkgver=0.9.0.beta.r78.g68b80d0
+pkgrel=1
+pkgdesc='Self-hosted newsletter and mailing list manager with a modern dashboard'
+arch=(x86_64)
+url=https://listmonk.app
+license=(AGPL3)
+depends=(postgresql)
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+makedepends=(git go node-gyp nodejs-lts-fermium yarn)
+backup=(etc/listmonk/config.toml)
+install=$_pkgname.install
+source=("$pkgname::git+https://github.com/knadh/$_pkgname.git"
+ "$_pkgname.conf"
+ "$_pkgname.service")
+sha256sums=('SKIP'
+ '5cfc186438df2408ed88a5bec3a9a4b5f2afb0d3aec41c4cc63b2f5eb810b3cb'
+ '809ede70c932183889b2fa567b340fb82cce1ada76c7b0a0b9efb82b87c92fa0')
+
+pkgver() {
+ cd "$pkgname"
+ git describe --long --abbrev=7 --tags --match="v*" |
+ sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$pkgname/frontend"
+ export YARN_CACHE_FOLDER="$srcdir/node_modules"
+ yarn install --frozen-lockfile
+}
+
+build() {
+ cd "$pkgname"
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-extldflags '$LDFLAGS' -X 'main.buildString=Arch Linux AUR v$pkgver $pkgrel' -X 'main.versionString=v$pkgver-beta'" \
+ -o $_pkgname \
+ cmd/*.go
+ export YARN_CACHE_FOLDER="$srcdir/node_modules"
+ export VUE_APP_VERSION="v$pkgver-beta"
+ pushd frontend
+ yarn build
+}
+
+check() {
+ cd "$pkgname"
+ go test ./...
+}
+
+package() {
+ cd "$pkgname"
+ install -Dm755 -t "$pkgdir/usr/bin" $_pkgname
+ install -Dm644 "config.toml.sample" "$pkgdir/etc/$pkgname/config.toml"
+ install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" "../$_pkgname.service"
+ install -Dm644 -t "$pkgdir/usr/lib/sysusers.d/" "../$_pkgname.conf"
+ install -Dm644 -t "$pkgdir/usr/share/$_pkgname/" \
+ config.toml.sample \
+ schema.sql \
+ queries.sql
+ install -Dm644 -t "$pkgdir/usr/share/$_pkgname/frontend/dist/" \
+ frontend/dist/favicon.png
+ cp -a frontend/dist/frontend "$pkgdir/usr/share/$_pkgname/frontend/dist/"
+ cp -a static "$pkgdir/usr/share/$_pkgname/"
+ cp -a i18n "$pkgdir/usr/share/$_pkgname/"
+}
diff --git a/listmonk.conf b/listmonk.conf
new file mode 100644
index 000000000000..b7e2c672488c
--- /dev/null
+++ b/listmonk.conf
@@ -0,0 +1 @@
+u listmonk - "Listmonk mailing list and newsletter manager"
diff --git a/listmonk.install b/listmonk.install
new file mode 100644
index 000000000000..48743d4388a1
--- /dev/null
+++ b/listmonk.install
@@ -0,0 +1,30 @@
+post_install() {
+ cat <<- EOF
+ Installed with default password. To generate a new random one:
+
+ \$ cd /tmp
+ \$ listmonk --new-config
+ \$ sudo mv config.toml /etc/listmonk/
+
+ Setup credentials and a database (substiting your own password!):
+
+ \$ sudo -u postgres psql
+ postgres=# CREATE USER listmonk WITH PASSWORD 'password';
+ postgres=# CREATE DATABASE listmonk;
+ postgres=# GRANT ALL PRIVILEGES ON DATABASE listmonk TO listmonk;
+
+ Edit with PostgreSQL database credentials, then to setup database, run:
+
+ \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --static-dir /usr/share/listmonk --install
+ EOF
+}
+
+post_upgrade() {
+ cat <<- EOF
+ To update database, run
+
+ \$ sudo -u listmonk listmonk --config /etc/listmonk/config.toml --static-dir /usr/share/listmonk --upgrade
+ EOF
+}
+
+# vim: : ts=4 sw=4 noet
diff --git a/listmonk.service b/listmonk.service
new file mode 100644
index 000000000000..ccc8fd41ebdf
--- /dev/null
+++ b/listmonk.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Listmonk mailing list and newsletter manager
+Wants=network.target
+
+[Service]
+Type=simple
+WorkingDirectory=/usr/share/listmonk
+ExecStart=/usr/bin/listmonk --config /etc/listmonk/config.toml
+User=listmonk
+Group=listmonk
+Restart=on-failure
+LimitNOFILE=65536
+TasksMax=infinity
+
+[Install]
+WantedBy=multi-user.target