diff --git a/ChangeLog b/ChangeLog index c047b5e..5b6838b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-12-12 14:12 + + * [r464] ChangeLog, bootstrap.sh, build-in-docker.sh, + resolve-rpmbuilddeps.sh: + new build mode for windows mingw cross compilation + 2016-12-10 14:53 * [r463] ChangeLog, build-in-docker.sh: diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 9b78951..ebe8831 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -137,6 +137,8 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AX_SUBST(PREFIX) SYSCONFDIR=$(test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${sysconfdir}") AX_SUBST(SYSCONFDIR) + PKGSYSCONFDIR=$(test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${SYSCONFDIR}/${PACKAGE_NAME}") + AX_SUBST(PKGSYSCONFDIR) DATADIR=$(test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${datadir}") AX_SUBST(DATADIR) PKGDATADIR=$(test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${DATADIR}/${PACKAGE_NAME}") @@ -498,6 +500,12 @@ maintainer-clean-html-targets: EOF ]) +# use this in configure.ac to support HTML data for webservers +AC_DEFUN([AX_BUILD_HTML_NPM], [ + AC_CONFIG_FILES([html/package.json]) + AX_BUILD_HTML +]) + # use this in configure.ac to support C++ libraries AC_DEFUN([AX_USE_LIBTOOL], [ # libtool versioning @@ -571,6 +579,11 @@ distclean-rpm-targets: EOF ]) +# use this in configure.ac to support scripts, e.g. bash scripts +AC_DEFUN([AX_USE_ETC], [ + AC_CONFIG_FILES([etc/makefile]) +]) + # use this in configure.ac to support scripts, e.g. bash scripts AC_DEFUN([AX_USE_SCRIPTS], [ AC_CONFIG_FILES([scripts/makefile]) @@ -968,9 +981,40 @@ AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [ # - parameter: # $1 = package name AC_DEFUN([AX_DEB_DEPEND_IFEXISTS], [ - pkg=$1 + pkg="$1" if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then - DEB_DEPEND_IFEXISTS+=", ${pkg}" + DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}" fi +]) + +# require package in debian/control.in append @DEB_BUILD_DEPEND@ to Build-Depends +# - parameter: +# $1 = package name +AC_DEFUN([AX_DEB_BUILD_DEPEND], [ + pkg="$1" + DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}" +]) + +# require package in debian/control.in append @DEB_DEPEND@ to Depends +# - parameter: +# $1 = package name +AC_DEFUN([AX_DEB_DEPEND], [ + pkg="$1" + DEB_DEPEND="${DEB_DEPEND}, ${pkg}" +]) + +# require package in debian/control.in append @DEB_DEPEND@ to Depends +# - parameter: +# $1 = package name +AC_DEFUN([AX_DEB_SECTION], [ + pkg="$1" + DEB_SECTION="${pkg}" +]) + +# call after setting debian dependencies +AC_DEFUN([AX_DEB_RESOLVE], [ + AC_SUBST(DEB_BUILD_DEPEND) + AC_SUBST(DEB_DEPEND) + AC_SUBST(DEB_SECTION) AC_SUBST(DEB_DEPEND_IFEXISTS) ]) diff --git a/bootstrap.sh b/bootstrap.sh index 5a78987..089cb80 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -147,7 +147,9 @@ GENERATED FILES * src/makefile.am - if you enabled AX_USE_CXX * src/version.hxx - if you enabled AX_USE_CXX * src/version.cxx - if you enabled AX_USE_CXX - * html/makefile.am - if you enabled AX_BUILD_HTML + * etc/makefile.am - if you enable AX_USE_ETC + * html/makefile.am - if you enabled AX_BUILD_HTML or AX_BUILD_HTML_NPM + * html/package.json.in - if you enabled AX_BUILD_HTML_NPM * scripts/makefile.am - if you enabled AX_USE_SCRIPTS * nodejs/makefile.am - if you add AX_USE_NODEJS * nodejs/${DEFAULT_PROJECT_NAME}.js - if you add AX_USE_NODEJS @@ -222,7 +224,7 @@ FILE DEPENDENCIES configuration a dependent, i.e.: * test/makefile.am depends on AX_USE_LIBTOOL - * html/makefile.am depends on AX_BUILD_HTML + * html/makefile.am depends on AX_BUILD_HTML or AX_BUILD_HTML_NPM * doc/doxyfile.in depends on AX_BUILD_EXAMPLES * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_PERLDOC, AX_USE_CPPUNIT AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL @@ -256,6 +258,7 @@ FILES number. In git, git rev-list --all --count is used. The following macros are supported in configure.ac: * Enable C++: AX_USE_CXX + * Enable system config files in /etc: AX_USE_ETC * Enable LibTool library creation: AX_USE_LIBTOOL * Enable Scripts: AX_USE_SCRIPTS * Enable NodeJS project: AX_USE_NODEJS @@ -302,7 +305,7 @@ VCSDEPENDS="" if test -d .svn; then VCS="svn" VCSDEPENDS_DEB="svn2cl, subversion, subversion-tools," - VCSDEPENDS_RPM="subversion, subversion-tools," + VCSDEPENDS_RPM="subversion," echo -e " \e[32msuccess\e[0m detected ${VCS}" elif test -d .git; then VCS="git" @@ -569,6 +572,7 @@ AX_INIT_STANDARD_PROJECT # requirements, uncomment, what you need: #AX_USE_CXX +#AX_USE_ETC #AX_USE_LIBTOOL #AX_USE_SCRIPTS #AX_USE_NODEJS @@ -580,6 +584,7 @@ AX_INIT_STANDARD_PROJECT #AX_BUILD_TEST #AX_BUILD_EXAMPLES #AX_BUILD_HTML +#AX_BUILD_HTML_NPM # qt features, uncomment, what you need: #AX_CHECK_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets]) @@ -690,9 +695,13 @@ ${CHEADER}#include <${PACKAGE_NAME}.hxx> #include #include #include +#include int main(int argc, char *argv[]) try { QApplication a(argc, argv); + a.setApplicationDisplayName(a.tr("${PACKAGE_NAME}")); + a.setApplicationName(${PACKAGE_NAME}::package_name().c_str()); + a.setApplicationVersion(${PACKAGE_NAME}::version().c_str()); QCommandLineParser parser; parser.addHelpOption(); parser.process(a); @@ -725,6 +734,7 @@ class ${PackageName}: public QMainWindow, protected Ui::${PackageName} { Q_OBJECT; public: explicit ${PackageName}(QWidget *parent = 0): QMainWindow(parent) { + setTitle(tr("${PACKAGE_NAME}[*]")); setupUi(this); } virtual ~${PackageName}() {} @@ -854,6 +864,13 @@ namespace NAMESPACE { const std::string IDENT("\$Id: " PACKAGE_STRING); } EOF +to --condition AX_USE_ETC etc/makefile.am < /var/log/${PACKAGE_NAME}.log +ExecStart=/usr/bin/nodejs /usr/share/${PACKAGE_NAME}/nodejs/${PACKAGE_NAME} +StandardOutput=journal +StandardError=journal Restart=on-abort [Install] @@ -1265,11 +1284,59 @@ LDADD = -l${PACKAGE_NAME#lib} MAINTAINERCLEANFILES = makefile.in EOF -to --condition AX_BUILD_HTML html/makefile.am <&2 exit 1 @@ -102,7 +107,7 @@ while test $# -gt 0; do targets="$1" if test "$1" = "deb" -o "$1" = "rpm"; then # set mode to same value - set -- "-m" $@ + set -- "-m" "$@" continue fi ;; @@ -113,6 +118,7 @@ while test $# -gt 0; do flags+=("$1") ;; (-r|--repo) shift; + echo "OPTION: $1" repos+=("$1") ;; (-k|--key) shift; @@ -227,6 +233,7 @@ fi 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) fi +docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}" case $mode in (deb|apt) if [[ "${img}" =~ "ubuntu" ]]; then @@ -245,7 +252,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} python-software-properties apt-transport-https dpkg-dev lsb-release; for repo in "${repos[@]}"; do - ifthenelse "${repo}" "apt-add-repository ARG" + ifthenelse "${repo}" "apt-add-repository 'ARG'" done for key in "${keys[@]}"; do wget -O- "$key" \ @@ -283,7 +290,7 @@ EOF 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)) - ifthenelse "${repo}" "${INSTALL_REPO} ARG" + ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'" ((++i)) done docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh diff --git a/resolve-debbuilddeps.sh b/resolve-debbuilddeps.sh index 94c1ba1..30b0a5d 100755 --- a/resolve-debbuilddeps.sh +++ b/resolve-debbuilddeps.sh @@ -32,21 +32,24 @@ function install() { } TO_INSTALL= +DEPS= 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 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 - TO_INSTALL+=" ${f}" + DEPS+=" ${f}" fi done + for f in $(sed -n 's, *AX_DEB_BUILD_DEPEND(\([^)]*\)).*,\1,p' configure.ac); do + DEPS+=" ${f}" + done trap "rm debian/control" INT TERM EXIT - sed 's,@DEB_DEPEND_IFEXISTS@,,g' debian/control.in | \ + sed 's,@\(DEB_DEPEND_IFEXISTS\|DEB_BUILD_DEPEND\|DEB_DEPEND\)@,,g' debian/control.in | \ sed 's,@[^@]*@, dummytext,g' > debian/control fi install dpkg-dev -DEPS=$(LANG= ${DO} dpkg-checkbuilddeps 2>&1 || true) -DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') +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