diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..29b1a2f --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: postgres-backup +Section: unknown +Priority: optional +Maintainer: Cadoles +Build-Depends: debhelper (>= 8.0.0), dh-systemd (>= 1.5) +Standards-Version: 3.9.4 +Homepage: http://forge.cadoles.com/Cadoles/postgres-backup +Vcs-Git: http://forge.cadoles.com/Cadoles/postgres-backup.git +Vcs-Browser: http://forge.cadoles.com/Cadoles/postgres-backup + +Package: postgres-backup +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: PostgreSQL backup scripts diff --git a/debian/postgres-backup.links b/debian/postgres-backup.links new file mode 100644 index 0000000..8d77607 --- /dev/null +++ b/debian/postgres-backup.links @@ -0,0 +1,3 @@ +/etc/postgres-backup/ /usr/share/postgres-backup/pg_backup.conf +/usr/bin/ /usr/share/postgres-backup/pg_backup.sh +/usr/bin/ /usr/share/postgres-backup/pg_backup_rotated.sh \ No newline at end of file diff --git a/debian/postgres-backup.service b/debian/postgres-backup.service new file mode 100644 index 0000000..d8e508d --- /dev/null +++ b/debian/postgres-backup.service @@ -0,0 +1,9 @@ +[Unit] +Description=Run PostgreSQL backup + +[Service] +Type=oneshot +ExecStart=/usr/bin/pg_backup_rotated.sh + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/debian/postgres-backup.timer b/debian/postgres-backup.timer new file mode 100644 index 0000000..237a6e9 --- /dev/null +++ b/debian/postgres-backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Timer for periodic execution of postgres-backup service. + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..1f09b85 --- /dev/null +++ b/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ --with systemd + +override_dh_auto_install: + mkdir -p debian/postgres-backup/usr/share/postgres-backup + mkdir -p debian/postgres-backup/etc/postgres-backup + mkdir -p debian/postgres-backup/usr/bin + + cp script/pg_backup.sh debian/postgres-backup/usr/share/postgres-backup/pg_backup.sh + cp script/pg_backup_rotated.sh debian/postgres-backup/usr/share/postgres-backup/pg_backup_rotated.sh + cp conf/pg_backup.conf debian/postgres-backup/usr/share/postgres-backup/pg_backup.conf + + chmod +x debian/postgres-backup/usr/share/postgres-backup/pg_backup_rotated.sh + chmod +x debian/postgres-backup/usr/share/postgres-backup/pg_backup.sh + + install -D -m 644 debian/postgres-backup.timer debian/postgres-backup/lib/systemd/system/postgres-backup.timer + + install -d debian/postgres-backup \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file