]> git.cameronkatri.com Git - snaprestore.git/commitdiff
Major changes and fixes
authorTheRealKeto <therealketo@gmail.com>
Mon, 5 Jul 2021 04:48:25 +0000 (00:48 -0400)
committerCameron Katri <me@cameronkatri.com>
Mon, 5 Jul 2021 13:38:30 +0000 (09:38 -0400)
- Add uninstall function
- Reduces some lines of code
- Packaging function now uses install function
- Removes unessesary DESTDIR variable defintion

Signed-off-by: Cameron Katri <me@cameronkatri.com>
Makefile

index 7819de79b0909a95bb1586f9e30f4890ad1642a9..ee3311742185c954bd628463094cc2f9d43f240a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,6 @@ CFLAGS          ?= -arch arm64  -isysroot /home/cameron/Documents/SDK/iPhoneOS14
 INSTALL         ?= install
 FAKEROOT        ?= fakeroot
 PREFIX          ?= /usr
-DESTDIR         ?= 
 
 DEB_MAINTAINER  ?= Cameron Katri <me@cameronkatri.com>
 DEB_ARCH        ?= iphoneos-arm
@@ -24,10 +23,10 @@ install: build/snaprestore
        $(INSTALL) -Dm755 build/snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
        $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
 
-package: build/snaprestore
+package: install
        rm -rf staging
-       $(INSTALL) -Dm755 build/snaprestore staging$(PREFIX)/bin/snaprestore
-       $(INSTALL) -Dm644 LICENSE staging$(PREFIX)/share/snaprestore/LICENSE
+       mkdir -p staging
+       cp -a $(DESTDIR)$(PREFIX) staging
        $(FAKEROOT) chown -R 0:0 staging
        SIZE=$$(du -s staging | cut -f 1); \
        $(INSTALL) -Dm755 src/snaprestore.control staging/DEBIAN/control; \
@@ -40,5 +39,9 @@ package: build/snaprestore
        $(FAKEROOT) dpkg-deb -z9 -b staging build
        rm -rf staging
 
-clean: 
+uninstall:
+       rm -f $(DESTDIR)$(PREFIX)/bin/snaprestore
+       rm -rf $(DESTDIR)$(PREFIX)/share/snaprestore
+
+clean:
        rm -f build/snaprestore