fix rpm i.e. fedora / centos build

master
Marc Wäckerlin 8 years ago
parent 64168e00bc
commit 5516fb2e1f
  1. 26
      scripts/ax_init_standard_project.m4
  2. 15
      scripts/bootstrap.sh
  3. 8
      scripts/build-in-docker.sh
  4. 11
      scripts/resolve-debbuilddeps.sh
  5. 9
      scripts/resolve-rpmbuilddeps.sh

@ -456,6 +456,12 @@ AC_DEFUN([AX_USE_NODEJS], [
[${PATH}${PATH_SEPARATOR}${ANDROID_HOME}/tools]) [${PATH}${PATH_SEPARATOR}${ANDROID_HOME}/tools])
AC_CONFIG_FILES([nodejs/package.json]) AC_CONFIG_FILES([nodejs/package.json])
AC_CONFIG_FILES([nodejs/makefile]) AC_CONFIG_FILES([nodejs/makefile])
if test -z "${DEB_SECTION}"; then
AX_DEB_SECTION([web])
fi
if test -z "${RPM_GROUP}"; then
AX_RPM_GROUP([Applications/Internet])
fi
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-nodejs-targets], [nodejs/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-nodejs-targets], [nodejs/makefile.in])
test -f nodejs/makefile.in && cat >> nodejs/makefile.in <<EOF test -f nodejs/makefile.in && cat >> nodejs/makefile.in <<EOF
#### Begin: Appended by $0 #### Begin: Appended by $0
@ -494,6 +500,12 @@ EOF
# use this in configure.ac to support HTML data for webservers # use this in configure.ac to support HTML data for webservers
AC_DEFUN([AX_BUILD_HTML], [ AC_DEFUN([AX_BUILD_HTML], [
AC_CONFIG_FILES([html/makefile]) AC_CONFIG_FILES([html/makefile])
if test -z "${DEB_SECTION}"; then
AX_DEB_SECTION([web])
fi
if test -z "${RPM_GROUP}"; then
AX_RPM_GROUP([Applications/Internet])
fi
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-html-targets], [html/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-html-targets], [html/makefile.in])
test -f html/makefile.in && cat >> html/makefile.in <<EOF test -f html/makefile.in && cat >> html/makefile.in <<EOF
#### Begin: Appended by $0 #### Begin: Appended by $0
@ -521,6 +533,12 @@ AC_DEFUN([AX_USE_LIBTOOL], [
AC_SUBST(LIB_VERSION) AC_SUBST(LIB_VERSION)
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_CONFIG_FILES([src/${PACKAGE_NAME}.pc]) AC_CONFIG_FILES([src/${PACKAGE_NAME}.pc])
if test -z "${DEB_SECTION}"; then
AX_DEB_SECTION([devel])
fi
if test -z "${RPM_GROUP}"; then
AX_RPM_GROUP([Development/Libraries])
fi
AX_ADD_MAKEFILE_TARGET_DEP([install-data-am], [install-data-libtool-pkg], [src/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([install-data-am], [install-data-libtool-pkg], [src/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([uninstall-am], [uninstall-data-am], [src/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([uninstall-am], [uninstall-data-am], [src/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([uninstall-data-am], [uninstall-data-libtool-pkg], [src/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([uninstall-data-am], [uninstall-data-libtool-pkg], [src/makefile.in])
@ -538,7 +556,11 @@ EOF
]) ])
# use this in configure.ac to support debian packages # use this in configure.ac to support debian packages
# - $1: optional debian package section
AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [ AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [
if test -n "$1"; then
AX_DEB_SECTION([$1])
fi
if test -f README.md; then if test -f README.md; then
README_DEB=$(tail -n +3 README.md | sed -e 's/^ *$/./g' -e 's/^/ /g') README_DEB=$(tail -n +3 README.md | sed -e 's/^ *$/./g' -e 's/^/ /g')
else else
@ -563,7 +585,11 @@ EOF
]) ])
# use this in configure.ac to support RPM packages # use this in configure.ac to support RPM packages
# - $1: optional rpm package group
AC_DEFUN([AX_USE_RPM_PACKAGING], [ AC_DEFUN([AX_USE_RPM_PACKAGING], [
if test -n "$1"; then
AX_RPM_GROUP([$1])
fi
AC_CONFIG_FILES([${PACKAGE_NAME}.spec]) AC_CONFIG_FILES([${PACKAGE_NAME}.spec])
#AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in]) #AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in])

@ -1629,15 +1629,19 @@ BuildRequires: which, pkgconfig, gnupg, expect, ${VCSDEPENDS_RPM}make, automake,
if testtag AX_USE_PERLDOC; then if testtag AX_USE_PERLDOC; then
echo -n ", libpod-tree-perl"; echo -n ", libpod-tree-perl";
fi fi
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then
echo -n ", qt-devel, libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel";
fi
) @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@ ) @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
#### os dependent definitions #### #### os dependent definitions ####
%if 0%{?suse_version} || 0%{?sles_version} %if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: lsb-release BuildRequires: lsb-release$(
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then
echo -n ", libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel libqt5-qtwebengine-devel libQt5WebKitWidgets-devel";
fi)
%else %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} %if 0%{?mageia}
BuildRequires: rpm-sign, lsb-release BuildRequires: rpm-sign, lsb-release
%else %else
@ -1820,6 +1824,9 @@ repos+=("ubuntu:::universe")
# Use Marc Wäckerlin's Repository, see https://dev.marc.waeckerlin.org # Use Marc Wäckerlin's Repository, see https://dev.marc.waeckerlin.org
repos+=("debian|ubuntu:::https://dev.marc.waeckerlin.org/repository:::https://dev.marc.waeckerlin.org/repository/@DISTRIBUTOR@/marc-waeckerlin.repo") repos+=("debian|ubuntu:::https://dev.marc.waeckerlin.org/repository:::https://dev.marc.waeckerlin.org/repository/@DISTRIBUTOR@/marc-waeckerlin.repo")
keys+=("https://dev.marc.waeckerlin.org/repository/PublicKey") keys+=("https://dev.marc.waeckerlin.org/repository/PublicKey")
# centos requires epel-release for some packages, such as Qt WebKit
packages+=("centos:::epel-release")
EOF EOF
#### Cleanup If Makefile Exists #### #### Cleanup If Makefile Exists ####

@ -90,7 +90,7 @@ while test $# -gt 0; do
img="mwaeckerlin/ubuntu:latest"; host="${host:---host=i686-w64-mingw32}" img="mwaeckerlin/ubuntu:latest"; host="${host:---host=i686-w64-mingw32}"
targets="all install" targets="all install"
flags+=("--prefix=/workdir/usr") flags+=("--prefix=/workdir/usr")
packages1=("mingw-w64") packages+=("mingw-w64")
;; ;;
(*) (*)
echo "**** ERROR: unknown mode '$1', try --help" 1>&2 echo "**** ERROR: unknown mode '$1', try --help" 1>&2
@ -300,6 +300,12 @@ EOF
ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'" ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'"
((++i)) ((++i))
done done
for package in "${packages[@]}"; do
ifthenelse "${package}" "${INSTALL_TOOL} ARG"
done
for command in "${commands[@]}"; do
ifthenelse "${command}" "ARG"
done
docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh
;; ;;
esac esac

@ -36,10 +36,7 @@ DEPS=
if test -e debian/control.in -a ! -e debian/control; then if test -e debian/control.in -a ! -e debian/control; then
function pkg_exists() { function pkg_exists() {
test -n "$(${DO} apt-cache policy -q ${1})" \ test -n "$(${DO} apt-cache policy -q ${1})"
&& ((! $(${DO} apt-cache policy ${1} 2>&1 \
| grep -q 'N: Unable to locate package')) \
&& (! ${DO} dpkg -l "${1}" 1>&2 > /dev/null))
} }
function AX_PKG_CHECK() { function AX_PKG_CHECK() {
local DEV_DEB_DIST_PKG= local DEV_DEB_DIST_PKG=
@ -127,4 +124,10 @@ if test -n "${TO_INSTALL}" && ! install ${TO_INSTALL}; then
exit 1 exit 1
fi fi
FILES="$(LANG= ${DO} dpkg-checkbuilddeps 2>&1 | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}')"
if test -n "${FILES}"; then
echo "**** ERROR: Cannot install: " $FILES
exit 1
fi
echo "**** Success: All Dependencies Resolved" echo "**** Success: All Dependencies Resolved"

@ -107,5 +107,14 @@ else
fi fi
fi 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')
else
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
fi
if test -n "${FILES}"; then
echo "**** ERROR: Cannot install: " $FILES
exit 1
fi
echo "**** Success: All Dependencies Resolved" echo "**** Success: All Dependencies Resolved"

Loading…
Cancel
Save