fixed build for rpm

master
Marc Wäckerlin 7 years ago
parent 1c6965a891
commit a71a30824b
  1. 21
      ax_check_qt.m4
  2. 115
      ax_init_standard_project.m4
  3. 90
      bootstrap.sh
  4. 12
      build-in-docker.conf
  5. 45
      build-in-docker.sh
  6. 3
      configure.ac
  7. 1
      debian/proxyface-dev.install
  8. 7
      examples/makefile.am
  9. 51
      proxyface.spec.in
  10. 53
      resolve-debbuilddeps.sh
  11. 66
      resolve-rpmbuilddeps.sh

@ -230,6 +230,7 @@ AC_DEFUN([AX_CHECK_QT], [
AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
AX_ADDITIONAL_QT_RULES_HACK='
#### Begin: Appended by $0
LANGUAGE_FILE_BASE ?= translations
@ -241,7 +242,6 @@ moc_%.cxx: %.hxx
qrc_%.cxx: %.qrc
$(RCC) -o [$][@] -name ${<:%.qrc=%} $<
AC_SUBST(AX_ADDITIONAL_QT_RULES_HACK)
#%.qrc: %
# cwd=$$(pwd) && cd $< && $(RCC) -project -o $${cwd}/[$][@]
@ -249,12 +249,15 @@ qrc_%.cxx: %.qrc
%.qm: %.ts
${LRELEASE} $< -qm [$][@]
%.ts: ${LANGUAGE_FILES:%=%}
%.ts: ${LANGUAGE_FILES}
${LUPDATE} -no-obsolete \
-target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \
-ts [$][@] $<
-target-language [$]{@:${LANGUAGE_FILE_BASE}_%.ts=%} \
[$][^] \
-ts [$][@]
'])
#### End: $0
'
])
AC_DEFUN([AX_REQUIRE_QT], [
AX_CHECK_QT([$1], [$2], [$3], [$4])
@ -269,3 +272,11 @@ AC_DEFUN([AX_REQUIRE_QT], [
AC_DEFUN([AX_QT_NO_KEYWORDS], [
CPPFLAGS+=" -DQT_NO_KEYWORDS"
])
AC_DEFUN([AX_INIT_QT], [
test -f src/makefile.in && cat >> src/makefile.in <<EOF
#### HERE
${AX_ADDITIONAL_QT_RULES_HACK}
#### WE ARE
EOF
])

@ -225,6 +225,9 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
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)
if test "${DISTRO}" = "n/a"; then
DISTRO="${VENDOR}_$(lsb_release -sr 2>/dev/null | tr ' ' '_')"
fi
AX_SUBST(DISTRO)
ARCH=$((@<:@@<:@ $(uname -sm) =~ 64 @:>@@:>@ && echo amd64) || (@<:@@<:@ $(uname -sm) =~ 'i?86' @:>@@:>@ && echo i386 || uname -sm))
AX_SUBST(ARCH)
@ -453,6 +456,12 @@ AC_DEFUN([AX_USE_NODEJS], [
[${PATH}${PATH_SEPARATOR}${ANDROID_HOME}/tools])
AC_CONFIG_FILES([nodejs/package.json])
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])
test -f nodejs/makefile.in && cat >> nodejs/makefile.in <<EOF
#### Begin: Appended by $0
@ -491,6 +500,12 @@ EOF
# use this in configure.ac to support HTML data for webservers
AC_DEFUN([AX_BUILD_HTML], [
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])
test -f html/makefile.in && cat >> html/makefile.in <<EOF
#### Begin: Appended by $0
@ -518,6 +533,12 @@ AC_DEFUN([AX_USE_LIBTOOL], [
AC_SUBST(LIB_VERSION)
AC_PROG_LIBTOOL
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([uninstall-am], [uninstall-data-am], [src/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([uninstall-data-am], [uninstall-data-libtool-pkg], [src/makefile.in])
@ -535,7 +556,11 @@ EOF
])
# use this in configure.ac to support debian packages
# - $1: optional debian package section
AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [
if test -n "$1"; then
AX_DEB_SECTION([$1])
fi
if test -f README.md; then
README_DEB=$(tail -n +3 README.md | sed -e 's/^ *$/./g' -e 's/^/ /g')
else
@ -560,7 +585,11 @@ EOF
])
# use this in configure.ac to support RPM packages
# - $1: optional rpm package group
AC_DEFUN([AX_USE_RPM_PACKAGING], [
if test -n "$1"; then
AX_RPM_GROUP([$1])
fi
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])
@ -594,7 +623,7 @@ AC_DEFUN([AX_USE_DOXYGEN], [
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
AC_CHECK_PROG(have_dot, dot, yes, no)
AC_CHECK_PROG(have_mscgen, mscgen, yes, no)
AM_CONDITIONAL(NEED_PLANTUML, test "$have_doxygen" = "yes" -a "1.8.11" != $((echo "1.8.11"; doxygen -v) | sort -V | head -1))
AM_CONDITIONAL(NEED_PLANTUML, test "$have_doxygen" = "yes" -a "1.8.11" != $((echo "1.8.11"; doxygen -v 2>/dev/null) | sort -V | head -1))
PDF_DOC=${PACKAGE_NAME}-${PACKAGE_VERSION}.pdf
AC_SUBST(PDF_DOC)
if test "$have_doxygen" = "no"; then
@ -715,12 +744,10 @@ EOF
# $5 = optional flags:
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
# $6 = optional parameters, allowed are (evaluated in this order):
# - RPM_DIST_PKG=<name>
# special name for the RPM package
# - DEB_DIST_PKG=<name>
# special name for the debian package
# - DIST_PKG=<name>
# if the name of the package is different
# - DEV_RPM_DIST_PKG=<name>
# special name for the RPM development package
# - DEV_DEB_DIST_PKG=<name>
# special name for the debian development package
# - DEV_DIST_PKG=<name>
# if the name of the development package is different
#
@ -732,11 +759,6 @@ EOF
AC_DEFUN([AX_PKG_REQUIRE], [
PKG_PROG_PKG_CONFIG
optional_flags="$5"
$6
if test -n "$DEV_DIST_PKG"; then
DEV_DEB_DIST_PKG=${DEV_DIST_PKG}-dev
DEV_RPM_DIST_PKG=${DEV_DIST_PKG}-devel
fi
$1_found=no
secondpar="m4_default([$2], [$1])"
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
@ -816,10 +838,6 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
fi
fi
AX_DEB_BUILD_DEPEND([${DEV_DEB_DIST_PKG:-${DEB_DIST_PKG:-${DIST_PKG:-${$1_found}-dev}}}])
AX_RPM_BUILD_DEPEND([${DEV_RPM_DIST_PKG:-${RPM_DIST_PKG:-${DIST_PKG:-${$1_found}-devel}}}])
AX_DEB_DEPEND([${DEB_DIST_PKG:-${DIST_PKG:-${$1_found}}}])
AX_RPM_DEPEND([${RPM_DIST_PKG:-${DIST_PKG:-${$1_found}}}])
[$1]_CPPFLAGS="${$1_CFLAGS}"
[$1]_CXXFLAGS="${$1_CFLAGS}"
AC_SUBST([$1]_CPPFLAGS)
@ -832,6 +850,33 @@ AC_DEFUN([AX_PKG_REQUIRE], [
else
AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS])
fi
DEV_DEB_DIST_PKG=
DEV_RPM_DIST_PKG=
DEV_DIST_PKG=
pkg=m4_default([$2], [$1])
$6
dep_pkg=${DEV_DEB_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-dev}
rpm_pkg=${DEV_RPM_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-devel}
if test -n "$4"; then
for f in $pkg $4; do
if test -n "$(apt-cache policy -q ${f}-dev 2> /dev/null)"; then
deb_pkg=${f}-dev
break
fi
done
for f in $pkg $4; 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
rpm_pkg=${f}-devel
break
fi
done
fi
AX_DEB_BUILD_DEPEND([$deb_pkg])
AX_RPM_BUILD_DEPEND([$rpm_pkg])
])
# check if a specific package exists
@ -841,12 +886,10 @@ AC_DEFUN([AX_PKG_REQUIRE], [
# $3 = optional flags:
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
# $4 = optional parameters, allowed are (evaluated in this order):
# - RPM_DIST_PKG=<name>
# special name for the RPM package
# - DEB_DIST_PKG=<name>
# special name for the debian package
# - DIST_PKG=<name>
# if the name of the package is different
# - DEV_RPM_DIST_PKG=<name>
# special name for the RPM development package
# - DEV_DEB_DIST_PKG=<name>
# special name for the debian development package
# - DEV_DIST_PKG=<name>
# if the name of the development package is different
#
@ -855,11 +898,6 @@ AC_DEFUN([AX_PKG_REQUIRE], [
# sets all flags, so that the module can be used everywhere
AC_DEFUN([AX_PKG_CHECK], [
optional_flags="$3"
$4
if test -n "$DEV_DIST_PKG"; then
DEV_DEB_DIST_PKG=${DEV_DIST_PKG}-dev
DEV_RPM_DIST_PKG=${DEV_DIST_PKG}-devel
fi
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
HAVE_$1=1
@ -883,15 +921,29 @@ AC_DEFUN([AX_PKG_CHECK], [
], [
HAVE_$1=0
])
AX_DEB_BUILD_DEPEND([${DEV_DEB_DIST_PKG:-${DEB_DIST_PKG:-${DIST_PKG:-m4_default([$2], [$1])-dev}}}])
AX_RPM_BUILD_DEPEND([${DEV_RPM_DIST_PKG:-${RPM_DIST_PKG:-${DIST_PKG:-m4_default([$2], [$1])-devel}}}])
AX_DEB_DEPEND([${DEB_DIST_PKG:-${DIST_PKG:-m4_default([$2], [$1])}}])
AX_RPM_DEPEND([${RPM_DIST_PKG:-${DIST_PKG:-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)
DEV_DEB_DIST_PKG=
DEV_RPM_DIST_PKG=
DEV_DIST_PKG=
pkg=m4_default([$2], [$1])
$4
dep_pkg=${DEV_DEB_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-dev}
rpm_pkg=${DEV_RPM_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-devel}
if test -n "$(apt-cache policy -q ${deb_pkg} 2> /dev/null)"; then
AX_DEB_BUILD_DEPEND([$deb_pkg])
fi
if (test -x /usr/bin/zypper && zypper search -x "$rpm_pkg" 1>&2 > /dev/null) || \
(test -x /usr/bin/dnf && dnf list -q "$rpm_pkg" 1>&2 > /dev/null) || \
(test -x /usr/bin/yum && yum list -q "$rpm_pkg" 1>&2 > /dev/null) || \
(test -x /usr/sbin/urpmq && urpmq "$rpm_pkg" 1>&2 > /dev/null); then
AX_RPM_BUILD_DEPEND([$rpm_pkg])
fi
)
])
# make sure, a specific header exists
@ -1176,4 +1228,5 @@ AC_DEFUN([AX_OUTPUT], [
AX_DEB_RESOLVE
AX_RPM_RESOLVE
AC_OUTPUT
AX_INIT_QT
])

@ -307,13 +307,13 @@ for path in . .. ../.. ../../..; do
if test -d ${path}/.svn; then
VCS="svn"
VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools,"
VCSDEPENDS_RPM="subversion,"
VCSDEPENDS_RPM="subversion, "
echo -e " \e[32msuccess\e[0m detected ${VCS}"
break
elif test -d ${path}/.git; then
VCS="git"
VCSDEPENDS_DEB="git2cl, git,"
VCSDEPENDS_RPM="git,"
VCSDEPENDS_RPM="git, "
echo -e " \e[32msuccess\e[0m detected ${VCS}"
break
fi
@ -1290,6 +1290,9 @@ ${HEADER}AM_CPPFLAGS = -I\${top_srcdir}/src -I\${top_builddir}/src
AM_LDFLAGS = -L\${abs_top_builddir}/src/.libs
LDADD = -l${PACKAGE_NAME#lib}
exampledir = ${docdir}/examples
example_DATA =
MAINTAINERCLEANFILES = makefile.in
EOF
to --condition AX_BUILD_HTML_NPM html/package.json.in <<EOF
@ -1603,7 +1606,7 @@ to --condition AX_USE_RPM_PACKAGING ${PACKAGE_NAME}.spec.in <<EOF
Summary: @DESCRIPTION@
Name: @PACKAGE_NAME@
Version: @VERSION@
Release: @BUILD_NUMBER@%{?dist}
Release: @BUILD_NUMBER@.@DISTRO@
License: LGPL
Group: $(if testtag AX_USE_LIBTOOL; then
echo Development/Libraries/C++;
@ -1613,62 +1616,53 @@ fi)
$(if testtag AX_RPM_DEPEND; then echo "Requires: @RPM_DEPEND@"; fi)
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: 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
if testtag AX_USE_LIBTOOL; then
echo -n ", libtool";
if testtag AX_USE_CPPUNIT; then
echo -n ", cppunit-devel"
fi
if testtag AX_USE_DOXYGEN; then
echo -n ", doxygen, java-openjdk";
echo -n ", doxygen, graphviz, java-openjdk";
fi
if testtag AX_USE_PERLDOC; then
echo -n ", libpod-tree-perl";
fi
) @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
%if 0%{?fedora} != 20
$(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi)
#### os dependent definitions ####
%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: lsb-release$(
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then
echo -n ", qt-devel, libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel libqt5-qtwebengine-devel libQt5WebKitWidgets-devel";
fi)
%else
$(
if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then
echo -n "BuildRequires: qt-devel, qt5-qtbase-devel, qt5-qttools-devel, qtwebkit-devel";
fi)
%if 0%{?mageia}
BuildRequires: rpm-sign, lsb-release
%else
BuildRequires: rpm-sign, redhat-lsb
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} || 0%{?mageia}
BuildRequires: which, pkgconfig$(
if testtag AX_USE_LIBTOOL; then
echo -n ", cppunit-devel"
fi
)
%if 0%{?rhel} > 6 || 0%{?rhl} > 6 || 0%{?centos} > 6 || 0%{?fedora} || 0%{?mageia}
BuildRequires: rpm-sign
%endif
%if 0%{?mageia}
BuildRequires: gnupg, lsb-release$(
if testtag AX_USE_LIBTOOL; then
echo -n ", libltdl-devel"
fi
)
%else
BuildRequires: gpg, redhat-lsb$(
if testtag AX_USE_LIBTOOL; then
echo -n ", libtool-ltdl-devel"
fi
)
$(
if testtag AX_USE_DOXYGEN; then cat <<EOS
%if ! 0%{?centos}
BuildRequires: mscgen
%endif
%if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} )
$(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: mscgen"; fi)
$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: qt5-qtbase-devel, qt5-qttools, qt5-qtwebkit-devel"; fi)
EOS
fi
if testtag AX_USE_LIBTOOL; then cat <<EOS
%if 0%{?mageia}
BuildRequires: libtool, libltdl-devel
%else
$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: qt-devel"; fi)
BuildRequires: libtool, libtool-ltdl-devel
%endif
%else%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: pkg-config, lsb-release$(
if testtag AX_USE_CPPUNIT; then
echo -n ", libcppunit-devel";
EOS
fi)
%if 0%{?suse_version} < 1200 || 0%{?sles_version} < 1200
$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: libqt4-devel, qt4-x11-tools, libQtWebKit-devel"; fi)
%else
$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel"; fi)
%endif
%endif%endif
%description
@README@
@ -1825,14 +1819,14 @@ Requires: @PKG_REQUIREMENTS@
EOF
to build-in-docker.conf <<EOF
${HEADER}# Use Ubuntu Universe Repository
repos+=("Ubuntu:::universe")
repos+=("ubuntu:::universe")
# Use Marc Wäckerlin's Repository, see https://dev.marc.waeckerlin.org
repos+=("Debian|Ubuntu:::https://dev.marc.waeckerlin.org/repository")
repos+=("openSUSE:::https://dev.marc.waeckerlin.org/repository/opensuse/marc-waeckerlin.repo")
repos+=("Fedora:::https://dev.marc.waeckerlin.org/repository/fedora/marc-waeckerlin.repo")
repos+=("CentOS:::https://dev.marc.waeckerlin.org/repository/centos/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")
# centos requires epel-release for some packages, such as Qt WebKit
packages+=("centos:::epel-release")
EOF
#### Cleanup If Makefile Exists ####

@ -2,18 +2,18 @@
##
## This file has been added:
## - by bootstrap.sh
## - on Fri, 17 March 2017 16:12:28 +0100
## - on Wed, 14 June 2017 13:58:37 +0200
## Feel free to change it or even remove and rebuild it, up to your needs
##
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
# Use Ubuntu Universe Repository
repos+=("Ubuntu:::universe")
repos+=("ubuntu:::universe")
# Use Marc Wäckerlin's Repository, see https://dev.marc.waeckerlin.org
repos+=("Debian|Ubuntu:::https://dev.marc.waeckerlin.org/repository")
repos+=("openSUSE:::https://dev.marc.waeckerlin.org/repository/opensuse/marc-waeckerlin.repo")
repos+=("Fedora:::https://dev.marc.waeckerlin.org/repository/fedora/marc-waeckerlin.repo")
repos+=("CentOS:::https://dev.marc.waeckerlin.org/repository/centos/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")
# centos requires epel-release for some packages, such as Qt WebKit
packages+=("centos:::epel-release")

@ -90,7 +90,7 @@ while test $# -gt 0; do
img="mwaeckerlin/ubuntu:latest"; host="${host:---host=i686-w64-mingw32}"
targets="all install"
flags+=("--prefix=/workdir/usr")
packages1=("mingw-w64")
packages+=("mingw-w64")
;;
(*)
echo "**** ERROR: unknown mode '$1', try --help" 1>&2
@ -172,7 +172,8 @@ function traperror() {
echo
fi
if [ "$wait" -eq 1 ]; then
echo " ... now you can access the docker container:"
echo " ... now you can access the docker container as root or user:"
echo " docker exec -it ${DOCKER_ID} bash"
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash"
echo -n " ... press enter to cleanup: "
read
@ -185,13 +186,7 @@ function traperror() {
exit $e
fi
done
if [ "$wait" -eq 1 ]; then
echo " ... now you can access the docker container:"
echo " docker exec -u $(id -u) -it ${DOCKER_ID} bash"
echo -n " ... press enter to cleanup: "
read
fi
echo -n " SUCCESS ... cleanup docker: "
echo -n "SUCCESS ... cleanup docker: "
docker rm -f "${DOCKER_ID}"
exit 0
}
@ -200,21 +195,27 @@ function ifthenelse() {
arg="$1"
shift
cmd="$*"
DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,' | tr [:upper:] [:lower:])
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -cs)
ARCH=$((docker exec ${DOCKER_ID} which dpkg > /dev/null 2> /dev/null && docker exec ${DOCKER_ID} dpkg --print-architecture) || echo amd64)
if test "${arg/:::/}" = "${arg}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${arg}}"
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
else
os="${arg%%:::*}"
thenpart="${arg#*:::}"
if test "${thenpart/:::/}" = "${thenpart}"; then
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)-$((which dpkg > /dev/null 2> /dev/null && dpkg --print-architecture) || echo amd64)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; fi'
else
elsepart=
if test "${thenpart/:::/}" != "${thenpart}"; then
elsepart="${thenpart##*:::}"
thenpart="${thenpart%:::*}"
thenpart="${thenpart%%:::*}"
fi
if [[ "${DISTRIBUTOR}-${CODENAME}-${ARCH}" =~ ${os} ]]; then
if test -n "${thenpart}"; then
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)-$((which dpkg > /dev/null 2> /dev/null && dpkg --print-architecture) || echo amd64)" =~ ${os} ]]; then '"${cmd//ARG/${thenpart}}"'; else '"${cmd//ARG/${elsepart}}"'; fi'
else
docker exec ${DOCKER_ID} bash -c 'os="'$os'"; if [[ "$(lsb_release -is)-$(lsb_release -cs)-$((which dpkg > /dev/null 2> /dev/null && dpkg --print-architecture) || echo amd64)" =~ ${os} ]]; then true; else '"${cmd//ARG/${elsepart}}"'; fi'
fi
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${thenpart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
fi
else
if test -n "${elsepart}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${elsepart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
fi
fi
fi
}
@ -295,10 +296,16 @@ EOF
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 true))
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))
ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'"
((++i))
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
;;
esac

@ -28,8 +28,7 @@ AX_BUILD_EXAMPLES
AX_CHECK_QT([QT], [QtNetwork QtGui], [QtWidgets])
AC_CONFIG_FILES([src/languages.qrc])
if test -z "${MINGW}"; then
AX_PKG_CHECK([PROXY], [libproxy-1.0], [],
[DIST_PKG="libproxy|libproxy1|libproxy-1.0" DEV_DIST_PKG=libproxy])
AX_PKG_REQUIRE([PROXY], [libproxy-1.0], [], [libproxy libproxy1])
else
LDFLAGS+=" -lwinhttp"
HAVE_PROXY=0

@ -4,3 +4,4 @@ usr/lib/lib*.so
usr/lib/pkgconfig/*
usr/lib/*.la
usr/share/doc/proxyface/html
usr/share/doc/proxyface/examples

@ -10,10 +10,13 @@ AM_CPPFLAGS = -I${top_srcdir}/src
AM_LDFLAGS = -L${top_builddir}/src/.libs
LDADD = -l${PACKAGE_NAME}
noinst_PROGRAMS = getproxylist
exampledir = ${docdir}/examples
example_PROGRAMS = getproxylist
getproxylist_SOURCES = getproxylist.cxx
if HAVE_QT
noinst_PROGRAMS += simplegui
example_PROGRAMS += simplegui
simplegui_SOURCES = simplegui.cxx
endif
example_DATA = ${example_PROGRAMS:*=*.cxx}

@ -1,31 +1,33 @@
Summary: @DESCRIPTION@
Name: @PACKAGE_NAME@
Version: @VERSION@
Release: @BUILD_NUMBER@%{?dist}
Release: @BUILD_NUMBER@.@DISTRO@
License: LGPL
Group: Development/Libraries/C++
Source0: %{name}-%{version}.tar.gz
BuildRequires: gnupg, subversion, automake, autoconf, doxygen
%if 0%{?fedora} != 20
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: pkgconfig, redhat-lsb
%if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} )
BuildRequires: mscgen
BuildRequires: qt5-qtbase-devel, qt5-qttools, qt5-qtwebkit-devel
BuildRequires: which, pkgconfig, gnupg, expect, subversion, make, automake, autoconf, rpm-build, binutils-devel, gcc-c++, doxygen, graphviz, java-openjdk @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
#### os dependent definitions ####
%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: lsb-release, libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel
%else
BuildRequires: qt5-qtbase-devel, qt5-qttools-devel, qtwebkit-devel
%if 0%{?mageia}
BuildRequires: rpm-sign, lsb-release
%else
BuildRequires: qt-devel
BuildRequires: rpm-sign, redhat-lsb
%endif
%else%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: pkg-config, lsb-release
%if 0%{?suse_version} < 1200 || 0%{?sles_version} < 1200
BuildRequires: libqt4-devel, qt4-x11-tools, libQtWebKit-devel
%endif
%if ! 0%{?centos}
BuildRequires: mscgen
%endif
%if 0%{?mageia}
BuildRequires: libtool, libltdl-devel
%else
BuildRequires: libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel
BuildRequires: libtool, libtool-ltdl-devel
%endif
%endif%endif
%description
@README@
@ -36,6 +38,7 @@ This package contains only the shared libraries required at runtime.
%prep
%setup -q
./configure --prefix=/usr \
--sysconfdir=/etc \
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \
--libdir=/usr/%_lib
@ -50,7 +53,8 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/usr/%_lib/lib@PACKAGE_NAME@.so.*
/usr/%_lib/*.so.*
%doc
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
/usr/share/doc/packages/@PACKAGE_NAME@/COPYING
@ -62,7 +66,7 @@ rm -rf $RPM_BUILD_ROOT
%package devel
Summary: @DESCRIPTION@
Group: Development/Libraries/C++
Requires: @PACKAGE_NAME@ = @VERSION@
Requires: @PACKAGE_NAME@ = @VERSION@ @RPM_BUILD_DEPEND@
%description devel
@README@
@ -71,14 +75,15 @@ This Package contains all files required for developement.
%files devel
%defattr(-,root,root,-)
/usr/%_lib/lib@PACKAGE_NAME@.so
/usr/%_lib/lib@PACKAGE_NAME@.a
/usr/%_lib/lib@PACKAGE_NAME@.la
/usr/%_lib/*.so
/usr/%_lib/*.a
/usr/%_lib/*.la
/usr/%_lib/pkgconfig
/usr/include/*
/usr/share/proxyface/translations
%doc
/usr/share/@PACKAGE_NAME@
/usr/share/doc/packages/@PACKAGE_NAME@/html
/usr/share/doc/packages/@PACKAGE_NAME@/examples
%changelog

@ -35,13 +35,53 @@ TO_INSTALL=
DEPS=
if test -e debian/control.in -a ! -e debian/control; then
function pkg_exists() {
test -n "$(${DO} apt-cache policy -q ${1})"
}
function AX_PKG_CHECK() {
local DEV_DEB_DIST_PKG=
local DEV_DIST_PKG=
local pkg=
eval $4
if test -z "$2"; then
pkg=$1
else
pkg=$2
fi
pkg=${DEV_DEB_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-dev}
if pkg_exists "${pkg}"; then
echo $pkg
fi
}
function AX_PKG_REQUIRE() {
local DEV_DEB_DIST_PKG=
local DEV_DIST_PKG=
local pkg=
eval $6
if test -z "$2"; then
pkg=$1
else
pkg=$2
fi
if test -n "$4"; then
for f in $pkg $4; do
if pkg_exists "${f}-dev"; then
pkg=$f
break
fi
done
fi
echo ${DEV_DEB_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-dev}
}
DEPS+=" $(eval $(sed -n '/^ *AX_PKG_REQUIRE/{s,^ *\(AX_PKG_REQUIRE\) *(\(.*\)).*,\1 \2,;s.\[\([^]]*\)\],\?."\1".g;s,$,;,g;p}' configure.ac))"
DEPS+=" $(eval $(sed -n '/^ *AX_PKG_CHECK/{s,^ *\(AX_PKG_CHECK\) *(\(.*\)).*,\1 \2,;s.\[\([^]]*\)\],\?."\1".g;s,$,;,g;p}' configure.ac))"
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 pkg_exists "${f}"; then
DEPS+=" ${f}"
fi
done
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
if pkg_exists "${f}-dev"; then
DEPS+=" ${f}-dev"
fi
done
@ -57,10 +97,11 @@ if test -e debian/control.in -a ! -e debian/control; then
fi
install dpkg-dev
DEPS+=" $(LANG= ${DO} dpkg-checkbuilddeps 2>&1 | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}')"
for pa in ${DEPS}; do
if test ${pa//|/} = ${pa}; then
if test "${pa//|/}" = "${pa}"; then
TO_INSTALL+=" ${pa}"
continue;
fi
@ -83,4 +124,10 @@ if test -n "${TO_INSTALL}" && ! install ${TO_INSTALL}; then
exit 1
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"

@ -14,7 +14,7 @@ INSTALL_TOOL=${INSTALL_TOOL:-$((test -x /usr/bin/zypper && echo zypper install -
SCHROOTNAME="$1"
PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac)
TRAP_CMD=
TRAP_CMD="sleep ${SLEEP:-0};"
DEPS=
for f in BUILD BUILDROOT RPMS SPECS SRPMS; do
if ! test -d $f; then
@ -23,19 +23,56 @@ for f in BUILD BUILDROOT RPMS SPECS SRPMS; do
fi
done
if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then
function pkg_exists() {
(test -x /usr/bin/zypper && zypper search -x "$1" 1>&2 > /dev/null) || \
(test -x /usr/bin/dnf && dnf list -q "$1" 1>&2 > /dev/null) || \
(test -x /usr/bin/yum && yum list -q "$1" 1>&2 > /dev/null) || \
(test -x /usr/sbin/urpmq && urpmq "$1" 1>&2 > /dev/null)
}
function AX_PKG_CHECK() {
local DEV_RPM_DIST_PKG=
local DEV_DIST_PKG=
local pkg=
eval $4
if test -z "$2"; then
pkg=$1
else
pkg=$2
fi
pkg=${DEV_RPM_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-devel}
if pkg_exists "${pkg}"; then
echo ${pkg}
fi
}
function AX_PKG_REQUIRE() {
local DEV_RPM_DIST_PKG=
local DEV_DIST_PKG=
local pkg=
eval $6
if test -z "$2"; then
pkg=$1
else
pkg=$2
fi
if test -n "$4"; then
for f in $pkg $4; do
if pkg_exists "${f}-devel"; then
pkg=$f
break
fi
done
fi
echo ${DEV_RPM_DIST_PKG:-${DEV_DIST_PKG:-${pkg}}-devel}
}
DEPS+=" $(eval $(sed -n '/^ *AX_PKG_REQUIRE/{s,^ *\(AX_PKG_REQUIRE\) *(\(.*\)).*,\1 \2,;s.\[\([^]]*\)\],\?."\1".g;s,$,;,g;p}' configure.ac))"
DEPS+=" $(eval $(sed -n '/^ *AX_PKG_CHECK/{s,^ *\(AX_PKG_CHECK\) *(\(.*\)).*,\1 \2,;s.\[\([^]]*\)\],\?."\1".g;s,$,;,g;p}' configure.ac))"
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
if pkg_exists "${f}"; 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
if pkg_exists "${f}-devel"; then
DEPS+=" ${f}-devel"
fi
done
@ -48,7 +85,7 @@ if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then
TRAP_CMD+="rm ${PACKAGE_NAME}.spec;"
trap "${TRAP_CMD}" INT TERM EXIT
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
TGZFILE=$(sed -n '/^Name: */{s///;h};/^Version: */{s///;H;x;s/\n/-/;s/$/.tar.gz/;p}' ${PACKAGE_NAME}.spec)
@ -70,5 +107,14 @@ else
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"

Loading…
Cancel
Save