From 15849b42aa5641434b980fdc46a8f4d34da5d1be Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Thu, 3 Dec 2020 01:52:12 -0500 Subject: Add LICENSE and packaging --- .gitignore | 2 ++ LICENSE | 23 +++++++++++++++++++++++ Makefile | 37 +++++++++++++++++++++++++++++++++---- README.md | 5 +++++ snaprestore.control | 8 ++++++++ 5 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 snaprestore.control diff --git a/.gitignore b/.gitignore index 79aa634..91b2e23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ snaprestore +staging +*.deb compile_commands.json .cache diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0fd25e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2020 Cameron Katri +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile b/Makefile index 90edba3..0307fb6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,16 @@ -CC = aarch64-apple-darwin-clang -STRIP = aarch64-apple-darwin-strip -LDID = ldid -CFLAGS = -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.2.sdk -miphoneos-version-min=13.0 -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/include -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/local/include -F/home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/System/Library/Frameworks +CC = aarch64-apple-darwin-clang +STRIP = aarch64-apple-darwin-strip +LDID = ldid +CFLAGS = -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.2.sdk -miphoneos-version-min=13.0 -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/include -isystem /home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/usr/local/include -F/home/cameron/Documents/Procursus/build_base/iphoneos-arm64/1600/System/Library/Frameworks +INSTALL = install +FAKEROOT = fakeroot +PREFIX ?= /usr +DESTDIR ?= + +DEB_MAINTAINER ?= Cameron Katri +DEB_ARCH ?= iphoneos-arm +SNAPRESTORE_V := 0.1 +DEB_SNAPRESTORE := $(SNAPRESTORE_V) all: snaprestore @@ -9,5 +18,25 @@ snaprestore: snaprestore.m ent.xml NSTask.h $(CC) $(CFLAGS) -o snaprestore snaprestore.m -framework IOKit -framework Foundation -fobjc-arc $(LDID) -Sent.xml snaprestore +install: snaprestore + $(INSTALL) -Dm755 snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore + $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE + +package: snaprestore + rm -rf staging + $(INSTALL) -Dm755 snaprestore staging$(PREFIX)/bin/snaprestore + $(INSTALL) -Dm644 LICENSE staging$(PREFIX)/share/snaprestore/LICENSE + $(FAKEROOT) chown -R 0:0 staging + SIZE=$$(du -s staging | cut -f 1); \ + $(INSTALL) -Dm755 snaprestore.control staging/DEBIAN/control; \ + sed -i ':a; s/@DEB_SNAPRESTORE@/$(DEB_SNAPRESTORE)/g; ta' staging/DEBIAN/control; \ + sed -i ':a; s/@DEB_MAINTAINER@/$(DEB_MAINTAINER)/g; ta' staging/DEBIAN/control; \ + sed -i ':a; s/@DEB_ARCH@/$(DEB_ARCH)/g; ta' staging/DEBIAN/control; \ + cd staging && find . -type f ! -regex '.*.hg.*' ! -regex '.*?debian-binary.*' ! -regex '.*?DEBIAN.*' -printf '"%P" ' | xargs md5sum > DEBIAN/md5sum; \ + cd ..; \ + echo "Installed-Size: $$SIZE" >> staging/DEBIAN/control + $(FAKEROOT) dpkg-deb -z9 -b staging . + rm -rf staging + clean: rm -f snaprestore diff --git a/README.md b/README.md new file mode 100644 index 0000000..a30191a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# snaprestore + +`Usage: snaprestore [volume] [snapshot]` + +not tested, obviously diff --git a/snaprestore.control b/snaprestore.control new file mode 100644 index 0000000..2624641 --- /dev/null +++ b/snaprestore.control @@ -0,0 +1,8 @@ +Package: snaprestore +Section: Utilities +Maintainer: @DEB_MAINTAINER@ +Architecture: @DEB_ARCH@ +Version: @DEB_SNAPRESTORE@ +Description: Easily restore rootfs from the command line + I wholeheartly don't recommend it +Depends: uikittools (>= 2.0.3) -- cgit v1.2.3-56-ge451