From d658010ae899ef7a4110dbd38720adae290dc60b Mon Sep 17 00:00:00 2001 From: zankia Date: Mon, 19 Feb 2024 00:02:15 +0100 Subject: [PATCH] feat: debian package --- .gitignore | 7 +++++-- Makefile | 17 +++++++++++++++++ autobackup/DEBIAN/control | 6 ++++++ .../etc/autobackup/backup.list | 0 .../etc/autobackup/config.properties | 0 autobackup/etc/cron.d/autobackup | 2 ++ autoBackup => autobackup/usr/bin/autobackup | 0 7 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 autobackup/DEBIAN/control rename backup.list.default => autobackup/etc/autobackup/backup.list (100%) rename config.properties.default => autobackup/etc/autobackup/config.properties (100%) create mode 100644 autobackup/etc/cron.d/autobackup rename autoBackup => autobackup/usr/bin/autobackup (100%) diff --git a/.gitignore b/.gitignore index c2e67cc..6b7c6a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *.swp +.env test -backup.list -config.properties +/backup.list +/config.properties + +*.deb diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..39c18ae --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +ifneq (,$(wildcard ./.env)) + include .env + export +endif + +PACKAGE_NAME := autobackup + +build: + dpkg -b $(PACKAGE_NAME) + +release: build + curl -u zankia:$(GITEA_TOKEN) --upload-file $(PACKAGE_NAME).deb https://git.zankia.fr/api/packages/zankia/debian/pool/gitea/main/upload + +clean: + rm $(PACKAGE_NAME).deb diff --git a/autobackup/DEBIAN/control b/autobackup/DEBIAN/control new file mode 100644 index 0000000..40c7458 --- /dev/null +++ b/autobackup/DEBIAN/control @@ -0,0 +1,6 @@ +Package: autobackup +Version: 1.0 +Architecture: all +Maintainer: zankia +Description: automatically backup directories on a regular basis +Depends: bash, findutils, rsync diff --git a/backup.list.default b/autobackup/etc/autobackup/backup.list similarity index 100% rename from backup.list.default rename to autobackup/etc/autobackup/backup.list diff --git a/config.properties.default b/autobackup/etc/autobackup/config.properties similarity index 100% rename from config.properties.default rename to autobackup/etc/autobackup/config.properties diff --git a/autobackup/etc/cron.d/autobackup b/autobackup/etc/cron.d/autobackup new file mode 100644 index 0000000..ea2c408 --- /dev/null +++ b/autobackup/etc/cron.d/autobackup @@ -0,0 +1,2 @@ +# Automatically backup directories on a daily basis +0 4 * * * root /usr/bin/autobackup diff --git a/autoBackup b/autobackup/usr/bin/autobackup similarity index 100% rename from autoBackup rename to autobackup/usr/bin/autobackup