summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Monfils2019-07-08 15:56:03 +0200
committerNathan Monfils2019-07-08 16:05:03 +0200
commit5b8f79bc58cb5a012914bcc74d15b7ff6b9aff01 (patch)
treef0735fed33cfc9db61d480a5e8d114fd89054d2e
downloadaur-5b8f79bc58cb5a012914bcc74d15b7ff6b9aff01.tar.gz
First commit
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD46
-rw-r--r--spotify-backup.service9
-rw-r--r--spotify-backup.timer10
4 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cf576996a12a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = spotify-backup-git
+ pkgver = r5.8747342
+ pkgrel = 1
+ url = https://gitlab.com/azertyfun/spotify-backup
+ arch = any
+ license = MIT
+ makedepends = git
+ provides = spotify-backup-git
+ conflicts = spotify-backup-git
+ source = spotify-backup.service
+ source = spotify-backup.timer
+ source = spotify-backup-git::git+https://gitlab.com/azertyfun/spotify-backup.git
+ md5sums = 84360915f38c39a8840bd1618c59611d
+ md5sums = dd19bf59a9058e16f7a724ca03f0c39f
+ md5sums = SKIP
+
+pkgname = spotify-backup-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..08dcd011043d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Nathan Monfils <nathan.monfils@hotmail.fr>
+pkgname=spotify-backup-git
+pkgver=r5.8747342
+pkgrel=1
+pkgdesc=""
+arch=(any)
+url="https://gitlab.com/azertyfun/spotify-backup"
+license=('MIT')
+groups=()
+depends=()
+makedepends=('git')
+provides=("${pkgname%-VCS}")
+conflicts=("${pkgname%-VCS}")
+replaces=()
+backup=()
+options=()
+install=
+source=("spotify-backup.service"
+ "spotify-backup.timer"
+ "${pkgname}::git+https://gitlab.com/azertyfun/spotify-backup.git")
+noextract=()
+md5sums=('84360915f38c39a8840bd1618c59611d'
+ 'dd19bf59a9058e16f7a724ca03f0c39f'
+ 'SKIP')
+
+pkgver() {
+ cd "$srcdir/${pkgname%-VCS}"
+
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "$srcdir/${pkgname%-VCS}"
+ python setup.py build
+}
+
+package() {
+ cd "$srcdir/${pkgname%-VCS}"
+ python setup.py install --skip-build -O1 --root="$pkgdir"
+
+ mkdir -p "$pkgdir"/var/lib/spotify-backup
+ touch "$pkgdir"/var/lib/spotify-backup/spotify-backup.conf
+
+ mkdir -p "$pkgdir"/usr/lib/systemd/system
+ cp ../spotify-backup.{service,timer} "$pkgdir"/usr/lib/systemd/system/
+}
diff --git a/spotify-backup.service b/spotify-backup.service
new file mode 100644
index 000000000000..84c211f4659a
--- /dev/null
+++ b/spotify-backup.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Backups spotify songs in JSON format
+
+[Service]
+Type=oneshot
+ExecStart=bash -c '/usr/bin/spotify-backup -c /var/lib/spotify-backup/spotify-backup.conf "/var/lib/spotify-backup/$$(date -Iseconds).json"'
+
+[Install]
+Wanted-By=multi-user.target
diff --git a/spotify-backup.timer b/spotify-backup.timer
new file mode 100644
index 000000000000..e8aff444eb85
--- /dev/null
+++ b/spotify-backup.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Backup spotify songs daily
+
+[Timer]
+OnCalendar=daily
+Persistent=true
+
+[Install]
+WantedBy=timers.target
+