build system updated

master
Marc Wäckerlin 8 years ago
parent 82ac499ff0
commit 407fd0c847
  1. 12
      ChangeLog
  2. 30
      bootstrap.sh
  3. 13
      build-in-docker.conf
  4. 41
      build-in-docker.sh
  5. 6
      debian/control.in

@ -1,3 +1,15 @@
2016-12-11 21:51
* [r101] build-in-docker.sh, resolve-rpmbuilddeps.sh:
fix some typos
2016-12-11 01:39
* [r100] ChangeLog, ax_init_standard_project.m4, bootstrap.sh,
build-in-docker.conf, build-in-docker.sh, libxml-cxx.spec.in,
resolve-debbuilddeps.sh, resolve-rpmbuilddeps.sh:
seems to work for rpm, execpt signing problem
2016-10-05 11:37 2016-10-05 11:37
* [r99] debian/control.in: * [r99] debian/control.in:

@ -302,7 +302,7 @@ VCSDEPENDS=""
if test -d .svn; then if test -d .svn; then
VCS="svn" VCS="svn"
VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools," VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools,"
VCSDEPENDS_RPM="subversion, subversion-tools," VCSDEPENDS_RPM="subversion,"
echo -e " \e[32msuccess\e[0m detected ${VCS}" echo -e " \e[32msuccess\e[0m detected ${VCS}"
elif test -d .git; then elif test -d .git; then
VCS="git" VCS="git"
@ -873,9 +873,9 @@ nodejsdir = \${pkgdatadir}/nodejs
sysconfdefaultdir = \${sysconfdir}/default sysconfdefaultdir = \${sysconfdir}/default
sysconfinitdir = \${sysconfdir}/init sysconfinitdir = \${sysconfdir}/init
dist_sysconf_DATA = etc/@PACKAGE_NAME@.json dist_sysconf_DATA = \${sysconfdir}/@PACKAGE_NAME@.json
dist_sysconfdefault_DATA = etc/default/@PACKAGE_NAME@ dist_sysconfdefault_DATA = \${sysconfdir}/default/@PACKAGE_NAME@
dist_sysconfinit_DATA = etc/init/@PACKAGE_NAME@.conf dist_sysconfinit_DATA = \${sysconfdir}/init/@PACKAGE_NAME@.conf
all: node_modules all: node_modules
@ -1465,7 +1465,7 @@ if testtag AX_USE_DEBIAN_PACKAGING; then
-- @PACKAGER@ @BUILD_DATE@ -- @PACKAGER@ @BUILD_DATE@
EOF EOF
BUILD_DEPENDS="debhelper, fakeroot, ${VCSDEPENDS_DEB} pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release, fakeroot, $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen, default-jre-headless|default-jre"; fi; if testtag AX_USE_PERLDOC; then echo -n ", libpod-tree-perl"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)" BUILD_DEPENDS="debhelper, fakeroot, ${VCSDEPENDS_DEB} pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release$(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen, default-jre-headless|default-jre"; fi; if testtag AX_USE_PERLDOC; then echo -n ", libpod-tree-perl"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)"
to debian/control.in <<EOF to debian/control.in <<EOF
Source: @PACKAGE_NAME@ Source: @PACKAGE_NAME@
Priority: extra Priority: extra
@ -1600,7 +1600,9 @@ echo
echo This package contains only the shared libraries required at runtime. echo This package contains only the shared libraries required at runtime.
fi) fi)
$(if ! testtag 'AX_USE_LIBTOOL|AX_USE_CXX'; then
echo '%global debug_package %{nil}'
fi)
%prep %prep
%setup -q %setup -q
./configure --prefix=/usr \\ ./configure --prefix=/usr \\
@ -1625,6 +1627,7 @@ else
echo '/usr/bin/*' echo '/usr/bin/*'
echo '/usr/share/applications/*' echo '/usr/share/applications/*'
fi) fi)
/usr/share/@PACKAGE_NAME@
%doc %doc
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
cat <<EOF2 cat <<EOF2
@ -1636,7 +1639,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/*' echo '/usr/share/doc/packages/@PACKAGE_NAME@'
fi) fi)
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
@ -1735,10 +1738,15 @@ Cflags: -I\${includedir} @CPPFLAGS@
Requires: @PKG_REQUIREMENTS@ Requires: @PKG_REQUIREMENTS@
EOF EOF
to build-in-docker.conf <<EOF to build-in-docker.conf <<EOF
repos+=("Debian|Ubuntu-precise::::::universe") ${HEADER}# Use Ubuntu Universe Repository
repos+=("Ubuntu-precise:::'deb http://archive.ubuntu.com/ubuntu precise universe'") repos+=("Ubuntu:::universe")
envs+=("-e 'HOME=\${HOME}'")
dirs+=("-v \${HOME}/.gnupg:\${HOME}/.gnupg:ro") # 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")
keys+=("https://dev.marc.waeckerlin.org/repository/PublicKey")
EOF EOF
#### Cleanup If Makefile Exists #### #### Cleanup If Makefile Exists ####

@ -1,4 +1,17 @@
## @id $Id$
##
## This file has been added:
## - by bootstrap.sh
## - on Sat, 07 January 2017 15:27:31 +0100
## 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+=("Debian|Ubuntu:::https://dev.marc.waeckerlin.org/repository")
repos+=("openSUSE:::https://dev.marc.waeckerlin.org/repository/opensuse/marc-waeckerlin.repo") 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+=("Fedora:::https://dev.marc.waeckerlin.org/repository/fedora/marc-waeckerlin.repo")

@ -10,18 +10,21 @@ mode="deb"
img="ubuntu:latest" img="ubuntu:latest"
repos=() repos=()
keys=() keys=()
envs=("-e LANG=${LANG}" "-e HOME=/home/$(id -un)" "-e TERM=xterm" "-e DEBIAN_FRONTEND=noninteractive" "-e DEBCONF_NONINTERACTIVE_SEEN=true") envs=("-e LANG=${LANG}" "-e HOME=${HOME}" "-e TERM=xterm" "-e DEBIAN_FRONTEND=noninteractive" "-e DEBCONF_NONINTERACTIVE_SEEN=true")
dirs=("-v $(pwd):/workdir" "-v ${HOME}/.gnupg:/home/$(id -un)/.gnupg") dirs=("-v $(pwd):/workdir" "-v ${HOME}/.gnupg:${HOME}/.gnupg")
packages=() packages=()
targets="all check distcheck" targets="all check distcheck"
commands=() commands=()
arch=$((which dpkg > /dev/null 2> /dev/null && dpkg --print-architecture) || echo amd64) arch=$((which dpkg > /dev/null 2> /dev/null && dpkg --print-architecture) || echo amd64)
host=
flags=()
wait=0 wait=0
if test -e ./build-in-docker.conf; then if test -e ./build-in-docker.conf; then
# you can preconfigure the variables in file build-in-docker.conf # you can preconfigure the variables in file build-in-docker.conf
# if you do so, add the file to EXTRA_DIST in makefile.am # if you do so, add the file to EXTRA_DIST in makefile.am
source ./build-in-docker.conf source ./build-in-docker.conf
fi fi
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
(-h|--help) (-h|--help)
@ -30,10 +33,12 @@ while test $# -gt 0; do
echo "OPTIONS:" echo "OPTIONS:"
echo echo
echo " -h, --help show this help" echo " -h, --help show this help"
echo " -m, --mode <type> mode: deb, rpm, default: ${mode}" echo " -m, --mode <type> mode: deb, rpm, win, default: ${mode}"
echo " -i, --image <image> use given docker image instead of ${img}" echo " -i, --image <image> use given docker image instead of ${img}"
echo " -a, --arch <arch> build for given hardware architecture" echo " -a, --arch <arch> build for given hardware architecture"
echo " -t, --targets targets specify build targets, default: ${targets}" echo " -t, --targets targets specify build targets, default: ${targets}"
echo " --host <target-arch> host for cross compiling, e.g. i686-w64-mingw32"
echo " -f, --flag <flag> add flag to ./bootstrap.sh or ./configure"
echo " -r, --repo <url> add given apt repository" echo " -r, --repo <url> add given apt repository"
echo " -k, --key <url> add public key from url" echo " -k, --key <url> add public key from url"
echo " -e, --env <var>=<val> set environment variable in docker" echo " -e, --env <var>=<val> set environment variable in docker"
@ -44,7 +49,9 @@ while test $# -gt 0; do
echo echo
echo " The option -i must be after -m, because mode sets a new default image" echo " The option -i must be after -m, because mode sets a new default image"
echo " The option -m must be after -t, because mode may be auto detected from targets" echo " The option -m must be after -t, because mode may be auto detected from targets"
echo " The option -m must be after -h, because mode may set a host"
echo " If target is either deb or rpm, mode is set to the same value" echo " If target is either deb or rpm, mode is set to the same value"
echo " If target is win, host is set to i686-w64-mingw32"
echo echo
echo " The options -r -k -e -d -p -c can be repeated several times." echo " The options -r -k -e -d -p -c can be repeated several times."
echo echo
@ -79,6 +86,7 @@ while test $# -gt 0; do
(rpm|zypper) img="opensuse:latest";; (rpm|zypper) img="opensuse:latest";;
(yum) img="centos:latest";; (yum) img="centos:latest";;
(dnf) img="fedora:latest";; (dnf) img="fedora:latest";;
(win) img="ubuntu:latest"; host="${host:---host=i686-w64-mingw32}";;
(*) (*)
echo "**** ERROR: unknown mode '$1', try --help" 1>&2 echo "**** ERROR: unknown mode '$1', try --help" 1>&2
exit 1 exit 1
@ -91,15 +99,22 @@ while test $# -gt 0; do
(-a|--arch) shift; (-a|--arch) shift;
arch="$1" arch="$1"
;; ;;
(-t|--targets) shift (-t|--targets) shift;
targets="$1" targets="$1"
if test "$1" = "deb" -o "$1" = "rpm"; then if test "$1" = "deb" -o "$1" = "rpm"; then
# set mode to same value # set mode to same value
set -- "-m" $@ set -- "-m" "$@"
continue continue
fi fi
;; ;;
(--host) shift;
host="--host=$1"
;;
(-f|--flag) shift;
flags+=("$1")
;;
(-r|--repo) shift; (-r|--repo) shift;
echo "OPTION: $1"
repos+=("$1") repos+=("$1")
;; ;;
(-k|--key) shift; (-k|--key) shift;
@ -214,6 +229,7 @@ fi
if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then
docker exec ${DOCKER_ID} useradd -m -u $(id -u) -g $(id -g) -d"${HOME}" $(id -un) docker exec ${DOCKER_ID} useradd -m -u $(id -u) -g $(id -g) -d"${HOME}" $(id -un)
fi fi
docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}"
case $mode in case $mode in
(deb|apt) (deb|apt)
if [[ "${img}" =~ "ubuntu" ]]; then if [[ "${img}" =~ "ubuntu" ]]; then
@ -232,7 +248,7 @@ case $mode in
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \ docker exec ${DOCKER_ID} apt-get install ${OPTIONS} software-properties-common apt-transport-https dpkg-dev lsb-release || \
docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release; docker exec ${DOCKER_ID} apt-get install ${OPTIONS} python-software-properties apt-transport-https dpkg-dev lsb-release;
for repo in "${repos[@]}"; do for repo in "${repos[@]}"; do
ifthenelse "${repo}" "apt-add-repository ARG" ifthenelse "${repo}" "apt-add-repository 'ARG'"
done done
for key in "${keys[@]}"; do for key in "${keys[@]}"; do
wget -O- "$key" \ wget -O- "$key" \
@ -270,10 +286,19 @@ EOF
done done
for repo in "${repos[@]}"; do 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 true))
ifthenelse "${repo}" "${INSTALL_REPO} ARG" ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'"
((++i)) ((++i))
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}" docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} ${flags[@]}

6
debian/control.in vendored

@ -1,7 +1,7 @@
Source: @PACKAGE_NAME@ Source: @PACKAGE_NAME@
Priority: extra Priority: extra
Maintainer: @AUTHOR@ Maintainer: @PACKAGER@
Build-Depends: debhelper, subversion, pkg-config, automake, libtool, autotools-dev, lsb-release, default-jre-headless|default-jre, fakeroot, doxygen, graphviz, mscgen, libcppunit-dev, mrw-c++-dev 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, mrw-c++-dev
Package: @PACKAGE_NAME@ Package: @PACKAGE_NAME@
Section: libs Section: libs
@ -13,6 +13,6 @@ Description: @DESCRIPTION@
Package: @PACKAGE_NAME@-dev Package: @PACKAGE_NAME@-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: @PACKAGE_NAME@ (= ${binary:Version}) 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, mrw-c++-dev
Description: @DESCRIPTION@ - Development Package Description: @DESCRIPTION@ - Development Package
@README_DEB@ @README_DEB@

Loading…
Cancel
Save