Moving install to root for privileged scripts rather than the user; hooks cleanup; changing test strategey to helptext for now
This commit is contained in:
41
Makefile
41
Makefile
@@ -1,25 +1,21 @@
|
||||
SHELL := /bin/bash
|
||||
BACKUPDIR := /usr/local/backup
|
||||
LIST := aether.bash aether-gen.bash remote-backup
|
||||
SYSDLIST := aether-gen.service aether-gen.timer aether.service aether.timer
|
||||
|
||||
compile:
|
||||
@echo Nothing to do
|
||||
|
||||
install: compile
|
||||
install: compile ${LIST} ${SYSDLIST}
|
||||
# Scripts
|
||||
mkdir -p ${pkgdir}/usr/local/sbin
|
||||
mkdir -p ${pkgdir}/usr/local/etc
|
||||
install -m 0700 -o aether aether.bash ${pkgdir}/usr/local/sbin
|
||||
install -m 0700 -o root -g root aether-gen.bash ${pkgdir}/usr/local/sbin
|
||||
install -m 0700 -o root -g root remote-backup ${pkgdir}/usr/local/sbin
|
||||
install -m 0700 -o aether -d ${pkgdir}/usr/local/etc/Aether
|
||||
install -m 0700 -o aether -d ${pkgdir}/usr/local/etc/Aether/backup-entries
|
||||
for i in ${LIST}; do install -m 700 -o root -g root ${pkgdir}/usr/local/sbin; done
|
||||
# systemd
|
||||
mkdir -p ${pkgdir}/usr/lib/systemd/system
|
||||
for i in *.service *.timer; do install -m 0640 -o root -g root "$$i" ${pkgdir}/usr/lib/systemd/system; done
|
||||
|
||||
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
|
||||
for i in ${SYSDLIST}; do install -m 0664 -o root -g root ${pkgdir}/usr/lib/systemd/system; done
|
||||
# Config
|
||||
mkdir -p ${pkgdir}/usr/local/etc
|
||||
install -m 0700 -o aether -d ${pkgdir}/usr/local/etc/Aether
|
||||
|
||||
clean:
|
||||
@bash -c 'printf "This will irreversibly destroy all backups. Confirm? [YES/no] " ; read answer; [ "$$answer" == "YES" ] && exit 0; exit 1'
|
||||
@@ -29,5 +25,22 @@ clean:
|
||||
find /usr/local/backup -type f -exec shred {} \;
|
||||
rm -Rf /usr/local/backup; fi
|
||||
|
||||
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
|
||||
|
||||
test:
|
||||
python3 -m pytest
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user