From 8611fb93990f722226cd1db02f2a2b43f33a5e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 18 Nov 2015 09:25:31 +0000 Subject: [PATCH] development packages are named devel in rpms, not dev --- ChangeLog | 27 +++++++++++ ax_init_standard_project.m4 | 25 +++++++--- bootstrap.sh | 97 +++++++++++++++++++++++++++++-------- libxml-cxx.desktop.in | 9 ++++ libxml-cxx.spec.in | 2 +- resolve-debbuilddeps.sh | 29 +++++------ sql-to-dot.sed | 81 +++++++++++++++++++++++++++++++ src/version.cxx | 4 +- src/version.cxx.in | 16 ------ 9 files changed, 228 insertions(+), 62 deletions(-) create mode 100644 libxml-cxx.desktop.in create mode 100755 sql-to-dot.sed delete mode 100644 src/version.cxx.in diff --git a/ChangeLog b/ChangeLog index 451b897..bb5c0d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2015-11-07 10:47 marc + + * bootstrap.sh: there is no qt4-default + +2015-11-07 09:23 marc + + * bootstrap.sh: there is no qt4-default + +2015-11-05 09:54 marc + + * ax_init_standard_project.m4, bootstrap.sh, build-in-docker.sh, + resolve-debbuilddeps.sh: updated build system + +2015-11-03 22:54 marc + + * debian/control.in, libxml-cxx.spec.in: update dependencies + +2015-11-03 21:51 marc + + * debian/control.in: updated dependencies + +2015-11-03 14:27 marc + + * ChangeLog, ax_check_qt.m4, ax_init_standard_project.m4, + bootstrap.sh, resolve-debbuilddeps.sh: prepared for build in a + docker instance on jenkins + 2015-11-02 00:18 marc * build-resource-file.sh, resolve-debbuilddeps.sh, diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index eef210e..ccddf89 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -13,6 +13,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi done @@ -22,6 +23,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi done @@ -36,6 +38,7 @@ m4_define(x_minor_diff, mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi; done @@ -164,14 +167,18 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AX_SUBST(BUILD_NUMBER) BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") AX_SUBST(BUILD_DATE) - if test -f "${PROJECT_NAME}-logo.png"; then - PROJECT_LOGO="${PROJECT_NAME}-logo.png" + if test -f "${PACKAGE_NAME}.desktop.in"; then + PACKAGE_DESKTOP="${PACKAGE_NAME}.desktop" fi - AX_SUBST(PROJECT_LOGO) - if test -f "${PROJECT_NAME}-icon.png"; then - PROJECT_ICON="${PROJECT_NAME}-icon.png" + AX_SUBST(PACKAGE_DESKTOP) + if test -f "${PACKAGE_NAME}-logo.png"; then + PACKAGE_LOGO="${PACKAGE_NAME}-logo.png" fi - AX_SUBST(PROJECT_ICON) + AX_SUBST(PACKAGE_LOGO) + if test -f "${PACKAGE_NAME}-icon.png"; then + PACKAGE_ICON="${PACKAGE_NAME}-icon.png" + fi + AX_SUBST(PACKAGE_ICON) AC_ARG_ENABLE(pedantic, [AS_HELP_STRING([--enable-pedantic], @@ -200,6 +207,10 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ else AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG" fi + + if test -f ${PACKAGE_NAME}.desktop.in; then + AC_CONFIG_FILES([${PACKAGE_NAME}.desktop]) + fi AC_CONFIG_FILES([makefile]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in]) @@ -342,7 +353,7 @@ EOF # use this in configure.ac to support debian packages AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [ - README_DEB=$(tail -n +3 README | sed -e 's/^$/./g' -e 's/^/ /g') + README_DEB=$(tail -n +3 README | sed -e 's/^ *$/./g' -e 's/^/ /g') AC_SUBST(README_DEB) _AM_SUBST_NOTMAKE([README_DEB]) AC_CONFIG_FILES([debian/changelog debian/control]) diff --git a/bootstrap.sh b/bootstrap.sh index 550f92e..e4f444b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -110,17 +110,20 @@ GENERATED FILES * resolve-rpmbuilddeps.sh - script to install RPM package dependencies * build-in-docker.sh - script to build the project encapsulated in a docker container * 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 * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle + * test/runtests.sh - template file to run test scripts, i.e. docker based * AUTHORS - replace your name in AUTHORS before first run * NEWS - empty file add your project's news * README - add project description (first line is header, followed by an empty line) * configure.ac - global configuration file template * makefile.am - global makefile template + * ${DEFAULT_PROJECT_NAME}.desktop.in - linux desktop file * 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 - * scripts/makefile.in - if you enabled AX_USE_SCRIPTS + * scripts/makefile.am - if you enabled AX_USE_SCRIPTS * doc/makefile.am - if you enabled AX_USE_DOXYGEN * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT @@ -196,7 +199,7 @@ FILES debian/control fi -if test -n "${SCHROOTNAME}"; then - schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install dpkg-dev - DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1 || true) -else - apt-get -y install dpkg-dev - DEPS=$(dpkg-checkbuilddeps 2>&1 || true) -fi +install dpkg-dev +DEPS=$(${DO} dpkg-checkbuilddeps 2>&1 || true) DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}') for pa in ${DEPS}; do diff --git a/sql-to-dot.sed b/sql-to-dot.sed new file mode 100755 index 0000000..07b2989 --- /dev/null +++ b/sql-to-dot.sed @@ -0,0 +1,81 @@ +#! /bin/sed -nf +1i\ +/** @page database Database Schema\ +\ +@dot\ +digraph schema { + +# get everithing on one single line +H;$!d;$x + +# remove all single-line comment lines +s/\n--[^\n]*//g + +# reduce spaces +s,\t\| \+, ,g + +# remove multiline comments +:f;s,\(.*\)/\*.*\*/[ \n]*;*,\1,g;tf + +# remove empty lines +s,\n\+,\n,g + +# remove unknown commands +s,\(;\|\n\) *\(DELIMITER\|USE\|DROP\|CREATE[ \n]\+DATABASE\)[ \n]\+[^;]*;\+,,ig + +# convert special characters within quotes +:a;s/^\(\([^"]*"[^",]*"\)*[^"]*"[^"]*\),\([^"]*".*\)/\1\##COMMA##\3/g;ta +:c;s/^\(\([^']*'[^',]*'\)*[^']*'[^']*\),\([^']*'.*\)/\1\##COMMA##\3/g;tc + +# backup everything to the buffer +# then analyze only on one create table +:i +h +s,.*\(create[ \n]\+table[^;]*;\).*,\1,ig + +# start html table node +s|CREATE[ \n]\+TABLE[ \n]\+\(if[ \n]\+not[ \n]\+exists[ \n]\+\)\?`\?\(\w\+\)`\?| \2\n [shape=none, margin=0, label=<\n \n |ig + +# remove key definitions +s/[),][\n ]*\(PRIMARY[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi + +# move foreign keys as relation to the end +:b;s/\(\w\+\)\([^;]*\)FOREIGN[\n ]\+KEY[ \n]*([ \n]*`\?\([a-z]\+\)`\?[ \n]*)[ \n]*REFERENCES[ \n]*`\?\([a-z]\+\)`\?[ \n]*([ \n]*`\?\([a-z]\+\)`\?[ \n]*)[ \n]*\([^,)]*\)\([,)].*\)/\1\2\7\n \1:\3 -> \4:\5 [label="\6"]##SEMICOLON##/ig;tb + +# create table rows +s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)[ \n]\+COMMENT[ \n]*["']\([^"']*\)["'][ \n]*|\n |gi +s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n |g + +# add line breaks for long lines +s|\(]*>[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}\)|\1
\2|g +#:d;s|\(
[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}\)|\1
\2|g;td + +# add table comment below +:k;tk +s|[ \n]*)[^)]*COMMENT[ \n]*=[ \n]*["']\?\([^"']*\)["']\?[^;]*|\n
|ig;th +s|)[^);]*;|\n;|ig +:h + +# cleanup comment below, add line breaksfor long lines +s|\(]*>[^<]\{60,80\}\)[ \n]\+\([^<]\{30,\}\)|\1
\2|g +#:e;s|\(
[^<]\{60,80\}\)[ \n]\+\([^<]\{30,\}\)|\1
\2|g;te + +# close table +s|;|\n
\2
\1\2\4\5
\1\2\4
\1
\n >];|ig + +# convert ##COMMA## to , +s|##COMMA##|,|g +# convert ##SEMICOLON## to ; +s,##SEMICOLON##,;,g + +# print one table +p +# get buffer back and remove the table that has just been analyzed +x +s,\(.*\)create[ \n]\+table[^;]*;\(.*\),\1\2,ig +ti + +$a\ +}\ +@enddot\ +*/ diff --git a/src/version.cxx b/src/version.cxx index c87b294..03073bb 100644 --- a/src/version.cxx +++ b/src/version.cxx @@ -30,10 +30,10 @@ namespace NAMESPACE { return README; } std::string logo() { - return PROJECT_LOGO; + return PACKAGE_LOGO; } std::string icon() { - return PROJECT_ICON; + return PACKAGE_ICON; } const std::string WHAT("#(@) " PACKAGE_STRING); const std::string IDENT("$Id: " PACKAGE_STRING); diff --git a/src/version.cxx.in b/src/version.cxx.in deleted file mode 100644 index a211e3c..0000000 --- a/src/version.cxx.in +++ /dev/null @@ -1,16 +0,0 @@ -/*! @file - - @id $Id$ -*/ -// 1 2 3 4 5 6 7 8 -// 45678901234567890123456789012345678901234567890123456789012345678901234567890 - -#include - -namespace xml { - std::string version() { - return "@PACKAGE_NAME@-@PACKAGE_VERSION@"; - } - const std::string WHAT("#(@) @PACKAGE_NAME@-@PACKAGE_VERSION@"); - const std::string IDENT("$Id: @PACKAGE_NAME@-@PACKAGE_VERSION@ $"); -}