]> git.cameronkatri.com Git - apple_cmds.git/blob - create_tarballs.sh
md5: Don't symlink non working bins, setuid appropriate bins
[apple_cmds.git] / create_tarballs.sh
1 #!/bin/sh
2 if command -v bsdtar >/dev/null 2>&1; then
3 TAR="bsdtar"
4 elif ! tar --version | grep "GNU" >/dev/null 2>&1; then
5 TAR="tar"
6 else
7 echo "Install BSD tar"
8 exit 1
9 fi
10
11 num=0
12 for i in adv_cmds basic_cmds bootstrap_cmds \
13 developer_cmds diskdev_cmds doc_cmds \
14 file_cmds mail_cmds misc_cmds network_cmds \
15 patch_cmds remote_cmds shell_cmds \
16 system_cmds text_cmds; do
17 EXTRA_PATHS=""
18 VERSION="$(cat ${i}/.apple_version)"
19 REGEX="|^${i}|${i}-${VERSION}|"
20 case "$i" in
21 network_cmds) REGEX="|^|network_cmds-${VERSION}/|" EXTRA_PATHS="lib/libpcap";;
22 remote_cmds) REGEX="|^|remote_cmds-${VERSION}/|" EXTRA_PATHS="lib/libtelnet";;
23 esac
24 num=$((num+1))
25 printf "(%i) %s\n" "$num" "$i"
26 cp setup.sh $i/setup.sh
27 cp $i/Makefile.inc $i.Makefile.inc
28 sed -i '' -e /\.\.\\/Makefile\.inc/d $i/Makefile.inc
29 cat Makefile.inc >> $i/Makefile.inc
30 ${TAR} -s ${REGEX} -caf ${i}-${VERSION}.tar.zst $i ${EXTRA_PATHS}
31 mv $i.Makefile.inc $i/Makefile.inc
32 rm $i/setup.sh
33 done