2016-08-04 11:15:34 -05:00
SHELL := /bin/bash
2016-11-09 22:29:17 -06:00
BACKUPDIR := /usr/local/backup
2023-12-07 12:28:55 -06:00
LIST := aether.bash aether-gen.bash remote-backup
SYSDLIST := aether-gen.service aether-gen.timer aether.service aether.timer
2016-08-04 11:15:34 -05:00
2020-02-08 13:34:58 -06:00
compile :
@echo Nothing to do
2023-12-07 12:28:55 -06:00
install : compile ${LIST } ${SYSDLIST }
# Scripts
2023-07-15 22:34:00 -05:00
mkdir -p ${ pkgdir } /usr/local/sbin
2023-12-07 12:40:48 -06:00
for i in ${ LIST } ; do install -m 700 -o root -g root " $$ i " ${ pkgdir } /usr/local/sbin; done
2023-12-07 12:28:55 -06:00
# systemd
mkdir -p ${ pkgdir } /usr/lib/systemd/system
2023-12-07 12:40:48 -06:00
for i in ${ SYSDLIST } ; do install -m 0664 -o root -g root " $$ i " ${ pkgdir } /usr/lib/systemd/system; done
2023-12-07 12:28:55 -06:00
# Config
2023-07-15 22:34:00 -05:00
mkdir -p ${ pkgdir } /usr/local/etc
2023-12-07 12:43:37 -06:00
install -m 0700 -o root -d ${ pkgdir } /usr/local/etc/Aether
2016-11-09 22:29:17 -06:00
2017-06-19 13:16:04 -05:00
clean :
@bash -c 'printf "This will irreversibly destroy all backups. Confirm? [YES/no] " ; read answer; [ "$$answer" == "YES" ] && exit 0; exit 1'
for i in ` ls /home/aether/aether*` ; do shred $$ i; done
rm -Rf /home/aether
userdel aether
find /usr/local/backup -type f -exec shred { } \;
rm -Rf /usr/local/backup; fi
2016-11-09 22:29:17 -06:00
2023-12-07 12:28:55 -06:00
uninstall :
rm -Rf ${ pkgdir } /usr/local/sbin/aether*.bash ${ pkgdir } /usr/local/sbin/remote-backup ${ pkgdir } /usr/local/etc/Aether ${ pkgdir } /usr/lib/systemd/system/aether*.service ${ pkgdir } /usr/lib/systemd/system/aether*.timer
2017-06-19 13:16:04 -05:00
test :
2020-02-08 13:34:58 -06:00
python3 -m pytest
2023-12-07 12:28:55 -06:00
checkperm :
for i in ${ pkgdir } /usr/local/sbin/aether.bash ${ pkgdir } /usr/local/sbin/aether-gen.bash ${ pkgdir } /usr/local/sbin/remote-backup ${ pkgdir } /usr/local/etc/Aether; do chmod 0700 " $$ i " ; done
for i in ${ pkgdir } /usr/local/sbin/aether.bash ${ pkgdir } /usr/local/sbin/aether-gen.bash ${ pkgdir } /usr/local/sbin/remote-backup ${ pkgdir } /usr/local/etc/Aether; do chown root: " $$ i " ; done
chown aether: ${ pkgdir } /usr/local/sbin/aether.bash
for i in *.service *.timer; do chown root: ${ pkgdir } /usr/lib/systemd/system; chmod 0640 ${ pkgdir } /usr/lib/systemd/system; done
diff :
for i in ${ LIST } ; do diff ./$$ i ${ pkgdir } /usr/local/sbin/$$ i; done
for i in ${ SYSDLIST } ; do diff ./$$ i ${ pkgdir } /usr/lib/systemd/system/$$ i; done
reverse :
for i in ${ LIST } ; do cp ${ pkgdir } /usr/local/sbin/$$ i . ; done
for i in ${ SYSDLIST } ; do cp ${ pkgdir } /usr/lib/systemd/system/$$ i . ; done