Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Commit 5e5395c

Browse files
committed
[makefile,{pre,post}{inst,rm}] this really sucks 😕
1 parent 57eb760 commit 5e5395c

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ endif
2727
include $(THEOS_MAKE_PATH)/aggregate.mk
2828

2929
after-stage::
30+
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN \
31+
$(THEOS_STAGING_DIR)/Library/Frameworks \
32+
$(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
33+
$(ECHO_NOTHING)cp preinst $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
3034
ifneq ($(PACKAGE_BUILDNAME)$(IMAGENT),debug)
31-
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
3235
$(ECHO_NOTHING)cp postinst postrm $(THEOS_STAGING_DIR)/DEBIAN$(ECHO_END)
3336
endif
3437

35-
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
3638
$(ECHO_NOTHING)cp Resources/*.png $(THEOS_STAGING_DIR)/System/Library/Frameworks/UIKit.framework$(ECHO_END)
39+
$(ECHO_NOTHING)ln -s /usr/lib/TypeStatus/TypeStatusProvider.framework $(THEOS_STAGING_DIR)/Library/Frameworks/TypeStatusProvider.framework$(ECHO_END)

api/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ TypeStatusProvider_FRAMEWORKS = MobileCoreServices
1212
TypeStatusProvider_PRIVATE_FRAMEWORKS = AppSupport
1313
TypeStatusProvider_EXTRA_FRAMEWORKS = Cephei CydiaSubstrate
1414
TypeStatusProvider_LIBRARIES = rocketbootstrap
15+
TypeStatusProvider_INSTALL_PATH = /usr/lib/TypeStatus
1516

1617
include $(THEOS)/makefiles/framework.mk
1718

postinst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/bin/bash
2+
set -e
3+
24
# relaunch imagent so we get injected into it
35
launchctl stop com.apple.imagent
4-
5-
# create our providers directory and move it to the stash
6-
if [[ -x /usr/libexec/cydia/move.sh ]]; then
7-
/usr/libexec/cydia/move.sh /Library/TypeStatus
8-
fi
9-
10-
mkdir -p /Library/TypeStatus/Providers

postrm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
2+
set -e
3+
24
# relaunch imagent so we get injected into it, but not when we’re upgrading
35
# or it’ll get stopped again by postinst
4-
if [[ "$1" != "upgrade" ]]; then
6+
if [[ $1 != upgrade ]]; then
57
launchctl stop com.apple.imagent
8+
else
9+
:
610
fi

preinst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# if /Library/TypeStatus exists and /usr/lib/TypeStatus/Providers doesn’t yet, move it over. else if
5+
# cydia’s move script exists, use it to create a stashed providers dir. else, just create it ourselves
6+
if [[ -d /Library/TypeStatus || -h /Library/TypeStatus ]] && [[ ! -d /usr/lib/TypeStatus/Providers ]]; then
7+
mv /Library/TypeStatus /usr/lib/TypeStatus
8+
rm -rf /Library/TypeStatus
9+
elif [[ -x /usr/libexec/cydia/move.sh ]]; then
10+
bash /usr/libexec/cydia/move.sh /usr/lib/TypeStatus
11+
else
12+
mkdir -p /usr/lib/TypeStatus/Providers
13+
fi
14+
15+
# if /Library/TypeStatus isn’t a symlink, make it be one now
16+
if [[ ! -h /Library/TypeStatus ]]; then
17+
ln -s /usr/lib/TypeStatus /Library/TypeStatus
18+
fi

0 commit comments

Comments
 (0)