mergerfs/buildtools/build-mergerfs

64 lines
1.2 KiB
Text
Raw Normal View History

#!/bin/sh
2025-08-29 08:51:05 -04:00
set -e
2025-08-29 08:51:05 -04:00
if [ $# -ne 2 ]; then
echo "usage: $0 <branch> <git_repo>"
echo "argv: $@"
echo "argc: $#"
exit 1
fi
GIT_REPO="${1}"
BRANCH="${2}"
BUILDDIR="/tmp/build"
2025-08-29 08:51:05 -04:00
echo "Clone source from ${GIT_REPO} to ${BUILDDIR}"
git \
clone \
--single-branch \
--branch="${BRANCH}" \
2025-08-29 08:51:05 -04:00
"${GIT_REPO}" \
"${BUILDDIR}"
2025-08-29 08:51:05 -04:00
cd "${BUILDDIR}"
git log HEAD^1..
2025-08-29 08:51:05 -04:00
mkdir "/build"
if [ -e /usr/bin/apt-get ]; then
make deb
find /tmp/ \
-type f \
-name "*.deb" \
-not -name "*dbgsym*" \
-exec cp -v {} /build/ \;
2025-08-29 08:51:05 -04:00
exit 0
elif [ -e /usr/bin/dnf ]; then
make rpm
find /tmp/ \
-type f \
-name "*.rpm" \
-not -name "*sym*" \
-not -name "*src.rpm" \
-exec cp -v {} /build/ \;
2025-08-29 08:51:05 -04:00
exit 0
elif [ -e /usr/bin/yum ]; then
. /opt/rh/devtoolset-9/enable
make rpm
find /tmp/ \
-type f \
-name "*.rpm" \
-not -name "*sym*" \
-not -name "*src.rpm" \
-exec cp -v {} /build/ \;
2025-08-29 08:51:05 -04:00
exit 0
elif [ -e /sbin/apk ]; then
echo "NOT YET SUPPORTED"
elif [ -e /usr/sbin/pkg ]; then
echo "NOT YET SUPPORTED"
2025-08-29 08:51:05 -04:00
else
echo "NOT YET SUPPORTED"
fi
2025-08-29 08:51:05 -04:00
exit 1