ShadowArch/ShadowArch/Makefile

47 lines
2.6 KiB
Makefile

HTTPROOT = ${pkgbuild}/srv/http/aninix.net
HTTPUSER = http
SYNCLIST = ${pkgbuild}/etc/vimrc ${pkgbuild}/etc/bashrc ${pkgbuild}/etc/tmux.conf ${pkgbuild}/etc/profile
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | ${pkgbuild}/bin/bash
compile: ./shadowarch
@echo Nothing to compile
install: compile
for i in ${SYNCLIST}; do rsync -avz -r `echo $$i | sed 's#^/etc/##'` ${pkgbuild}$$i; done
mkdir -p ${pkgbuild}/etc
rm -Rf ${pkgbuild}/etc/skel; cp -pr ./skel ${pkgbuild}/etc
# This is a nicety.
if [ -f ${pkgbuild}/root/shadowarch* ]; then sed -i 's/`uname -o`/ShadowArch/g' ${pkgbuild}/etc/bashrc; fi
repository: shadowarch ${HTTPROOT}
cp ./shadowarch ${HTTPROOT}
checkperm: ${SYNCLIST}
printf "What is your deprivileged user? "; read user; chown -R ${user}:${user} .
if [ -f ${HTTPROOT}/shadowarch ]; then chmod 0755 ${HTTPROOT}/shadowarch; chown ${HTTPUSER} ${HTTPROOT}/shadowarch; fi
chown -R root:root ${SYNCLIST}
for i in ${SYNCLIST}; do if [ -f "${i}" ]; then chmod 0644 "${i}"; elif [ -d "${i}" ]; then chmod 0755 "${i}"; fi; done
test:
bash -n shadowarch
bash ./shadowarch -h
echo Success.
reverse: ${HTTPROOT}/shadowarch ${SYNCLIST}
cat ${HTTPROOT}/shadowarch > ./shadowarch
for i in ${SYNCLIST}; do rsync -avz ${SYNCLIST} .; done
rm -Rf ./skel; cp -pr ${pkgbuild}/etc/skel ./skel
sed -i 's/ShadowArch/`uname -o`/' ./bash.bashrc
clean:
if [ -f ${pkgbuild}/etc/bash.bashrc ]; then printf "Remove ${pkgbuild}/etc/bash.bashrc? [y/n] "; read answer; if [ "$$answer" == "y" ]; then rm ${pkgbuild}/etc/bash.bashrc; fi; fi
diff: ${SYNCLIST}
if [ -f ${HTTPROOT}/shadowarch ]; then diff ./shadowarch ${HTTPROOT}/shadowarch; echo; fi
for i in ${SYNCLIST}; do diff -rc "$$i" ./`echo $$i | rev | cut -f 1 -d '/' | rev`; echo; done
diff -rc ${pkgbuild}/etc/skel ./skel; printf ""
find-missing-hooks-in-src:
@for i in `wget -q -O - https://aninix.net/foundation/ | grep toplevel-repo | cut -f 4 -d \'`; do if [ -z $$i ]; then continue; fi; for file in `find ../.. -type f -name Makefile | grep $$i`; do if [ -z "$$file" ]; then echo NO MAKEFILE FOR $$i; elif [ `grep -c -i 'hook for systemd' $$file` -eq 0 ]; then echo HOOK MISSING IN: $$file; else echo HOOK FOUND IN: $$file; fi; done; done
@for i in `wget -q -O - https://aninix.net/foundation/ | grep toplevel-repo | cut -f 4 -d \'`; do if [ -z $$i ]; then continue; fi; for file in `find ../.. -type f -name Makefile | grep $$i`; do if [ -z "$$file" ]; then echo NO MAKEFILE FOR $$i; elif [ `grep -c useradd $$file` -eq 0 ]; then echo DEPRIV MISSING IN: $$file; else echo DEPRIV FOUND IN: $$file; fi; done; done