summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-04-15 17:31:16 +0200
committerAki <please@ignore.pl>2023-04-15 17:31:16 +0200
commit7c308f9f06397bc21b2e5536d94606651fe3a6d4 (patch)
tree604c48399db94d321c5d2bbd4cebbf0c2e3d6e10
parent1d83746618b4f5f396c122a23f4d64ffe56f4110 (diff)
downloadmirror-7c308f9f06397bc21b2e5536d94606651fe3a6d4.zip
mirror-7c308f9f06397bc21b2e5536d94606651fe3a6d4.tar.gz
mirror-7c308f9f06397bc21b2e5536d94606651fe3a6d4.tar.bz2
Added supporting systemd configuration files
-rw-r--r--Makefile13
-rw-r--r--mirror.conf1
-rw-r--r--mirror.service9
-rw-r--r--mirror.timer9
4 files changed, 31 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 295812f..04b2a30 100644
--- a/Makefile
+++ b/Makefile
@@ -2,20 +2,31 @@ PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
DATADIR?=$(PREFIX)/share
MANDIR?=$(DATADIR)/man/man1
+LIBDIR?=$(PREFIX)/lib
+SYSDDIR?=$(LIBDIR)/systemd/system
+USERSDIR?=$(LIBDIR)/sysusers.d
all: mirror
clean:
rm -f mirror
-install:
+install: all
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)
+ mkdir -p $(DESTDIR)$(SYSDDIR)
+ mkdir -p $(DESTDIR)$(USERSDIR)
cp -f mirror $(DESTDIR)$(BINDIR)/mirror
cp -f mirror.1 $(DESTDIR)$(MANDIR)/mirror.1
+ cp -f mirror.timer $(DESTDIR)$(SYSDDIR)/mirror.timer
+ cp -f mirror.service $(DESTDIR)$(SYSDDIR)/mirror.service
+ cp -f mirror.conf $(DESTDIR)$(USERSDIR)/mirror.conf
uninstall:
rm -f $(DESTDIR)$(BINDIR)/mirror
rm -f $(DESTDIR)$(MANDIR)/mirror.1
+ rm -f $(DESTDIR)$(SYSDDIR)/mirror.timer
+ rm -f $(DESTDIR)$(SYSDDIR)/mirror.service
+ rm -f $(DESTDIR)$(USERSDIR)/mirror.conf
.PHONY: all clean install uninstall
diff --git a/mirror.conf b/mirror.conf
new file mode 100644
index 0000000..acb0464
--- /dev/null
+++ b/mirror.conf
@@ -0,0 +1 @@
+u mirror - "User for mirroring git repositories in bulk"
diff --git a/mirror.service b/mirror.service
new file mode 100644
index 0000000..a475df7
--- /dev/null
+++ b/mirror.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Mirrors git repositories in bulk
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env mirror
+WorkingDirectory=/srv/mirror
+User=mirror
+Group=mirror
diff --git a/mirror.timer b/mirror.timer
new file mode 100644
index 0000000..45bc9ab
--- /dev/null
+++ b/mirror.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Mirrors git repositories in bulk
+
+[Timer]
+OnCalendar=daily
+Persistent=true
+
+[Install]
+WantedBy=timers.target