diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 211513a..91c0072 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -1,16 +1,16 @@ # SYNOPSIS # # Check if a module exists: -# AX_CXX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # Abort if a module does not exist: -# AX_CXX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # DESCRIPTIONS # # qt_prefix # -# Each call to AX_CXX_CHECK_QT should have a different prefix +# Each call to AX_CHECK_QT should have a different prefix # value (with a few exceptions discussed later on). This value, # usually provided in uppercase, is used as prefix to the # variables holding the compiler flags and libraries reported by @@ -43,12 +43,18 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ AC_MSG_CHECKING([for $2]) AC_ARG_VAR([$1], [path to Qt tool $2]) $1=${$1:-$(${PKG_CONFIG} --variable=$2_location Qt5Core)} + $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2-qt5} $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2} $1=${$1:-$(${PKG_CONFIG} --variable=$2_location QtCore)} $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2} + $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2-qt4} if ! which "${$1%% *}" > /dev/null; then - if which "$2" > /dev/null; then + if which "$2-qt5" > /dev/null; then + $1=$2-qt5 + elif which "$2" > /dev/null; then $1=$2 + elif which "$2-qt4" > /dev/null; then + $1=$2-qt4 else HAVE_$1=0 $1="" @@ -179,13 +185,13 @@ qrc_%.cxx: %.qrc # SYNOPSIS # -# AX_CXX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # DESCRIPTIONS # # qt_prefix # -# Each call to AX_CXX_CHECK_QT should have a different prefix +# Each call to AX_CHECK_QT should have a different prefix # value (with a few exceptions discussed later on). This value, # usually provided in uppercase, is used as prefix to the # variables holding the compiler flags and libraries reported by diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 347a47d..a2dbd87 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -3,45 +3,46 @@ ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 +# m4_esyscmd_s does not exist on centos 5 and 6 +m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))]) + # define least version number from subversion's revision number: # it is taken modulo 256 due to a bug on Apple's MacOSX -m4_define(x_least, m4_esyscmd_s( +m4_define(x_least, mrw_esyscmd_s([ SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" 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') - (cd $path && svn2cl) break; fi done # Mac does not support LEAST > 255 echo $ECHO_N $(($SVN_REVISION%256)) -)) +])) # define version number from subversion's revision number: # it is taken modulo 256 due to a bug on Apple's MacOSX # add to x_minor if revision number is > 256 -m4_define(x_minor_fixed, m4_esyscmd_s( +m4_define(x_minor_fixed, mrw_esyscmd_s([ SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" 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') - (cd $path && svn2cl) break; fi done # Mac does not support LEAST > 255 echo $ECHO_N $((x_minor+$SVN_REVISION/256)) -)) +])) # setup version number -m4_define(x_version, m4_esyscmd_s( +m4_define(x_version, mrw_esyscmd_s([ echo $ECHO_N x_major.x_minor_fixed.x_least -)) +])) ## bugreport mail address is taken from in first line of AUTHORS -m4_define(x_bugreport, m4_esyscmd_s( +m4_define(x_bugreport, mrw_esyscmd_s([ head -1 AUTHORS | \ sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp' -)) +])) m4_include(ax_check_qt.m4) @@ -84,7 +85,7 @@ AC_DEFUN([AX_ADD_MAKEFILE_TARGET_DEP], [ # $1 = variable name AC_DEFUN([AX_SUBST], [ AC_SUBST([$1]) - tmp_var=$(echo "${$1}" | awk 1 ORS='\\n') + tmp_var=$(echo "${$1}" | awk 1 ORS='\\n' | sed 's,\\n$,,') tmp_var=${tmp_var//\"/\\\"} tmp_var=${tmp_var//\'/\'\"\'\"\'} tmp_var=${tmp_var//#/\\#} @@ -116,7 +117,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ esac AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") AM_CONDITIONAL(MAC, test "$MAC" = "yes") - AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'" + AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) README=$(tail -n +3 README) @@ -164,7 +165,6 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ test -f makefile.in && cat >> makefile.in <> makefile.in </dev/null -} -MOC="$(checkqt moc)" UIC="$(checkqt uic)" RCC="$(checkqt rcc)" \ - LUPDATE="$(checkqt lupdate)" LRELEASE="$(checkqt lrelease)" \ - CPPFLAGS="-I/usr/include/PCSC -I/usr/include/pkcs11-helper-1.0" \ - ./configure --prefix=/usr \ - --docdir=/usr/share/doc/packages/@PACKAGENAME@ \ - --libdir=/usr/%_lib +./configure --prefix=/usr \ + --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \ + --libdir=/usr/%_lib %build make @@ -43,20 +47,19 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -/usr/%_lib/lib@PACKAGENAME@.so.* -/usr/share/@PACKAGENAME@ +/usr/%_lib/@PACKAGE_NAME@.so.* %doc -/usr/share/doc/packages/@PACKAGENAME@/AUTHORS -/usr/share/doc/packages/@PACKAGENAME@/COPYING -/usr/share/doc/packages/@PACKAGENAME@/ChangeLog -/usr/share/doc/packages/@PACKAGENAME@/INSTALL -/usr/share/doc/packages/@PACKAGENAME@/NEWS -/usr/share/doc/packages/@PACKAGENAME@/README +/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS +/usr/share/doc/packages/@PACKAGE_NAME@/COPYING +/usr/share/doc/packages/@PACKAGE_NAME@/ChangeLog +/usr/share/doc/packages/@PACKAGE_NAME@/INSTALL +/usr/share/doc/packages/@PACKAGE_NAME@/NEWS +/usr/share/doc/packages/@PACKAGE_NAME@/README %package devel -Summary: @PACKAGENAME@ Proxy interface for Unix/Mac/Windows (development files) +Summary: @DESCRIPTION@ Group: Development/Libraries/C++ -Requires: @PACKAGENAME@ = @VERSION@ +Requires: @PACKAGE_NAME@ = @VERSION@ %description devel @README@ @@ -65,14 +68,13 @@ This Package contains all files required for developement. %files devel %defattr(-,root,root,-) -/usr/%_lib/lib@PACKAGENAME@.so -/usr/%_lib/lib@PACKAGENAME@.a +/usr/%_lib/@PACKAGE_NAME@.so +/usr/%_lib/@PACKAGE_NAME@.a +/usr/%_lib/@PACKAGE_NAME@.la /usr/%_lib/pkgconfig -/usr/%_lib/lib@PACKAGENAME@.la /usr/include/ -/usr/share/pkgconfig %doc -/usr/share/doc/packages/@PACKAGENAME@/html -/usr/share/doc/packages/@PACKAGENAME@/@PACKAGENAME@.spec +/usr/share/doc/packages/@PACKAGE_NAME@/html %changelog +