ShadowArch/EtcFiles/Makefile

47 lines
2.5 KiB
Makefile
Raw Normal View History

httpRoot = ${pkgdir}/srv/http/aninix.net
httpUser = http
2022-11-20 20:47:27 -06:00
syncList = profile.d tmux.conf
userServiceList = tmux.service
compile: ./shadowarch ${syncList} ${userServiceList} ./shadowarch.vim ./skel
@echo Nothing to compile
2022-01-18 10:49:51 -06:00
install: compile
2022-11-20 20:47:27 -06:00
mkdir -p ${pkgdir}/etc/
mkdir -p ${pkgdir}/usr/lib/systemd/user
mkdir -p ${pkgdir}/usr/share/vim/vimfiles/plugin/
2022-11-20 20:47:27 -06:00
for i in ${syncList}; do cp -r "$$i" ${pkgdir}/etc/; chmod -R a+r ${pkgdir}/etc/; done
for i in ${userServiceList}; do cp "$$i" ${pkgdir}/usr/lib/systemd/user/"$$i"; done
cp ./shadowarch.vim ${pkgdir}/usr/share/vim/vimfiles/plugin/shadowarch.vim
2022-11-20 20:47:27 -06:00
cp -pr ./skel ${pkgdir}/etc
if [ `uname -r | grep -c arch` -eq 1 ]; then mkdir -p ${pkgdir}/usr/share/pacman/keyrings; cp aninix.gpg ${pkgdir}/usr/share/pacman/keyrings; fi
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
2022-11-20 20:47:27 -06:00
test:
bash -n shadowarch
2022-11-20 20:47:27 -06:00
bash ./shadowarch -h
echo Success.
reverse: ${httpRoot}/shadowarch ${syncList}
cat ${httpRoot}/shadowarch > ./shadowarch
for i in ${syncList}; do rsync -avz ${syncList} .; done
2022-11-20 20:47:27 -06:00
for i in ${userServiceList}; do rsync -avz /usr/lib/systemd/user/${userServiceList} .; done
rsync --delete-before -avz ${pkgdir}/etc/skel ./skel
clean:
@echo Nothing to do.
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
2022-11-20 20:47:27 -06:00
diff -rc ${pkgdir}/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