From 8080633f5db624b1a553e7a0473c7fb27a0805f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 7 Dec 2016 20:21:54 +0000 Subject: [PATCH] tested on mageia 5 :) --- build-in-docker.sh | 4 ++-- mrw-c++.spec.in | 9 +++++++-- resolve-rpmbuilddeps.sh | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build-in-docker.sh b/build-in-docker.sh index 77b27f5..38a6c61 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -255,8 +255,8 @@ enabled=1 gpgcheck=0 EOF fi - INSTALL_TOOL=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo yum)) - docker exec ${DOCKER_ID} ${INSTALL_TOOL} install -y rpm-build automake libtool subversion gcc-c++ pkgconfig + 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 -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 diff --git a/mrw-c++.spec.in b/mrw-c++.spec.in index f0812e2..3b12eda 100644 --- a/mrw-c++.spec.in +++ b/mrw-c++.spec.in @@ -10,8 +10,13 @@ BuildRequires: rpm-build, subversion, automake, autoconf, doxygen, java-openjdk, BuildRequires: graphviz %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} -BuildRequires: which, pkgconfig, cppunit-devel, redhat-lsb, libtool-ltdl-devel +%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} || 0%{?mageia} +BuildRequires: which, pkgconfig, cppunit-devel +%if 0%{?mageia} +BuildRequires: lsb-release, libltdl-devel +%else +BuildRequires: redhat-lsb, libtool-ltdl-devel +%endif %if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} ) BuildRequires: mscgen %endif diff --git a/resolve-rpmbuilddeps.sh b/resolve-rpmbuilddeps.sh index 6859f1a..5c1e968 100755 --- a/resolve-rpmbuilddeps.sh +++ b/resolve-rpmbuilddeps.sh @@ -10,19 +10,19 @@ ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 -INSTALL_TOOL=${INSTALL_TOOL:-$((test -x /usr/bin/zypper && echo zypper) || (test -x /usr/bin/dnf && echo dnf) || (test -x /usr/bin/yum && echo yum))} +INSTALL_TOOL=${INSTALL_TOOL:-$((test -x /usr/bin/zypper && echo zypper install -y) || (test -x /usr/bin/dnf && echo dnf install -y) || (test -x /usr/bin/yum && echo yum install -y) || (test -x /usr/sbin/urpmi && echo urpmi --auto))} SCHROOTNAME="$1" PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac) 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 - schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} install -y ${FILES} + schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} ${FILES} 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 - ${INSTALL_TOOL} install -y ${FILES} + ${INSTALL_TOOL} ${FILES} fi fi