diff --git a/Makefile b/Makefile index f94a087..ae63dc8 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,13 @@ endif include $(THEOS_MAKE_PATH)/aggregate.mk after-stage:: + $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN \ + $(THEOS_STAGING_DIR)/Library/Frameworks \ + $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END) + $(ECHO_NOTHING)cp preinst $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END) ifneq ($(PACKAGE_BUILDNAME)$(IMAGENT),debug) - $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END) $(ECHO_NOTHING)cp postinst postrm $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END) endif - $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END) $(ECHO_NOTHING)cp Resources/*.png $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END) + $(ECHO_NOTHING)ln -s /usr/lib/TypeStatus/TypeStatusProvider.framework $(THEOS_STAGING_DIR)/Library/Frameworks/TypeStatusProvider.framework$(ECHO_END) diff --git a/api/Makefile b/api/Makefile index ba2f520..d9589df 100644 --- a/api/Makefile +++ b/api/Makefile @@ -12,6 +12,7 @@ TypeStatusProvider_FRAMEWORKS = MobileCoreServices TypeStatusProvider_PRIVATE_FRAMEWORKS = AppSupport TypeStatusProvider_EXTRA_FRAMEWORKS = Cephei CydiaSubstrate TypeStatusProvider_LIBRARIES = rocketbootstrap +TypeStatusProvider_INSTALL_PATH = /usr/lib/TypeStatus include $(THEOS)/makefiles/framework.mk diff --git a/postinst b/postinst index b1ce2cf..2c77b11 100755 --- a/postinst +++ b/postinst @@ -1,10 +1,5 @@ #!/bin/bash +set -e + # relaunch imagent so we get injected into it launchctl stop com.apple.imagent - -# create our providers directory and move it to the stash -if [[ -x /usr/libexec/cydia/move.sh ]]; then - /usr/libexec/cydia/move.sh /Library/TypeStatus -fi - -mkdir -p /Library/TypeStatus/Providers diff --git a/postrm b/postrm index 98c98ff..a4c9ce3 100755 --- a/postrm +++ b/postrm @@ -1,6 +1,10 @@ #!/bin/bash +set -e + # relaunch imagent so we get injected into it, but not when we’re upgrading # or it’ll get stopped again by postinst -if [[ "$1" != "upgrade" ]]; then +if [[ $1 != upgrade ]]; then launchctl stop com.apple.imagent +else + : fi diff --git a/preinst b/preinst new file mode 100755 index 0000000..92d00c2 --- /dev/null +++ b/preinst @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +# if /Library/TypeStatus exists and /usr/lib/TypeStatus/Providers doesn’t yet, move it over. else if +# cydia’s move script exists, use it to create a stashed providers dir. else, just create it ourselves +if [[ -d /Library/TypeStatus || -h /Library/TypeStatus ]] && [[ ! -d /usr/lib/TypeStatus/Providers ]]; then + mv /Library/TypeStatus /usr/lib/TypeStatus + rm -rf /Library/TypeStatus +elif [[ -x /usr/libexec/cydia/move.sh ]]; then + bash /usr/libexec/cydia/move.sh /usr/lib/TypeStatus +else + mkdir -p /usr/lib/TypeStatus/Providers +fi + +# if /Library/TypeStatus isn’t a symlink, make it be one now +if [[ ! -h /Library/TypeStatus ]]; then + ln -s /usr/lib/TypeStatus /Library/TypeStatus +fi