mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-29 09:13:19 +00:00
36 lines
836 B
Bash
Executable File
36 lines
836 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# based on
|
|
# http://blog.coolaj86.com/articles/how-to-unpackage-and-repackage-pkg-osx.html
|
|
|
|
# to uninstall:
|
|
# sudo pkgutil --forget org.radare.radare2
|
|
|
|
SRC=/tmp/r2osx
|
|
PREFIX=/usr/local
|
|
DST="$(pwd)/sys/osx-pkg/radare2.unpkg"
|
|
VERSION="`./configure --version| head -n 1|awk '{print $1}'|cut -d - -f 2`"
|
|
[ -z "${VERSION}" ] && VERSION=0.10.0
|
|
[ -z "${MAKE}" ] && MAKE=make
|
|
|
|
rm -rf "${SRC}"
|
|
${MAKE} mrproper
|
|
./configure --prefix="${PREFIX}" || exit 1
|
|
${MAKE} -j4 || exit 1
|
|
# TODO: run sys/install.sh
|
|
${MAKE} install PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
|
|
if [ -d "${SRC}" ]; then
|
|
(
|
|
cd ${SRC} && \
|
|
find . | cpio -o --format odc | gzip -c > "${DST}/Payload"
|
|
)
|
|
mkbom ${SRC} "${DST}/Bom"
|
|
|
|
# Repackage
|
|
|
|
pkgutil --flatten "${DST}" "${DST}/../radare2-${VERSION}.pkg"
|
|
else
|
|
echo "Failed install. DESTDIR is empty"
|
|
exit 1
|
|
fi
|