Maat/Makefile

65 lines
2.0 KiB
Makefile
Raw Permalink Normal View History

2019-04-08 05:05:08 -05:00
installDir = ${pkgdir}/usr/local/bin
list = ./maat
systemdList = ./maat.timer ./maat.service
2019-04-08 05:05:08 -05:00
serverRoot = /srv/maat/
owner=maat
2019-04-08 05:05:08 -05:00
perms=0755
fileperms=0644
2019-02-18 07:56:39 -06:00
compile: /bin/bash
@echo Nothing to compile.
install: ${list} MaatIcon.png
2019-04-08 05:05:08 -05:00
mkdir -p ${installDir}
mkdir -p ${pkgdir}${serverRoot}/src
mkdir -p ${pkgdir}${serverRoot}/pkg
install -m ${fileperms} -o ${owner} ./MaatIcon.png ${pkgdir}${serverRoot}/pkg
mkdir -p ${pkgdir}/usr/lib/systemd/system
for i in ${list}; do install -m ${perms} -o root $$i ${installDir}; done
install -m ${perms} -o ${owner} -d ${pkgdir}/usr/local/etc/Maat/
touch ${pkgdir}/usr/local/etc/Maat/aur.list; chown ${owner} ${pkgdir}/usr/local/etc/Maat/aur.list; chmod ${fileperms} ${pkgdir}/usr/local/etc/Maat/aur.list
2019-04-08 05:05:08 -05:00
for i in ${systemdList}; do install -m 0644 -o root $$i ${pkgdir}/usr/lib/systemd/system; done
2019-02-18 07:56:39 -06:00
clean:
git clean -fdX
2019-02-18 07:56:39 -06:00
uninstall:
2019-04-08 05:05:08 -05:00
for i in ${list}; do rm -Rf ${installDir}/$$i; done
for i in ${systemdList}; do rm /usr/lib/systemd/system/$$i; done
rmdir -p ${pkgdir}${serverRoot}/src
rmdir -p ${pkgdir}${serverRoot}/pkg
2019-02-18 07:56:39 -06:00
test:
./maat -h | grep -c Usage 1>/dev/null
checkperm:
chown -R ${owner}: ${pkgdir}${serverRoot}/src
chown -R ${owner}: ${pkgdir}${serverRoot}/pkg
for i in ${list}; do chown -R ${owner}: "${installDir}/$$i"; sudo chmod ${perms} "${installDir}/$$i"; done
diff:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then diff "$$i" "${installDir}/$$i"; fi done
reverse:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then cp "${installDir}/$$i" "$$i"; fi done
extendedtest: clean
sudo ./maat -u $$USER -T
test -d src
test -d src/ascii-invaders
test -d src/ascii-invaders/.git
test -d src/HelloWorld
test -d src/HelloWorld/.git
test -d pkg
test -d pkg/aur
test -f pkg/AniNIX.db
test -f pkg/AniNIX.db.sig
test -f pkg/HelloWorld*.tar.zst
test -f pkg/aur/aur.db
test -f pkg/aur/aur.db.sig
test -f pkg/aur/ascii-invaders*.tar.zst
[ `wc -l pkg/index.html | cut -f 1 -d ' '` -eq 24 ]
make clean
@echo
@echo Tests passed successfully.