updates for rpm distros

master
Marc Wäckerlin 8 years ago
parent 82758ea471
commit 2f91e2fe44
  1. 7
      scripts/ax_init_standard_project.m4
  2. 17
      scripts/build-in-docker.sh

@ -196,7 +196,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
CHANGELOG=$(<ChangeLog)
AC_SUBST(CHANGELOG)
_AM_SUBST_NOTMAKE([CHANGELOG])
DEB_CHANGELOG=$(sed '/^[[^\t]]/{h;N;d};/^\t\* /{s,,,;H;g;s,^,\t* ,;s,\n\([[^ ]]*\) *, \1\n\t ,}' ChangeLog)
DEB_CHANGELOG=$(sed '/^[[^\t]]/{h;N;d};s,\t, ,g;/^ \* /{s,,,;H;g;s,^, * ,;s,\n\([[^ ]]*\) *, \1\n ,}' ChangeLog)
if test -z "$DEB_CHANGELOG"; then
DEB_CHANGELOG=" * see file ChangeLog and project management web site"
fi
@ -206,7 +206,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AUTHOR_NAME=$(echo $AUTHOR | sed 's, *[[<(]].*$,,')
AUTHOR_URL=$(echo $AUTHOR | sed 's,.*(\(http[[^)]]*\)).*,\1,')
AUTHOR_MAIL=$(echo $AUTHOR | sed 's,.*<\(.*@.*\)>.*,\1,')
PACKAGER=$(gpg -K 2>/dev/null | sed -n 's,uid *\(\[[ultimate\]] *\)\?,,p' | head -1)
PACKAGER=$(gpg -K --lock-never 2>/dev/null | sed -n 's,uid *\(\[[ultimate\]] *\)\?,,p' | head -1)
if -z "${PACKAGER}"; then
PACKAGER="$AUTHOR"
fi
@ -220,6 +220,8 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
SOURCE_DOWNLOAD="${SOURCE_DOWNLOAD:-${AUTHOR_URL}/downloads/${PACKAGE_NAME}}"
AX_SUBST(PROJECT_URL)
AX_SUBST(SOURCE_DOWNLOAD)
VENDOR=$((lsb_release -is 2>/dev/null || echo unknown) | tr ' ' '_')
AX_SUBST(VENDOR)
DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null)
AX_SUBST(DISTRO)
ARCH=$((@<:@@<:@ $(uname -sm) =~ 64 @:>@@:>@ && echo amd64) || (@<:@@<:@ $(uname -sm) =~ 'i?86' @:>@@:>@ && echo i386 || uname -sm))
@ -560,6 +562,7 @@ AC_DEFUN([AX_USE_RPM_PACKAGING], [
EXTRA_DIST += \${PACKAGE_NAME}.spec.in
rpm: dist
rpmbuild -ba --define "_topdir \$\$(pwd)" --define "_sourcedir \$\$(pwd)" \${PACKAGE_NAME}.spec
rpmsign --define "_gpg_name \${PACKAGER}" --addsign RPMS/*/*.rpm SRPMS/*.rpm
clean-rpm-targets:
-rm -rf BUILD BUILDROOT RPMS SPECS SRPMS
distclean-rpm-targets:

@ -158,7 +158,8 @@ function traperror() {
read
fi
echo -n " ... cleanup docker: "
docker rm -f "${DOCKER_ID}"
docker stop "${DOCKER_ID}" || true
docker rm "${DOCKER_ID}"
echo "returning status: $e"
echo "--->"
exit $e
@ -242,7 +243,7 @@ case $mode in
done
docker exec ${DOCKER_ID} ./resolve-debbuilddeps.sh
;;
(rpm|yum|dnf|zypper)
(rpm|yum|dnf|zypper|urpmi)
if [[ "$img" =~ "centos" ]]; then
docker exec ${DOCKER_ID} yum install -y redhat-lsb
docker exec -i ${DOCKER_ID} bash -c 'cat > /etc/yum.repos.d/wandisco-svn.repo' <<EOF
@ -255,8 +256,18 @@ enabled=1
gpgcheck=0
EOF
fi
UPDATE_TOOL=$((docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo urpmi.update -a) || true)
if test -n "${UPDATE_TOOL}"; then
docker exec ${DOCKER_ID} ${UPDATE_TOOL}
fi
INSTALL_TOOL=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper install -y) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf install -y) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo yum install -y) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo urpmi --auto))
docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig
docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig wget
i=0
for repo in "${repos[@]}"; do
INSTALL_REPO=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper ar) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo wget -O/etc/yum.repos.d/additional$i.repo) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo true))
ifthenelse "${repo}" "${INSTALL_REPO} ARG"
((++i))
done
docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -c
TGZFILE=$(grep PACKAGE_STRING= configure | sed "s, ,-,g;s,PACKAGE_STRING=',,g;s,',.tar.gz,g")
touch $TGZFILE

Loading…
Cancel
Save