aboutsummaryrefslogtreecommitdiffstats
path: root/create_tarballs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'create_tarballs.sh')
-rwxr-xr-xcreate_tarballs.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/create_tarballs.sh b/create_tarballs.sh
new file mode 100755
index 0000000..b14d267
--- /dev/null
+++ b/create_tarballs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+if command -v bsdtar >/dev/null 2>&1; then
+ TAR="bsdtar"
+elif ! tar --version | grep "GNU" >/dev/null 2>&1; then
+ TAR="tar"
+else
+ echo "Install BSD tar"
+ exit 1
+fi
+
+num=0
+for i in adv_cmds basic_cmds bootstrap_cmds \
+ developer_cmds diskdev_cmds doc_cmds \
+ file_cmds mail_cmds misc_cmds network_cmds \
+ patch_cmds remote_cmds shell_cmds \
+ system_cmds text_cmds; do
+ EXTRA_PATHS=""
+ VERSION="$(cat ${i}/.apple_version)"
+ REGEX="|^${i}|${i}-${VERSION}|"
+ case "$i" in
+ network_cmds) REGEX="|^|network_cmds-${VERSION}/|" EXTRA_PATHS="lib/libpcap";;
+ remote_cmds) REGEX="|^|remote_cmds-${VERSION}/|" EXTRA_PATHS="lib/libtelnet";;
+ esac
+ num=$((num+1))
+ printf "(%i) %s\n" "$num" "$i"
+ cp setup.sh $i/setup.sh
+ cp $i/Makefile.inc $i.Makefile.inc
+ sed -i '' -e /\.\.\\/Makefile\.inc/d $i/Makefile.inc
+ cat Makefile.inc >> $i/Makefile.inc
+ ${TAR} -s ${REGEX} -caf ${i}-${VERSION}.tar.zst $i ${EXTRA_PATHS}
+ mv $i.Makefile.inc $i/Makefile.inc
+ rm $i/setup.sh
+done