Create dist/ to hold all the distribution build files ##build (#18131)

This commit is contained in:
pancake 2020-12-31 18:57:05 +01:00 committed by GitHub
parent b2117e48c5
commit 658c6a0918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 77 additions and 32 deletions

View File

@ -863,6 +863,8 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Moving the Dockerfile to the root
run: cp -f dist/docker/Dockerfile .
- name: Publish to Registry
uses: docker/build-push-action@v1
with:

View File

@ -128,7 +128,7 @@ before_install:
if [ "${FUZZIT}" == "1" ]; then
docker pull gcr.io/fuzzit-public/builders:llvm9.v1
elif [ "$TRAVIS_OS_NAME" != "osx" ] && [ "$NODOCKER" != "1" ]; then
docker pull radareorg/r2-travis:latest || docker build -t radareorg/r2-travis:latest -f Dockerfile.travis .
docker pull radareorg/r2-travis:latest || docker build -t radareorg/r2-travis:latest -f dist/docker/Dockerfile.travis .
fi
script:

View File

@ -33,7 +33,7 @@ help () {
cfg=./plugins.cfg
if [ ! -f "$cfg" ]; then
cp -f ./plugins.def.cfg plugins.cfg
cp -f dist/plugins-cfg/plugins.def.cfg plugins.cfg
fi
load () {
@ -42,7 +42,7 @@ load () {
. $cfg
else
echo "configure-plugins: Loading $1 .."
. "$1" #plugins.def.cfg
. "$1"
fi
}
@ -186,7 +186,7 @@ make_ () { : ; }
MODE=""
DONOTHING=0
DEFCFG=./plugins.def.cfg
DEFCFG=dist/plugins-cfg/plugins.def.cfg
rmstatic() {
C=0

View File

@ -4,7 +4,7 @@ case "$1" in
: # nothing to do here
;;
*)
[ plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg
[ dist/plugins-cfg/plugins.def.cfg -nt ./plugins.cfg ] && rm -f plugins.cfg
./configure-plugins $*
;;
esac

5
dist/macos/Makefile vendored Normal file
View File

@ -0,0 +1,5 @@
all:
cd ../.. && dist/macos/build-pkg.sh
clean:
rm -rf *.pkg

38
dist/macos/build-pkg.sh vendored Executable file
View File

@ -0,0 +1,38 @@
#!/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"
if [ -n "$1" ]; then
VERSION="$1"
else
VERSION="`./configure --version| head -n 1|awk '{print $1}'|cut -d - -f 2`"
[ -z "${VERSION}" ] && VERSION=3.6.0
fi
[ -z "${MAKE}" ] && MAKE=make
rm -rf "${SRC}"
${MAKE} mrproper 2>/dev/null
export CFLAGS=-O2
./configure --prefix="${PREFIX}" --without-libuv || 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

View File

@ -12,8 +12,8 @@ if [ "${ARCH}" = "x86_64" ]; then
fi
echo "[debian] preparing radare2 package..."
PKGDIR=sys/debian/radare2/root
DEVDIR=sys/debian/radare2-dev/root
PKGDIR=dist/debian/radare2/root
DEVDIR=dist/debian/radare2-dev/root
# clean
rm -rf "${PKGDIR}" "${DEVDIR}"
@ -42,9 +42,9 @@ done
# packages
echo "[debian] building radare2 package..."
make -C sys/debian/radare2 ARCH=${ARCH}
cp -f sys/debian/radare2/*.deb .
make -C dist/debian/radare2 ARCH=${ARCH}
cp -f dist/debian/radare2/*.deb .
echo "[debian] building radare2-dev package..."
make -C sys/debian/radare2-dev ARCH=${ARCH}
cp -f sys/debian/radare2-dev/*.deb .
make -C dist/debian/radare2-dev ARCH=${ARCH}
cp -f dist/debian/radare2-dev/*.deb .

View File

@ -37,34 +37,36 @@ else
PREFIX=/usr
fi
ROOT=dist/cydia/radare2/root
makeDeb() {
make -C binr ios-sdk-sign
rm -rf /tmp/r2ios
make install DESTDIR=/tmp/r2ios
rm -rf /tmp/r2ios/${PREFIX}/share/radare2/*/www/*/node_modules
( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* )
rm -rf sys/cydia/radare2/root
mkdir -p sys/cydia/radare2/root
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C sys/cydia/radare2/root
rm -f sys/cydia/radare2/root/${PREFIX}/lib/*.{a,dylib,dSYM}
rm -rf $(ROOT)
mkdir -p $(ROOT)
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C $(ROOT)
rm -f $(ROOT)/${PREFIX}/lib/*.{a,dylib,dSYM}
if [ "$static" = 1 ]; then
(
rm -f sys/cydia/radare2/root/${PREFIX}/bin/*
cp -f binr/blob/radare2 sys/cydia/radare2/root/${PREFIX}/bin
cd sys/cydia/radare2/root/${PREFIX}/bin
rm -f $(ROOT)/${PREFIX}/bin/*
cp -f binr/blob/radare2 $(ROOT)/${PREFIX}/bin
cd $(ROOT)/${PREFIX}/bin
for a in r2 rabin2 rarun2 rasm2 ragg2 rahash2 rax2 rafind2 radiff2 ; do ln -fs radare2 $a ; done
)
echo "Signing radare2"
ldid2 -Sbinr/radare2/radare2_ios.xml sys/cydia/radare2/root/usr/bin/radare2
ldid2 -Sbinr/radare2/radare2_ios.xml $(ROOT)/usr/bin/radare2
else
for a in sys/cydia/radare2/root/usr/bin/* sys/cydia/radare2/root/usr/lib/*.dylib ; do
for a in $(ROOT)/usr/bin/* $(ROOT)/usr/lib/*.dylib ; do
echo "Signing $a"
ldid2 -Sbinr/radare2/radare2_ios.xml $a
done
fi
if [ "${STOW}" = 1 ]; then
if [ "${STOW}" = 1 ]; then
(
cd sys/cydia/radare2/root/
cd $(ROOT)/
mkdir -p usr/bin
# stow
echo "Stowing ${PREFIX} into /usr..."
@ -78,10 +80,10 @@ if [ "${STOW}" = 1 ]; then
fi
done
)
else
else
echo "No need to stow anything"
fi
( cd sys/cydia/radare2 ; sudo make clean ; sudo make PACKAGE=${PACKAGE} )
fi
( cd dist/cydia/radare2 ; sudo make clean ; sudo make PACKAGE=${PACKAGE} )
}
if [ "$1" = makedeb ]; then
@ -116,8 +118,6 @@ else
xcrun --sdk iphoneos strip radare2
)
fi
if [ $? = 0 ]; then
makeDeb
fi
[ $? = 0 ] && makeDeb
fi
fi

View File

@ -75,7 +75,7 @@ SelectPluginShared () {
}
SelectPluginStatic() {
. ./plugins.def.cfg
. ./dist/plugins-cfg/plugins.def.cfg
PLUGINS="${STATIC} ${SHARED}"
ARGS=""
for a in ${PLUGINS} ; do