fixed icon and desktop file

master
Marc Wäckerlin 9 years ago
parent ba7e547082
commit e4416881d3
  1. 10
      ChangeLog
  2. 20
      ax_init_standard_project.m4
  3. 9
      bootstrap-build-environment.desktop.in
  4. 28
      bootstrap.sh
  5. 4
      scripts/ax_init_standard_project.m4
  6. 8
      scripts/bootstrap.sh
  7. 80
      sql-to-dot.sed

@ -1,3 +1,13 @@
2015-11-11 12:45 marc
* ChangeLog, README, bootstrap.sh, resolve-debbuilddeps.sh,
scripts/bootstrap.sh, scripts/test, scripts/test/runtests.sh,
sql-to-dot.sed: updated
2015-11-10 15:52 marc
* scripts/sql-to-dot.sed: making it more robust
2015-11-09 15:13 marc 2015-11-09 15:13 marc
* scripts/bootstrap.sh, scripts/resolve-debbuilddeps.sh, * scripts/bootstrap.sh, scripts/resolve-debbuilddeps.sh,

@ -167,14 +167,18 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AX_SUBST(BUILD_NUMBER) AX_SUBST(BUILD_NUMBER)
BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z")
AX_SUBST(BUILD_DATE) AX_SUBST(BUILD_DATE)
if test -f "${PROJECT_NAME}-logo.png"; then if test -f "${PACKAGE_NAME}.desktop.in"; then
PROJECT_LOGO="${PROJECT_NAME}-logo.png" PACKAGE_DESKTOP="${PACKAGE_NAME}.desktop"
fi fi
AX_SUBST(PROJECT_LOGO) AX_SUBST(PACKAGE_DESKTOP)
if test -f "${PROJECT_NAME}-icon.png"; then if test -f "${PACKAGE_NAME}-logo.png"; then
PROJECT_ICON="${PROJECT_NAME}-icon.png" PACKAGE_LOGO="${PACKAGE_NAME}-logo.png"
fi 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, AC_ARG_ENABLE(pedantic,
[AS_HELP_STRING([--enable-pedantic], [AS_HELP_STRING([--enable-pedantic],
@ -204,6 +208,10 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG" AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG"
fi fi
if test -f ${PACKAGE_NAME}.desktop.in; then
AC_CONFIG_FILES([${PACKAGE_NAME}.desktop])
fi
AC_CONFIG_FILES([makefile]) AC_CONFIG_FILES([makefile])
AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in])

@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=bootstrap-build-environment
GenericName=bootstrap-build-environment
Comment=@DESCRIPTION@
Icon=@prefix@/share/@PACKAGE_NAME@/@PACKAGE_ICON@
Exec=bootstrap-build-environment %u
Terminal=false
Categories=Qt;Utility;

@ -118,6 +118,7 @@ GENERATED FILES
* README - add project description (first line is header, followed by an empty line) * README - add project description (first line is header, followed by an empty line)
* configure.ac - global configuration file template * configure.ac - global configuration file template
* makefile.am - global makefile template * makefile.am - global makefile template
* ${DEFAULT_PROJECT_NAME}.desktop.in - linux desktop file
* src/makefile.am - if you enabled AX_USE_CXX * src/makefile.am - if you enabled AX_USE_CXX
* src/version.hxx - if you enabled AX_USE_CXX * src/version.hxx - if you enabled AX_USE_CXX
* src/version.cxx - if you enabled AX_USE_CXX * src/version.cxx - if you enabled AX_USE_CXX
@ -322,7 +323,7 @@ checkdir() {
checkfile() { checkfile() {
exists=0 exists=0
if test -f "$1"; then if test -f "$1" -o -f "$1".in; then
exists=1 exists=1
fi fi
test $exists -eq 1 test $exists -eq 1
@ -706,10 +707,10 @@ namespace NAMESPACE {
return README; return README;
} }
std::string logo() { std::string logo() {
return PROJECT_LOGO; return PACKAGE_LOGO;
} }
std::string icon() { std::string icon() {
return PROJECT_ICON; return PACKAGE_ICON;
} }
const std::string WHAT("#(@) " PACKAGE_STRING); const std::string WHAT("#(@) " PACKAGE_STRING);
const std::string IDENT("\$Id: " PACKAGE_STRING); const std::string IDENT("\$Id: " PACKAGE_STRING);
@ -721,7 +722,7 @@ ${HEADER}dist_bin_SCRIPTS =
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
EOF EOF
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am
to --condition AX_BUILD_TEST test/runtests.sh < test/runtests.sh to --condition AX_BUILD_TEST test/runtests.sh < ${0%/*}/test/runtests.sh
to --condition 'AX_BUILD_TEST|AX_USE_CPPUNIT' test/makefile.am <<EOF to --condition 'AX_BUILD_TEST|AX_USE_CPPUNIT' test/makefile.am <<EOF
${HEADER}$(if testtag AX_USE_CXX; then ${HEADER}$(if testtag AX_USE_CXX; then
cat <<EOF2 cat <<EOF2
@ -765,7 +766,7 @@ if testtag AX_USE_DOXYGEN; then
doxyreplace PROJECT_NAME "@PACKAGE_NAME@" doxyreplace PROJECT_NAME "@PACKAGE_NAME@"
doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@" doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@"
doxyreplace PROJECT_BRIEF "@DESCRIPTION@" doxyreplace PROJECT_BRIEF "@DESCRIPTION@"
doxyreplace PROJECT_LOGO "@PROJECT_LOGO@" doxyreplace PROJECT_LOGO "@top_srcdir@/@PACKACE_LOGO@"
doxyreplace INLINE_INHERITED_MEMB YES doxyreplace INLINE_INHERITED_MEMB YES
doxyreplace MULTILINE_CPP_IS_BRIEF YES doxyreplace MULTILINE_CPP_IS_BRIEF YES
doxyreplace TAB_SIZE 2 doxyreplace TAB_SIZE 2
@ -887,6 +888,17 @@ ${HEADER}%:
EOF EOF
echo 7 | to debian/compat echo 7 | to debian/compat
fi fi
to ${PACKAGE_NAME}.desktop.in <<EOF
[Desktop Entry]
Type=Application
Name=${PACKAGE_NAME}
GenericName=${PACKAGE_NAME}
Comment=@DESCRIPTION@
Icon=@prefix@/share/@PACKAGE_NAME@/@PACKAGE_ICON@
Exec=${PACKAGE_NAME} %u
Terminal=false
Categories=Qt;Utility;
EOF
to --condition AX_USE_RPM_PACKAGING ${PACKAGE_NAME}.spec.in <<EOF to --condition AX_USE_RPM_PACKAGING ${PACKAGE_NAME}.spec.in <<EOF
Summary: @DESCRIPTION@ Summary: @DESCRIPTION@
Name: @PACKAGE_NAME@ Name: @PACKAGE_NAME@
@ -960,6 +972,7 @@ $(if testtag AX_USE_LIBTOOL; then
echo '/usr/%_lib/@PACKAGE_NAME@.so.*' echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
else else
echo '/usr/bin/*' echo '/usr/bin/*'
echo '/usr/share/applications/*'
fi) fi)
%doc %doc
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
@ -1030,7 +1043,10 @@ done
to makefile.am<<EOF to makefile.am<<EOF
${HEADER}SUBDIRS =${SUBDIRS} ${HEADER}SUBDIRS =${SUBDIRS}
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog desktopdir = \${datadir}/applications
desktop_DATA = @PACKAGE_DESKTOP@
dist_pkgdata_DATA = @PACKAGE_ICON@
dist_doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
EOF EOF

@ -167,8 +167,8 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AX_SUBST(BUILD_NUMBER) AX_SUBST(BUILD_NUMBER)
BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z")
AX_SUBST(BUILD_DATE) AX_SUBST(BUILD_DATE)
if test -f "${PACKAGE_NAME}.dektop.in"; then if test -f "${PACKAGE_NAME}.desktop.in"; then
PACKAGE_DESKTOP="${PACKAGE_NAME}.dektop" PACKAGE_DESKTOP="${PACKAGE_NAME}.desktop"
fi fi
AX_SUBST(PACKAGE_DESKTOP) AX_SUBST(PACKAGE_DESKTOP)
if test -f "${PACKAGE_NAME}-logo.png"; then if test -f "${PACKAGE_NAME}-logo.png"; then

@ -323,7 +323,7 @@ checkdir() {
checkfile() { checkfile() {
exists=0 exists=0
if test -f "$1"; then if test -f "$1" -o -f "$1".in; then
exists=1 exists=1
fi fi
test $exists -eq 1 test $exists -eq 1
@ -1043,10 +1043,10 @@ done
to makefile.am<<EOF to makefile.am<<EOF
${HEADER}SUBDIRS =${SUBDIRS} ${HEADER}SUBDIRS =${SUBDIRS}
desktopdir = ${datadir}/applications desktopdir = \${datadir}/applications
desktop_DATA = @PACKAGE_DESKTOP@ desktop_DATA = @PACKAGE_DESKTOP@
pkgdata_DATA = @PACKAGE_ICON@ dist_pkgdata_DATA = @PACKAGE_ICON@
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog dist_doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
EOF EOF

@ -1,39 +1,79 @@
#! /bin/sed -f #! /bin/sed -nf
1i\ 1i\
/** @page database Database Schema\ /** @page database Database Schema\
\ \
@dot\ @dot\
digraph schema { digraph schema {
# remove newlines # get everithing on one single line
:a;N;$!ba;s/\n/ /g H;$!d;$x
# remove all single-line comment lines
s/\n--[^\n]*//g
# reduce spaces # reduce spaces
s, \+, ,g 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 <table bgcolor="#dddddd">\n <tr><td bgcolor="#ddddff" colspan="4"><b>\2</b></td></tr>|ig
s| *CREATE *TABLE *\(if *not *exists\)\? *`\?\([a-z]\+\)`\? *|\n \2\n [shape=none, margin=0, label=<\n <table bgcolor="#dddddd">\n <tr><td bgcolor="#ddddff" colspan="4"><b>\2</b></td></tr>\n|ig # remove key definitions
s/[),][\n ]*\(PRIMARY[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi
s/varchar *( *\([0-9]\+\) *)/varchar[\1]/ig # 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
s/ *PRIMARY KEY *( *`\?\([a-z]\+\)`\? *) *[,)]//ig # create table rows
s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)[ \n]\+COMMENT[ \n]*["']\([^"']*\)["'][ \n]*|\n <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\4</td><td align="left">\5</td></tr>|gi
s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\4</td></tr>|g
:b;s/\([a-z]\+\)\([^;]*\)FOREIGN KEY *( *`\?\([a-z]\+\)`\? *) *REFERENCES *`\?\([a-z]\+\)`\? *( *`\?\([a-z]\+\)`\? *) *\([^,)]*\)[,)]\(.*\)/\1\2\7\n \1:\3 -> \4:\5/ig;tb # add line breaks for long lines
s|\(<td[^>]*>[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}</td>\)|\1<br/>\2|g
#:d;s|\(<br/>[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}</td>\)|\1<br/>\2|g;td
:c;s|\n[(,] *`\?\([a-z]\+\)`\? *\([^ ]\+\)*\([^,)]*\) *COMMENT *[`"']\([^`"']*\)[`"'] *[,)]|\n <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\3</td><td align="left">\4</td></tr>\n,|ig;tc # add table comment below
:k;tk
s|[ \n]*)[^)]*COMMENT[ \n]*=[ \n]*["']\?\([^"']*\)["']\?[^;]*|\n <tr><td bgcolor="#ddddff" colspan="4">\1</td></tr>|ig;th
s|)[^);]*;|\n;|ig
:h
s| \+</td>|</td>|g # cleanup comment below, add line breaksfor long lines
s|<td> \+|<td>|g s|\(<td[^>]*>[^<]\{60,80\}\)[ \n]\+\([^<]\{30,\}</td>\)|\1<br/>\2|g
s|\(<td[^>]*>[^<]\{30,40\}\) \+\([^<]\{20,\}</td>\)|\1<br/>\2|g #:e;s|\(<br/>[^<]\{60,80\}\)[ \n]\+\([^<]\{30,\}</td>\)|\1<br/>\2|g;te
:d;s|\(<br/>[^<]\{30,40\}\) \+\([^<]\{20,\}</td>\)|\1<br/>\2|g;td
s| *COMMENT *= *["']\?\([^"']*\)["']\?|\n <tr><td bgcolor="#ddddff" colspan="4">\1</td></tr>|ig # close table
s|;|\n </table>\n >];|ig
s| \+</td>|</td>|g # convert ##COMMA## to ,
s|<td> \+|<td>|g s|##COMMA##|,|g
s|\(<td[^>]*>[^<]\{60,80\}\) \+\([^<]\{30,\}</td>\)|\1<br/>\2|g # convert ##SEMICOLON## to ;
:e;s|\(<br/>[^<]\{60,80\}\) \+\([^<]\{30,\}</td>\)|\1<br/>\2|g;te s,##SEMICOLON##,;,g
s/\n,[^\n]*/\n/g # print one table
s|;|\n </table>\n >];\n|ig p
# get buffer back and remove the table that has just been analyzed
x
s,\(.*\)create[ \n]\+table[^;]*;\(.*\),\1\2,ig
ti
$a\ $a\
}\ }\

Loading…
Cancel
Save