summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKafin2020-03-19 22:48:28 +0100
committerKafin2020-03-19 22:48:28 +0100
commitf04258edee2bdabc65d93f2d7bdf66d6f7d58bce (patch)
treea0214996588e222429ac3a1fd7a1f0b43be4d70e
downloadaur-f04258edee2bdabc65d93f2d7bdf66d6f7d58bce.tar.gz
Initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD37
-rw-r--r--prometheus-transmission-exporter.default14
-rw-r--r--prometheus-transmission-exporter.service11
5 files changed, 87 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..478ab8c5eef4
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = prometheus-transmission-exporter
+ pkgdesc = Prometheus exporter for transmission daemon
+ pkgver = 0.3.0
+ pkgrel = 1
+ url = https://github.com/metalmatze/transmission-exporter
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ source = https://github.com/metalmatze/transmission-exporter/archive/0.3.0.tar.gz
+ source = prometheus-transmission-exporter.service
+ source = prometheus-transmission-exporter.default
+ sha256sums = 1c5db560bfa8c181d96e3beafa4347be4384945fcc5eb446bd0149bbe5a8cb13
+ sha256sums = 39a46c0e07065892e0d31e1ad38fb70e26ee2b693da0fc2d88d944f3958d6496
+ sha256sums = f2bfede724cee3fb0893f67bd601c3f59c3522c6b92bddf671dc5b3daad6fa54
+
+pkgname = prometheus-transmission-exporter
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..54e86db4fdfe
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!PKGBUILD
+!.SRCINFO
+!.gitignore
+!prometheus-transmission-exporter.default
+!prometheus-transmission-exporter.service \ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..40b07448b37f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Kévin Hautemanière <kh12e@pm.me>
+pkgname=prometheus-transmission-exporter
+pkgver=0.3.0
+pkgrel=1
+pkgdesc="Prometheus exporter for transmission daemon"
+arch=('x86_64')
+url="https://github.com/metalmatze/transmission-exporter"
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+source=("https://github.com/metalmatze/transmission-exporter/archive/${pkgver}.tar.gz"
+ "prometheus-transmission-exporter.service"
+ "prometheus-transmission-exporter.default")
+sha256sums=('1c5db560bfa8c181d96e3beafa4347be4384945fcc5eb446bd0149bbe5a8cb13'
+ '39a46c0e07065892e0d31e1ad38fb70e26ee2b693da0fc2d88d944f3958d6496'
+ 'f2bfede724cee3fb0893f67bd601c3f59c3522c6b92bddf671dc5b3daad6fa54')
+
+prepare() {
+ cd "${srcdir}/transmission-exporter-${pkgver}"
+ export GOPATH="${srcdir}/gopath"
+ export GOBIN="${GOPATH}/bin"
+ mkdir -p "${GOPATH}/src/github.com/metalmatze"
+ ln -snf "${srcdir}/transmission-exporter-${pkgver}" "${GOPATH}/src/github.com/metalmatze/transmission-exporter"
+}
+
+build() {
+ export GOPATH="${srcdir}/gopath"
+ cd "${GOPATH}/src/github.com/metalmatze/transmission-exporter"
+ go build ./cmd/transmission-exporter
+}
+
+package() {
+ install -Dm640 "prometheus-transmission-exporter.default" "${pkgdir}/etc/default/prometheus-transmission-exporter"
+ install -Dm644 "prometheus-transmission-exporter.service" "${pkgdir}/usr/lib/systemd/system/prometheus-transmission-exporter.service"
+ cd transmission-exporter-${pkgver}
+ install -Dm755 "transmission-exporter" "${pkgdir}/usr/bin/prometheus-transmission-exporter"
+}
diff --git a/prometheus-transmission-exporter.default b/prometheus-transmission-exporter.default
new file mode 100644
index 000000000000..9a630ffa1b99
--- /dev/null
+++ b/prometheus-transmission-exporter.default
@@ -0,0 +1,14 @@
+# Path for metrics, default: /metrics
+# WEB_PATH=
+
+# Address for this exporter to run, default: :19091
+# WEB_ADDR=
+
+# Transmission address to connect with, default: http://localhost:9091
+# TRANSMISSION_ADDR=
+
+# Transmission username, no default
+# TRANSMISSION_USERNAME=
+
+# Transmission password, no default
+# TRANSMISSION_PASSWORD = \ No newline at end of file
diff --git a/prometheus-transmission-exporter.service b/prometheus-transmission-exporter.service
new file mode 100644
index 000000000000..6887c0a18701
--- /dev/null
+++ b/prometheus-transmission-exporter.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Prometheus exporter for transmission daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/prometheus-transmission-exporter
+EnvironmentFile=/etc/default/prometheus-transmission-exporter
+User=nobody
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file