summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoradmin2024-02-11 12:09:52 +0000
committeradmin2024-02-11 12:09:52 +0000
commitac1fe4496947c2d494909c532a7a991e4cd74606 (patch)
treee1e414e8b5822b18a1081270e77a19b8e9a50537
downloadaur-simplytranslate-git.tar.gz
Initial upload: simplytranslate-git r53.fb21898-1
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore16
-rw-r--r--PKGBUILD77
-rw-r--r--simplytranslate.conf4
-rw-r--r--simplytranslate.service14
-rw-r--r--simplytranslate.sysusers1
6 files changed, 134 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3b33f53ac901
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = simplytranslate-git
+ pkgdesc = A privacy friendly frontend for multiple Translation Websites.
+ pkgver = r53.fb21898
+ pkgrel = 1
+ url = https://codeberg.org/ManeraKai/simplytranslate
+ arch = x86_64
+ license = GPL3
+ makedepends = go
+ makedepends = git
+ provides = simplytranslate
+ conflicts = simplytranslate
+ backup = etc/simplytranslate.conf
+ source = simplytranslate::git+https://codeberg.org/ManeraKai/simplytranslate.git
+ source = simplytranslate.service
+ source = simplytranslate.conf
+ source = simplytranslate.sysusers
+ md5sums = SKIP
+ md5sums = e34b69542d984664eca6805a2edd91ca
+ md5sums = 8e4a00c7a99ea46814ef53d1740a7546
+ md5sums = 63e31e91d5e720d740e29f88e3668185
+
+pkgname = simplytranslate-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..3609000ec6d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+simplytranslate/
+
+# ---> ArchLinuxPackages
+*.tar
+*.tar.*
+*.jar
+*.exe
+*.msi
+*.zip
+*.tgz
+*.log
+*.log.*
+*.sig
+
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..14e8dcd30f81
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,77 @@
+# Maintainer: fossdd <fossdd@pwned.life>
+pkgname=simplytranslate-git
+_pkgname="${pkgname%-git}"
+pkgver=r53.fb21898
+pkgrel=1
+pkgdesc='A privacy friendly frontend for multiple Translation Websites.'
+arch=('x86_64')
+url='https://codeberg.org/ManeraKai/simplytranslate'
+_giturl="$url.git"
+license=('GPL3')
+groups=()
+depends=()
+makedepends=('go' 'git')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+replaces=()
+backup=(etc/simplytranslate.conf)
+options=()
+install=
+source=(
+ "$_pkgname::git+$_giturl"
+ "$_pkgname.service"
+ "$_pkgname.conf"
+ "$_pkgname.sysusers"
+)
+noextract=()
+md5sums=('SKIP'
+ 'e34b69542d984664eca6805a2edd91ca'
+ '8e4a00c7a99ea46814ef53d1740a7546'
+ '63e31e91d5e720d740e29f88e3668185')
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ # Git, tags available
+ # printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
+ # Git, no tags available
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/$_pkgname/web"
+ go mod tidy
+ go mod download
+}
+
+build() {
+ cd "$srcdir/$_pkgname/web"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ go build -o $_pkgname
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+
+ # binary
+ install -Dm0755 "web/$_pkgname" -t "$pkgdir/usr/bin/"
+
+ # web frontend
+ install -vd "$pkgdir/usr/lib/$_pkgname/static"
+ install -vd "$pkgdir/usr/lib/$_pkgname/views"
+ cp -vr web/static/* "$pkgdir/usr/lib/$_pkgname/static"
+ cp -vr web/views/* "$pkgdir/usr/lib/$_pkgname/views"
+
+ # systemd integration
+ install -Dm0644 "$srcdir/$_pkgname.service" -t "$pkgdir/usr/lib/systemd/system/"
+ install -Dm6044 "$srcdir/$_pkgname.conf" -t "$pkgdir/etc/"
+ install -Dm0644 "$srcdir/$_pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
+
+ # other
+ install -Dm0644 "LICENSE" -t "$pkgdir/usr/share/licenses/$_pkgname/"
+ install -Dm0644 "README.md" -t "$pkgdir/usr/share/doc/$_pkgname/"
+}
diff --git a/simplytranslate.conf b/simplytranslate.conf
new file mode 100644
index 000000000000..435efd7433d3
--- /dev/null
+++ b/simplytranslate.conf
@@ -0,0 +1,4 @@
+ADDRESS=0.0.0.0:5000
+GOOGLETRANSLATE_ENABLE=true
+ICIBA_ENABLE=true
+REVERSO_ENABLE=true
diff --git a/simplytranslate.service b/simplytranslate.service
new file mode 100644
index 000000000000..8d9e11fd6e9c
--- /dev/null
+++ b/simplytranslate.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=A privacy friendly frontend for multiple Translation Websites
+After=network.target
+
+[Service]
+Type=simple
+User=simplytranslate
+Group=simplytranslate
+EnvironmentFile=-/etc/simplytranslate.conf
+WorkingDirectory=/usr/lib/simplytranslate
+ExecStart=/usr/bin/simplytranslate
+
+[Install]
+WantedBy=multi-user.target
diff --git a/simplytranslate.sysusers b/simplytranslate.sysusers
new file mode 100644
index 000000000000..90434cf2c7c3
--- /dev/null
+++ b/simplytranslate.sysusers
@@ -0,0 +1 @@
+u simplytranslate - "SimplyTranslate user" / /usr/bin/nologin