fix rpm builds
This commit is contained in:
@@ -1066,13 +1066,16 @@ AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [
|
||||
|
||||
# Check if a package exists in the current distribution, if yes, require it
|
||||
# in debian/control.in append @DEB_DEPEND_IFEXISTS@ to Build-Depends
|
||||
# if you pass a list, it will require the first matching, if any matches
|
||||
# - parameter:
|
||||
# $1 = package name
|
||||
# $1 = space separated list of package names
|
||||
AC_DEFUN([AX_DEB_DEPEND_IFEXISTS], [
|
||||
pkg="$1"
|
||||
if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then
|
||||
DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}"
|
||||
fi
|
||||
for pkg in $1; do
|
||||
if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then
|
||||
DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
# require package in debian/control.in append @DEB_BUILD_DEPEND@ to Build-Depends
|
||||
@@ -1109,17 +1112,19 @@ AC_DEFUN([AX_DEB_RESOLVE], [
|
||||
|
||||
# Check if a package exists in the current distribution, if yes, require it
|
||||
# in .spec.in append @RPM_DEPEND_IFEXISTS@ to Build-Depends
|
||||
# if you pass a list, it will require the first matching, if any matches
|
||||
# - parameter:
|
||||
# $1 = package name
|
||||
# $1 = space separated package names
|
||||
AC_DEFUN([AX_RPM_DEPEND_IFEXISTS], [
|
||||
pkg="$1"
|
||||
|
||||
if (test -x /usr/bin/zypper && zypper search -x "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/dnf && dnf list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/yum && yum list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/sbin/urpmq && urpmq "$pkg" 1>&2 > /dev/null); then
|
||||
RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}"
|
||||
fi
|
||||
for pkg in $1; do
|
||||
if (test -x /usr/bin/zypper && zypper search -x "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/dnf && dnf list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/yum && yum list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/sbin/urpmq && urpmq "$pkg" 1>&2 > /dev/null); then
|
||||
RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
# require package in .spec.in append @RPM_BUILD_DEPEND@ to Build-Depends
|
||||
@@ -1160,36 +1165,23 @@ AC_DEFUN([AX_RPM_RESOLVE], [
|
||||
|
||||
# Check if a package exists in the current distribution, if yes, require it
|
||||
# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
|
||||
# if you pass a list, it will require the first matching, if any matches
|
||||
# - parameter:
|
||||
# $1 = package name
|
||||
# $1 = space separated list of package names
|
||||
AC_DEFUN([AX_ALL_DEPEND_IFEXISTS], [
|
||||
pkg="$1"
|
||||
if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then
|
||||
DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}"
|
||||
fi
|
||||
if (test -x /usr/bin/zypper && zypper search -x "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/dnf && dnf list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/yum && yum list -q "$pkg" 1>&2 > /dev/null) || \
|
||||
(test -x /usr/sbin/urpmq && urpmq "$pkg" 1>&2 > /dev/null); then
|
||||
RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}"
|
||||
fi
|
||||
AX_DEB_DEPEND_IFEXISTS([$1])
|
||||
AX_RPM_DEPEND_IFEXISTS([$1])
|
||||
])
|
||||
|
||||
# Check if a package exists in the current distribution, if yes, require it
|
||||
# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
|
||||
# if you pass a list, it will require the first matching, if any matches
|
||||
# - parameter:
|
||||
# $1 = package name
|
||||
AC_DEFUN([AX_ALL_DEPEND_IFEXISTS_DEV], [
|
||||
pkg="$1"
|
||||
if test -n "$(apt-cache policy -q ${pkg}-dev 2> /dev/null)"; then
|
||||
DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}-dev"
|
||||
fi
|
||||
if (test -x /usr/bin/zypper && zypper search -x "$pkg"-devel 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/dnf && dnf list -q "$pkg"-devel 1>&2 > /dev/null) || \
|
||||
(test -x /usr/bin/yum && yum list -q "$pkg"-devel 1>&2 > /dev/null) || \
|
||||
(test -x /usr/sbin/urpmq && urpmq "$pkg"-devel 1>&2 > /dev/null); then
|
||||
RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}-devel"
|
||||
fi
|
||||
pkgs="$1"
|
||||
AX_DEB_DEPEND_IFEXISTS([${pkgs// /-dev }-dev])
|
||||
AX_RPM_DEPEND_IFEXISTS([${pkgs// /-devel }-devel])
|
||||
])
|
||||
|
||||
# require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends
|
||||
|
@@ -1678,7 +1678,7 @@ fi)
|
||||
$(if testtag AX_RPM_DEPEND; then echo "Requires: @RPM_DEPEND@"; fi)
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildRequires: which, pkgconfig, pandoc, gnupg, expect, ${VCSDEPENDS_RPM}make, automake, autoconf, rpm-build$(
|
||||
BuildRequires: which, pkgconfig, gnupg, expect, ${VCSDEPENDS_RPM}make, automake, autoconf, rpm-build$(
|
||||
if testtag AX_USE_CXX; then
|
||||
echo -n ", binutils-devel, gcc-c++"
|
||||
fi
|
||||
@@ -1700,13 +1700,17 @@ BuildRequires: lsb-release$(
|
||||
echo -n ", libqt5-qtbase-devel, libqt5-qttools, libqt5-linguist-devel, libQt5WebKit5-devel libqt5-qtwebengine-devel libQt5WebKitWidgets-devel";
|
||||
fi)
|
||||
%else
|
||||
%if 0%{?mageia}
|
||||
BuildRequires: rpm-sign, lsb-release
|
||||
$(
|
||||
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then
|
||||
echo -n "BuildRequires: qtbase5-common-devel, qttools5, lib64qt5webkit-devel, lib64qt5webkitwidgets-devel";
|
||||
fi)
|
||||
%else
|
||||
$(
|
||||
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then
|
||||
echo -n "BuildRequires: qt5-qtbase-devel, qt5-qttools-devel, qt5-qtwebkit-devel";
|
||||
fi)
|
||||
%if 0%{?mageia}
|
||||
BuildRequires: rpm-sign, lsb-release
|
||||
%else
|
||||
BuildRequires: rpm-sign, redhat-lsb
|
||||
%global debug_package %{nil}
|
||||
%endif
|
||||
@@ -1715,6 +1719,9 @@ $(
|
||||
if testtag AX_USE_DOXYGEN; then cat <<EOS
|
||||
%if ! 0%{?centos}
|
||||
BuildRequires: mscgen
|
||||
%if ! 0%{?mageia}
|
||||
BuildRequires: pandoc
|
||||
%endif
|
||||
%endif
|
||||
EOS
|
||||
fi
|
||||
|
@@ -248,16 +248,18 @@ case $mode in
|
||||
docker exec ${DOCKER_ID} update-locale LANG=${LANG}
|
||||
fi
|
||||
OPTIONS='-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew -y --force-yes --no-install-suggests --no-install-recommends'
|
||||
for f in 'libpam-systemd:amd64' 'policykit*' 'colord'; do
|
||||
PREVENT='libpam-systemd- policykit*- colord-'
|
||||
for f in 'libpam-systemd' 'policykit*' 'colord'; do
|
||||
docker exec ${DOCKER_ID} bash -c "echo 'Package: $f' >> /etc/apt/preferences"
|
||||
docker exec ${DOCKER_ID} bash -c "echo 'Pin-Priority: -100' >> /etc/apt/preferences"
|
||||
docker exec ${DOCKER_ID} bash -c "echo >> /etc/apt/preferences"
|
||||
done
|
||||
docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
|
||||
docker exec ${DOCKER_ID} apt-mark hold 'libpam-systemd' 'policykit*' 'colord'
|
||||
docker exec ${DOCKER_ID} apt-get upgrade ${OPTIONS}
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release wget || \
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release wget || \
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release wget;
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT} python-software-properties software-properties-common apt-transport-https dpkg-dev lsb-release wget || \
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT} software-properties-common apt-transport-https dpkg-dev lsb-release wget || \
|
||||
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT} python-software-properties apt-transport-https dpkg-dev lsb-release wget;
|
||||
for key in "${keys[@]}"; do
|
||||
wget -O- "$key" \
|
||||
| docker exec -i ${DOCKER_ID} apt-key add -
|
||||
@@ -267,7 +269,7 @@ case $mode in
|
||||
done
|
||||
docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
|
||||
for package in "${packages[@]}"; do
|
||||
ifthenelse "${package}" "apt-get install ${OPTIONS} ARG"
|
||||
ifthenelse "${package}" "apt-get install ${OPTIONS} ${PREVENT} ARG"
|
||||
done
|
||||
for command in "${commands[@]}"; do
|
||||
ifthenelse "${command}" "ARG"
|
||||
@@ -294,11 +296,14 @@ EOF
|
||||
LSB_RELEASE=/usr/bin/lsb_release
|
||||
fi
|
||||
docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig wget $LSB_RELEASE
|
||||
if docker exec ${DOCKER_ID} test -x /usr/bin/dnf; then
|
||||
docker exec ${DOCKER_ID} dnf install -y 'dnf-command(config-manager)'
|
||||
fi
|
||||
i=0
|
||||
for key in "${keys[@]}"; do
|
||||
wget -Orpm-key "$key"
|
||||
docker exec -i ${DOCKER_ID} wget -Orpm-key "$key"
|
||||
docker exec -i ${DOCKER_ID} rpm --import rpm-key
|
||||
rm rpm-key
|
||||
docker exec -i ${DOCKER_ID} rm rpm-key
|
||||
done
|
||||
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 false))
|
||||
|
@@ -24,7 +24,7 @@ else
|
||||
fi
|
||||
|
||||
function install() {
|
||||
if ${SUDO} apt-get -y install $*; then
|
||||
if ${SUDO} apt-get install -y --force-yes --no-install-suggests --no-install-recommends $*; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
@@ -97,12 +97,12 @@ fi
|
||||
|
||||
if test -n "${SCHROOTNAME}"; then
|
||||
FILES=$(LANG= schroot -c ${SCHROOTNAME} -- rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
|
||||
if test -n "${FILES}"; then
|
||||
if test -n "${FILES}${DEPS}"; then
|
||||
schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} ${FILES} ${DEPS}
|
||||
fi
|
||||
else
|
||||
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
|
||||
if test -n "${FILES}"; then
|
||||
if test -n "${FILES}${DEPS}"; then
|
||||
${INSTALL_TOOL} ${FILES} ${DEPS}
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user