ShadowArch/ShadowArch/Makefile

47 lines
2.6 KiB
Makefile
Raw Normal View History

2018-02-14 03:20:12 -06:00
HTTPROOT = ${pkgbuild}/srv/http/aninix.net
2016-08-04 12:30:21 -05:00
HTTPUSER = http
2018-02-14 03:20:12 -06:00
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
2016-08-04 12:30:21 -05:00
2017-06-23 13:56:31 -05:00
compile: ./shadowarch
@echo Nothing to compile
2016-08-30 14:20:55 -05:00
2017-06-19 16:36:22 -05:00
install: compile
2018-02-14 03:20:12 -06:00
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
2017-06-23 13:56:31 -05:00
# This is a nicety.
2018-02-14 03:20:12 -06:00
if [ -f ${pkgbuild}/root/shadowarch* ]; then sed -i 's/`uname -o`/ShadowArch/g' ${pkgbuild}/etc/bashrc; fi
2016-08-04 12:30:21 -05:00
2017-07-27 15:30:48 -05:00
repository: shadowarch ${HTTPROOT}
cp ./shadowarch ${HTTPROOT}
2016-11-16 16:23:52 -06:00
checkperm: ${SYNCLIST}
2017-05-02 11:20:06 -05:00
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
2016-08-04 12:30:21 -05:00
2016-11-16 16:23:52 -06:00
test:
2016-11-29 15:00:15 -06:00
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
2018-02-14 03:20:12 -06:00
rm -Rf ./skel; cp -pr ${pkgbuild}/etc/skel ./skel
2017-06-23 13:56:31 -05:00
sed -i 's/ShadowArch/`uname -o`/' ./bash.bashrc
2016-08-04 12:30:21 -05:00
2017-06-19 16:36:22 -05:00
clean:
2018-02-14 03:20:12 -06:00
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
2017-06-19 16:36:22 -05:00
2017-10-25 23:50:52 -05:00
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
2018-02-14 03:20:12 -06:00
diff -rc ${pkgbuild}/etc/skel ./skel; printf ""
2017-05-27 16:38:14 -05:00
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