tested all rpm builds

master
Marc Wäckerlin 8 years ago
parent 11bc2bafe2
commit 4a063cc022
  1. 284
      ax_init_standard_project.m4
  2. 39
      bootstrap.sh
  3. 1
      build-in-docker.conf
  4. 26
      build-in-docker.sh
  5. 10
      configure.ac
  6. 8
      debian/control.in
  7. 37
      mrw-c++.spec.in
  8. 14
      resolve-debbuilddeps.sh
  9. 29
      resolve-rpmbuilddeps.sh
  10. 14
      rpmsign.exp

@ -570,7 +570,7 @@ AC_DEFUN([AX_USE_RPM_PACKAGING], [
EXTRA_DIST += \${PACKAGE_NAME}.spec.in EXTRA_DIST += \${PACKAGE_NAME}.spec.in
rpm: dist rpm: dist
rpmbuild -ba --define "_topdir \$\$(pwd)" --define "_sourcedir \$\$(pwd)" \${PACKAGE_NAME}.spec rpmbuild -ba --define "_topdir \$\$(pwd)" --define "_sourcedir \$\$(pwd)" \${PACKAGE_NAME}.spec
rpmsign --define "_gpg_name \${PACKAGER}" --addsign RPMS/*/*.rpm SRPMS/*.rpm ./rpmsign.exp "\${PACKAGER}" "\{PASSWORD}" RPMS/*/*.rpm SRPMS/*.rpm
clean-rpm-targets: clean-rpm-targets:
-rm -rf BUILD BUILDROOT RPMS SPECS SRPMS -rm -rf BUILD BUILDROOT RPMS SPECS SRPMS
distclean-rpm-targets: distclean-rpm-targets:
@ -802,6 +802,120 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_MSG_ERROR([Feature $1 not found please install module $secondpar]) AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
fi fi
fi fi
AX_DEB_DEPEND([${$1_found}])
AX_RPM_DEPEND([${$1_found}])
[$1]_CPPFLAGS="${$1_CFLAGS}"
[$1]_CXXFLAGS="${$1_CFLAGS}"
AC_SUBST([$1]_CPPFLAGS)
AC_SUBST([$1]_CXXFLAGS)
if test "${optional_flags/manualflags/}" = "${optional_flags}"; then
CPPFLAGS+=" ${$1_CPPFLAGS}"
CXXFLAGS+=" ${$1_CXXFLAGS}"
LIBS+=" ${$1_LIBS}"
AC_MSG_NOTICE([Adding flags for $1])
else
AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS])
fi
])
# require a specific development package, with fallback: test for a header
# - parameter:
# $1 = unique id (no special characters)
# $2 = module name (optional, if different from id)
# $3 = a header file to find (optional)
# $4 = alternative module names (space separated, optional)
# $5 = optional flags:
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
#
# uses PKG_CHECK_MODULES to test for a module
# then, if given, looks for the header file
# if header file is not found, searches in alternative modules
# sets all flags, so that the module can be used everywhere
# fails if not found
AC_DEFUN([AX_PKG_REQUIRE_DEV], [
PKG_PROG_PKG_CONFIG
optional_flags="$5"
$1_found=no
secondpar="m4_default([$2], [$1])"
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
$1_found=$secondpar
PKG_REQUIREMENTS+=" $secondpar"
], [
if test -n "$4"; then
AC_MSG_WARN([Recommended package $secondpar for feature $1 not installed, trying $4])
for pkg in $4; do
PKG_CHECK_MODULES([$1], [$pkg], [
PKG_REQUIREMENTS+=" $pkg"
$1_found=$pkg
break;
], [
AC_MSG_WARN([Recommended package $pkg for feature $1 not installed])
])
done
fi
])
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then
if test "${$1_found}" = "no"; then
tmp_package="yes"
else
tmp_package=${$1_found}
fi
$1_found=no
old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER([$3], [
$1_found=${tmp_package}
], [
for x in ${$1_CFLAGS}; do
AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
for f in $(find ${x[#]-I} -name "$3" 2> /dev/null); do
if test -f "$f"; then
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
fi
done
if test "${$1_found}" != "no"; then
break;
fi
done
if test "${$1_found}" = "no"; then
tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package)
for x in ${tmp_includedir}; do
AC_MSG_NOTICE([search for $3 in $x])
for f in $(find ${x} -name "$3" 2> /dev/null); do
if test -f "$f"; then
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
fi
done
if test "${$1_found}" != "no"; then
break;
fi
done
fi
])
CPPFLAGS=${old_CPPFLAGS}
fi
if test "${$1_found}" = "no"; then
if test -n "$3"; then
if test -n "$4"; then
AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $secondpar or $4])
else
AC_MSG_ERROR([Feature $1 not found, need header $3 in module $secondpar])
fi
else
AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
fi
fi
AX_DEB_BUILD_DEPEND([${$1_found}-dev])
AX_RPM_BUILD_DEPEND([${$1_found}-devel])
[$1]_CPPFLAGS="${$1_CFLAGS}" [$1]_CPPFLAGS="${$1_CFLAGS}"
[$1]_CXXFLAGS="${$1_CFLAGS}" [$1]_CXXFLAGS="${$1_CFLAGS}"
AC_SUBST([$1]_CPPFLAGS) AC_SUBST([$1]_CPPFLAGS)
@ -851,6 +965,52 @@ AC_DEFUN([AX_PKG_CHECK], [
], [ ], [
HAVE_$1=0 HAVE_$1=0
]) ])
AX_DEB_BUILD_DEPEND(m4_default([$2], [$1]))
AX_RPM_BUILD_DEPEND(m4_default([$2], [$1]))
AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
AC_SUBST(HAVE_$1)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
])
# check if a specific development package exists
# - parameter:
# $1 = unique id (no special characters)
# $2 = module name (optional, if different from id)
# $3 = optional flags:
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
#
# uses PKG_CHECK_MODULES to test for a module
# sets automake conditional HAVE_$1 to 0 (not found) or 1 (found)
# sets all flags, so that the module can be used everywhere
AC_DEFUN([AX_PKG_CHECK_DEV], [
optional_flags="$3"
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
HAVE_$1=1
[$1]_CPPFLAGS="${$1_CFLAGS}"
[$1]_CXXFLAGS="${$1_CFLAGS}"
AC_SUBST([$1]_CPPFLAGS)
AC_SUBST([$1]_CXXFLAGS)
if test "${optional_flags/manualflags/}" = "${optional_flags}"; then
CPPFLAGS+=" ${$1_CPPFLAGS}"
CXXFLAGS+=" ${$1_CXXFLAGS}"
LIBS+=" ${$1_LIBS}"
AC_MSG_NOTICE([Adding flags for $1])
else
AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS])
fi
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="m4_default([$2], [$1])"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, m4_default([$2], [$1])"
fi
], [
HAVE_$1=0
])
AX_DEB_BUILD_DEPEND(m4_default([$2], [$1])-dev)
AX_RPM_BUILD_DEPEND(m4_default([$2], [$1])-devel)
AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
AC_SUBST(HAVE_$1) AC_SUBST(HAVE_$1)
AC_SUBST(CPPFLAGS) AC_SUBST(CPPFLAGS)
@ -1018,3 +1178,125 @@ AC_DEFUN([AX_DEB_RESOLVE], [
AC_SUBST(DEB_SECTION) AC_SUBST(DEB_SECTION)
AC_SUBST(DEB_DEPEND_IFEXISTS) AC_SUBST(DEB_DEPEND_IFEXISTS)
]) ])
# Check if a package exists in the current distribution, if yes, require it
# in .spec.in append @RPM_DEPEND_IFEXISTS@ to Build-Depends
# - parameter:
# $1 = package name
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
])
# require package in .spec.in append @RPM_BUILD_DEPEND@ to Build-Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_RPM_BUILD_DEPEND], [
pkg="$1"
RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}"
])
# require package in .spec.in append @RPM_DEPEND@ to Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_RPM_DEPEND], [
pkg="$1"
if test -z "${RPM_DEPEND}"; then
RPM_DEPEND="${pkg}"
else
RPM_DEPEND="${RPM_DEPEND}, ${pkg}"
fi
])
# require package in debian/control.in append @DEB_DEPEND@ to Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_RPM_GROUP], [
pkg="$1"
RPM_GROUP="${pkg}"
])
# call after setting rpmian dependencies
AC_DEFUN([AX_RPM_RESOLVE], [
AC_SUBST(RPM_BUILD_DEPEND)
AC_SUBST(RPM_DEPEND)
AC_SUBST(RPM_GROUP)
AC_SUBST(RPM_DEPEND_IFEXISTS)
])
# Check if a package exists in the current distribution, if yes, require it
# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
# - parameter:
# $1 = package name
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
])
# Check if a package exists in the current distribution, if yes, require it
# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
# - 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
])
# require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_ALL_BUILD_DEPEND], [
pkg="$1"
DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}"
RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}"
])
# require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_ALL_BUILD_DEPEND_DEV], [
pkg="$1"
DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}-dev"
RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}-devel"
])
# require package in .spec.in append @ALL_DEPEND@ to Depends
# - parameter:
# $1 = package name
AC_DEFUN([AX_ALL_DEPEND], [
pkg="$1"
DEB_DEPEND="${DEB_DEPEND}, ${pkg}"
if test -z "${RPM_DEPEND}"; then
RPM_DEPEND="${pkg}"
else
RPM_DEPEND="${RPM_DEPEND}, ${pkg}"
fi
])
AC_DEFUN([AX_OUTPUT], [
AX_DEB_RESOLVE
AX_RPM_RESOLVE
AC_OUTPUT
])

@ -134,6 +134,7 @@ GENERATED FILES
* resolve-rpmbuilddeps.sh - script to install RPM package dependencies * resolve-rpmbuilddeps.sh - script to install RPM package dependencies
* build-in-docker.sh - script to build the project encapsulated in a docker container * build-in-docker.sh - script to build the project encapsulated in a docker container
* build-in-docker.conf - additional configuration for build-in-docker.sh * build-in-docker.conf - additional configuration for build-in-docker.sh
* rpmsign.exp - script for signing rpms unattended
* build-resource-file.sh - build resource.qrc file from a resource directory * build-resource-file.sh - build resource.qrc file from a resource directory
* sql-to-dot.sed - script to convert SQL schema files to graphviz dot in doxygen * sql-to-dot.sed - script to convert SQL schema files to graphviz dot in doxygen
* mac-create-app-bundle.sh - script to create apple mac os-x app-bundle * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
@ -375,7 +376,7 @@ run() {
testtag() { testtag() {
local IFS="|" local IFS="|"
egrep -q '^ *'"($*)" configure.ac egrep -q '^ *'"($*)"' *(\(.*)? *$' configure.ac
} }
contains() { contains() {
@ -539,6 +540,7 @@ copy makefile_test.inc.am
copy resolve-debbuilddeps.sh copy resolve-debbuilddeps.sh
copy resolve-rpmbuilddeps.sh copy resolve-rpmbuilddeps.sh
copy build-in-docker.sh copy build-in-docker.sh
copy rpmsign.exp
copy build-resource-file.sh copy build-resource-file.sh
copy sql-to-dot.sed copy sql-to-dot.sed
copy mac-create-app-bundle.sh copy mac-create-app-bundle.sh
@ -592,7 +594,7 @@ AX_INIT_STANDARD_PROJECT
#AX_QT_NO_KEYWORDS #AX_QT_NO_KEYWORDS
# create output # create output
AC_OUTPUT AX_OUTPUT
EOF EOF
PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac) PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac)
@ -1552,7 +1554,7 @@ $( if testtag AX_USE_LIBTOOL; then
Package: @PACKAGE_NAME@-dev Package: @PACKAGE_NAME@-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD_DEPENDS}${RUN_DEPENDS} @DEB_DEPEND@ @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@ Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD_DEPENDS}${RUN_DEPENDS} @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
Description: @DESCRIPTION@ - Development Package Description: @DESCRIPTION@ - Development Package
@README_DEB@ @README_DEB@
EOF2 EOF2
@ -1600,11 +1602,12 @@ License: LGPL
Group: $(if testtag AX_USE_LIBTOOL; then Group: $(if testtag AX_USE_LIBTOOL; then
echo Development/Libraries/C++; echo Development/Libraries/C++;
else else
echo Applications/...; echo @RPM_GROUP@;
fi) fi)
$(if testtag AX_RPM_DEPEND; then echo "Requires: @RPM_DEPEND@"; fi)
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gnupg, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$( BuildRequires: gnupg, expect, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$(
if testtag AX_USE_CXX; then if testtag AX_USE_CXX; then
echo -n ", binutils-devel, gcc-c++" echo -n ", binutils-devel, gcc-c++"
fi fi
@ -1617,7 +1620,7 @@ BuildRequires: gnupg, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$(
if testtag AX_USE_PERLDOC; then if testtag AX_USE_PERLDOC; then
echo -n ", libpod-tree-perl"; echo -n ", libpod-tree-perl";
fi fi
) ) @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
%if 0%{?fedora} != 20 %if 0%{?fedora} != 20
$(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi) $(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi)
%endif %endif
@ -1690,12 +1693,14 @@ rm -rf \$RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
echo '/usr/%_lib/@PACKAGE_NAME@.so.*' echo '/usr/%_lib/*.so.*'
else else
echo '/usr/bin/*' echo '/usr/bin/*'
echo '/usr/share/applications/*' echo '/usr/share/applications/*'
fi) fi)
/usr/share/@PACKAGE_NAME@ $(if testtag AX_USE_NODEJS AX_BUILD_HTML AX_BUILD_HTML_NPM; then
echo '/usr/share/@PACKAGE_NAME@'
fi)
%doc %doc
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
cat <<EOF2 cat <<EOF2
@ -1707,7 +1712,7 @@ $(if testtag AX_USE_LIBTOOL; then
/usr/share/doc/packages/@PACKAGE_NAME@/README /usr/share/doc/packages/@PACKAGE_NAME@/README
EOF2 EOF2
else else
echo '/usr/share/doc/packages/@PACKAGE_NAME@' echo '/usr/share'
fi) fi)
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
@ -1715,7 +1720,7 @@ cat <<EOF2
%package devel %package devel
Summary: @DESCRIPTION@ Summary: @DESCRIPTION@
Group: Development/Libraries/C++ Group: Development/Libraries/C++
Requires: @PACKAGE_NAME@ = @VERSION@ Requires: @PACKAGE_NAME@ = @VERSION@ @RPM_BUILD_DEPEND@
%description devel %description devel
@README@ @README@
@ -1724,14 +1729,18 @@ This Package contains all files required for developement.
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/%_lib/@PACKAGE_NAME@.so /usr/%_lib/*.so
/usr/%_lib/@PACKAGE_NAME@.a /usr/%_lib/*.a
/usr/%_lib/@PACKAGE_NAME@.la /usr/%_lib/*.la
/usr/%_lib/pkgconfig /usr/%_lib/pkgconfig
/usr/include/* /usr/include/*
%doc %doc
/usr/share/@PACKAGE_NAME@ $(if testtag AX_USE_DOXYGEN AX_USE_PERLDOC; then
/usr/share/doc/packages/@PACKAGE_NAME@/html echo '/usr/share/doc/packages/@PACKAGE_NAME@/html'
fi)
$(if testtag AX_BUILD_EXAMPLES; then
echo '/usr/share/doc/packages/@PACKAGE_NAME@/examples'
fi)
EOF2 EOF2
fi) fi)

@ -1 +1,2 @@
repos+=("Ubuntu:::universe") repos+=("Ubuntu:::universe")
flags+=("CentOS:::--disable-stacktrace")

@ -90,6 +90,7 @@ while test $# -gt 0; do
img="ubuntu:latest"; host="${host:---host=i686-w64-mingw32}" img="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")
;; ;;
(*) (*)
echo "**** ERROR: unknown mode '$1', try --help" 1>&2 echo "**** ERROR: unknown mode '$1', try --help" 1>&2
@ -235,7 +236,7 @@ if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then
fi fi
docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}" docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}"
case $mode in case $mode in
(deb|apt) (deb|apt|win)
if [[ "${img}" =~ "ubuntu" ]]; then if [[ "${img}" =~ "ubuntu" ]]; then
docker exec ${DOCKER_ID} locale-gen ${LANG} docker exec ${DOCKER_ID} locale-gen ${LANG}
docker exec ${DOCKER_ID} update-locale LANG=${LANG} docker exec ${DOCKER_ID} update-locale LANG=${LANG}
@ -281,7 +282,12 @@ gpgcheck=0
EOF EOF
fi 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)) 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 wget /usr/bin/lsb_release if test "$INSTALL_TOOL" = "urpmi --auto"; then
LSB_RELEASE=lsb-release
else
LSB-RELEASE=/usr/bin/lsb_release
fi
docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig wget $LSB_RELEASE
i=0 i=0
for key in "${keys[@]}"; do for key in "${keys[@]}"; do
wget -Orpm-key "$key" wget -Orpm-key "$key"
@ -295,14 +301,10 @@ EOF
done done
docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh
;; ;;
(win)
if [[ "${img}" =~ "ubuntu" ]]; then
docker exec ${DOCKER_ID} locale-gen ${LANG}
docker exec ${DOCKER_ID} update-locale LANG=${LANG}
fi
docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
docker exec ${DOCKER_ID} apt-get install -y mingw-w64
docker exec ${DOCKER_ID} ./resolve-debbuilddeps.sh
;;
esac esac
docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} ${flags[@]} FLAGS=()
for f in "${flags[@]}"; do
FLAGS+=($(ifthenelse "$f" "echo 'ARG'"))
done
docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} "${FLAGS[@]}"

@ -167,14 +167,20 @@ AC_SUBST(BOOST_THREAD_LIB)
AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB") AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB")
# special dependencies for specific distros # special dependencies for specific distros
AX_DEB_DEPEND_IFEXISTS(libiberty-dev) AX_ALL_BUILD_DEPEND_DEV(binutils)
AX_ALL_DEPEND_IFEXISTS_DEV(libiberty)
AX_DEB_BUILD_DEPEND(libboost-dev)
AX_DEB_BUILD_DEPEND(liblog4cxx-dev)
AX_DEB_BUILD_DEPEND(libz-dev)
AX_RPM_BUILD_DEPEND(boost-devel)
AX_RPM_BUILD_DEPEND(zlib-devel)
# thread options # thread options
THREADS="-pthread -D_MT" THREADS="-pthread -D_MT"
AC_SUBST(THREADS) AC_SUBST(THREADS)
# create output # create output
AC_OUTPUT AX_OUTPUT
# infos and warnings # infos and warnings
if test "$with_threads" = "no"; then if test "$with_threads" = "no"; then

8
debian/control.in vendored

@ -1,18 +1,18 @@
Source: @PACKAGE_NAME@ Source: @PACKAGE_NAME@
Priority: extra Priority: extra
Maintainer: @AUTHOR@ Maintainer: @PACKAGER@
Build-Depends: debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, lsb-release , doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev, libz-dev, binutils-dev, liblog4cxx-dev|liblog4cxx10-dev, libboost-thread-dev, pandoc @DEB_DEPEND_IFEXISTS@ Build-Depends: debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release, doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
Package: @PACKAGE_NAME@ Package: @PACKAGE_NAME@
Section: libs Section: libs
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends} @DEB_DEPEND@
Description: @DESCRIPTION@ Description: @DESCRIPTION@
@README_DEB@ @README_DEB@
Package: @PACKAGE_NAME@-dev Package: @PACKAGE_NAME@-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: @PACKAGE_NAME@ (= ${binary:Version}), debhelper, subversion, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release , doxygen, graphviz, mscgen, libcppunit-dev Depends: @PACKAGE_NAME@ (= ${binary:Version}), debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release, doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
Description: @DESCRIPTION@ - Development Package Description: @DESCRIPTION@ - Development Package
@README_DEB@ @README_DEB@

@ -4,27 +4,36 @@ Version: @VERSION@
Release: @BUILD_NUMBER@%{?dist} Release: @BUILD_NUMBER@%{?dist}
License: LGPL License: LGPL
Group: Development/Libraries/C++ Group: Development/Libraries/C++
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
BuildRequires: rpm-build, subversion, automake, autoconf, doxygen, java-openjdk, libtool, binutils-devel, gcc-c++ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gnupg, expect, subversion, make, automake, autoconf, rpm-build, binutils-devel, gcc-c++, libtool, doxygen, java-openjdk @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
%if 0%{?fedora} != 20 %if 0%{?fedora} != 20
BuildRequires: graphviz BuildRequires: graphviz
%endif %endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} || 0%{?mageia} %if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} || 0%{?mageia}
BuildRequires: which, pkgconfig, cppunit-devel BuildRequires: which, pkgconfig, cppunit-devel
%if 0%{?rhel} > 6 || 0%{?rhl} > 6 || 0%{?centos} > 6 || 0%{?fedora} || 0%{?mageia} %if 0%{?rhel} > 6 || 0%{?rhl} > 6 || 0%{?centos} > 6 || 0%{?fedora} || 0%{?mageia}
BuildRequires: rpm-sign BuildRequires: rpm-sign
%endif %endif
%if 0%{?mageia} %if 0%{?mageia}
BuildRequires: lsb-release, gnupg, libltdl-devel BuildRequires: gnupg, lsb-release, libltdl-devel
%else %else
BuildRequires: redhat-lsb, gpg, libtool-ltdl-devel BuildRequires: gpg, redhat-lsb, libtool-ltdl-devel
%endif %endif
%if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} ) %if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} )
BuildRequires: mscgen BuildRequires: mscgen
%else
%endif %endif
%else%if 0%{?suse_version} || 0%{?sles_version} %else%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: pkg-config, libcppunit-devel, lsb-release BuildRequires: pkg-config, lsb-release, libcppunit-devel
%if 0%{?suse_version} < 1200 || 0%{?sles_version} < 1200
%else
%endif
%endif%endif %endif%endif
%description %description
@ -35,7 +44,10 @@ This package contains only the shared libraries required at runtime.
%prep %prep
%setup -q %setup -q
./configure --prefix=/usr --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ --libdir=/usr/%_lib ./configure --prefix=/usr \
--sysconfdir=/etc \
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \
--libdir=/usr/%_lib
%build %build
make make
@ -48,7 +60,8 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/%_lib/lib*.so.* /usr/%_lib/*.so.*
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS /usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
/usr/share/doc/packages/@PACKAGE_NAME@/COPYING /usr/share/doc/packages/@PACKAGE_NAME@/COPYING
@ -60,7 +73,7 @@ rm -rf $RPM_BUILD_ROOT
%package devel %package devel
Summary: @DESCRIPTION@ Summary: @DESCRIPTION@
Group: Development/Libraries/C++ Group: Development/Libraries/C++
Requires: @PACKAGE_NAME@ = @VERSION@ Requires: @PACKAGE_NAME@ = @VERSION@ @RPM_BUILD_DEPEND@
%description devel %description devel
@README@ @README@
@ -69,11 +82,11 @@ This Package contains all files required for developement.
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/%_lib/lib*.so /usr/%_lib/*.so
/usr/%_lib/lib*.a /usr/%_lib/*.a
/usr/%_lib/lib*.la /usr/%_lib/*.la
/usr/%_lib/pkgconfig /usr/%_lib/pkgconfig
/usr/include/ /usr/include/*
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/html /usr/share/doc/packages/@PACKAGE_NAME@/html
/usr/share/doc/packages/@PACKAGE_NAME@/examples /usr/share/doc/packages/@PACKAGE_NAME@/examples

@ -35,16 +35,24 @@ TO_INSTALL=
DEPS= DEPS=
if test -e debian/control.in -a ! -e debian/control; then if test -e debian/control.in -a ! -e debian/control; then
for f in $(sed -n 's, *AX_DEB_DEPEND_IFEXISTS(\([^)]*\)).*,\1,p' configure.ac); do for f in $(sed -n 's, *AX_\(DEB\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do
if test -n "$(${DO} apt-cache policy -q ${f})" && ((! $(${DO} apt-cache policy ${f} 2>&1 | grep -q 'N: Unable to locate package')) && (! ${DO} dpkg -l "${f}")); then if test -n "$(${DO} apt-cache policy -q ${f})" && ((! $(${DO} apt-cache policy ${f} 2>&1 | grep -q 'N: Unable to locate package')) && (! ${DO} dpkg -l "${f}")); then
DEPS+=" ${f}" DEPS+=" ${f}"
fi fi
done done
for f in $(sed -n 's, *AX_DEB_BUILD_DEPEND(\([^)]*\)).*,\1,p' configure.ac); do for f in $(sed -n 's, *AX_\(DEB\|ALL\)_DEPEND_IFEXISTS_DEV(\([^)]*\)).*,\2,p' configure.ac); do
if test -n "$(${DO} apt-cache policy -q ${f}-dev)" && ((! $(${DO} apt-cache policy ${f}-dev 2>&1 | grep -q 'N: Unable to locate package')) && (! ${DO} dpkg -l "${f}-dev")); then
DEPS+=" ${f}-dev"
fi
done
for f in $(sed -n 's, *AX_\(DEB\|ALL\)\(_BUILD\)\?_DEPEND(\([^)]*\)).*,\3,p' configure.ac); do
DEPS+=" ${f}" DEPS+=" ${f}"
done done
for f in $(sed -n 's, *AX_\(DEB\|ALL\)\(_BUILD\)\?_DEPEND_DEV(\([^)]*\)).*,\3,p' configure.ac); do
DEPS+=" ${f}-dev"
done
trap "rm debian/control" INT TERM EXIT trap "rm debian/control" INT TERM EXIT
sed 's,@\(DEB_DEPEND_IFEXISTS\|DEB_BUILD_DEPEND\|DEB_DEPEND\)@,,g' debian/control.in | \ sed 's,@\(\(ALL\|DEB\)_DEPEND_IFEXISTS\|\(ALL\|DEB\)_BUILD_DEPEND\|\(ALL\|DEB\)_DEPEND\)@,,g' debian/control.in | \
sed 's,@[^@]*@, dummytext,g' > debian/control sed 's,@[^@]*@, dummytext,g' > debian/control
fi fi

@ -15,10 +15,33 @@ SCHROOTNAME="$1"
PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac) PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac)
TRAP_CMD= TRAP_CMD=
DEPS=
if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then
for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do
if (test -x /usr/bin/zypper && zypper search -x "$f" 1>&2 > /dev/null) || \
(test -x /usr/bin/dnf && dnf list -q "$f" 1>&2 > /dev/null) || \
(test -x /usr/bin/yum && yum list -q "$f" 1>&2 > /dev/null) || \
(test -x /usr/sbin/urpmq && urpmq "$f" 1>&2 > /dev/null); then
DEPS+=" ${f}"
fi
done
for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS_DEV(\([^)]*\)).*,\2,p' configure.ac); do
if (test -x /usr/bin/zypper && zypper search -x "$f"-devel 1>&2 > /dev/null) || \
(test -x /usr/bin/dnf && dnf list -q "$f"-devel 1>&2 > /dev/null) || \
(test -x /usr/bin/yum && yum list -q "$f"-devel 1>&2 > /dev/null) || \
(test -x /usr/sbin/urpmq && urpmq "$f"-devel 1>&2 > /dev/null); then
DEPS+=" ${f}-devel"
fi
done
for f in $(sed -n 's, *AX_\(RPM\|ALL\)\(_BUILD\)\?_DEPEND(\([^)]*\)).*,\3,p' configure.ac); do
DEPS+=" ${f}"
done
for f in $(sed -n 's, *AX_\(RPM\|ALL\)\(_BUILD\)\?_DEPEND_DEV(\([^)]*\)).*,\3,p' configure.ac); do
DEPS+=" ${f}-devel"
done
TRAP_CMD+="rm ${PACKAGE_NAME}.spec;" TRAP_CMD+="rm ${PACKAGE_NAME}.spec;"
trap "${TRAP_CMD}" INT TERM EXIT trap "${TRAP_CMD}" INT TERM EXIT
sed 's,@RPM_DEPEND_IFEXISTS@,,g' ${PACKAGE_NAME}.spec.in | \ sed 's,@\(\(ALL\|RPM\)_DEPEND_IFEXISTS\|\(ALL\|RPM\)_BUILD_DEPEND\|\(ALL\|RPM\)_DEPEND\)@,,g' ${PACKAGE_NAME}.spec.in | \
sed 's,@[^@]*@, dummytext,g' > ${PACKAGE_NAME}.spec sed 's,@[^@]*@, dummytext,g' > ${PACKAGE_NAME}.spec
fi fi
@ -32,12 +55,12 @@ fi
if test -n "${SCHROOTNAME}"; then 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') 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}"; then
schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} ${FILES} schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} ${FILES} ${DEPS}
fi fi
else else
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p') 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}"; then
${INSTALL_TOOL} ${FILES} ${INSTALL_TOOL} ${FILES} ${DEPS}
fi fi
fi fi

@ -0,0 +1,14 @@
#!/usr/bin/expect -f
set key [lindex $argv 0]
set password [lindex $argv 1]
set files [lrange $argv 2 end]
### rpm-sign.exp -- Sign RPMs by sending the passphrase.
spawn rpmsign --define "_gpg_name $key" --addsign {*}$files
expect {
"Enter pass phrase: " {
send -- "$password\r"
exp_continue
} eof
}
Loading…
Cancel
Save