$(MAKE) -C sjbin clean
install:
- $(COPY) -r --no-clobber etc/* $(DESTDIR)$(sysconfdir)
- $(COPY) -r usr/bin/* $(DESTDIR)$(bindir)
- $(COPY) -r usr/share/* $(DESTDIR)$(datarootdir)
- $(COPY) -r usr/lib/* $(DESTDIR)$(libdir)
- $(COPY) -r usr/libexec/* $(DESTDIR)$(libexecdir)
- $(MAKE) -C sjbin install
+# TODO use install and wildcard ?
+ $(COPY) -v -r --no-clobber etc/* $(DESTDIR)$(sysconfdir)
+ $(COPY) -v -r usr/bin/* $(DESTDIR)$(bindir)
+# $(COPY) -v -r usr/share/* $(DESTDIR)$(datarootdir)
+ $(COPY) -v -r usr/lib/* $(DESTDIR)$(libdir)
+ sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/systemd/system/argeo*.service
+ sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/systemd/user/argeo*.service
+ sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/argeo/*.args
+ $(COPY) -v -r usr/libexec/* $(DESTDIR)$(libexecdir)
+# $(MAKE) -C sjbin install
systemctl daemon-reload
-
\ No newline at end of file
+
+uninstall:
+ $(foreach f, $(shell cd usr/bin/ && find . -type f), $(RM) $(DESTDIR)$(bindir)/$(f);)
+# $(foreach f, $(shell find usr/share/ -type f), $(RM) $(DESTDIR)$(datarootdir)/$(f);)
+ $(foreach f, $(shell cd usr/lib/ && find . -type f), $(RM) $(DESTDIR)$(libdir)/$(f);)
+ $(foreach f, $(shell cd usr/libexec/ && find . -type f), $(RM) $(DESTDIR)$(libexecdir)/$(f);)
+
+purge: uninstall
+ $(foreach f, $(shell cd etc/ && find . -type f), $(RM) $(DESTDIR)$(sysconfdir)/$(f);)