diff options
Diffstat (limited to 'qt-recordmydesktop/m4')
-rw-r--r-- | qt-recordmydesktop/m4/Makefile.am | 7 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/as-ac-expand.m4 | 43 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/as-python.m4 | 218 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/as-version.m4 | 59 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/common.mk | 28 | ||||
-rwxr-xr-x | qt-recordmydesktop/m4/py-compile-destdir | 153 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/pychecker.mk | 43 | ||||
-rw-r--r-- | qt-recordmydesktop/m4/python.mk | 11 |
8 files changed, 562 insertions, 0 deletions
diff --git a/qt-recordmydesktop/m4/Makefile.am b/qt-recordmydesktop/m4/Makefile.am new file mode 100644 index 0000000..213bdde --- /dev/null +++ b/qt-recordmydesktop/m4/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = as-python.m4 \ + as-version.m4 \ + as-ac-expand.m4 \ + py-compile-destdir \ + common.mk \ + python.mk \ + pychecker.mk diff --git a/qt-recordmydesktop/m4/as-ac-expand.m4 b/qt-recordmydesktop/m4/as-ac-expand.m4 new file mode 100644 index 0000000..7bd0a61 --- /dev/null +++ b/qt-recordmydesktop/m4/as-ac-expand.m4 @@ -0,0 +1,43 @@ +dnl as-ac-expand.m4 0.1.0 +dnl autostars m4 macro for expanding directories using configure's prefix +dnl thomas@apestaart.org + +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl example +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local + +AC_DEFUN([AS_AC_EXPAND], +[ + EXP_VAR=[$1] + FROM_VAR=[$2] + + dnl first expand prefix and exec_prefix if necessary + prefix_save=$prefix + exec_prefix_save=$exec_prefix + + dnl if no prefix given, then use /usr/local, the default prefix + if test "x$prefix" = "xNONE"; then + prefix=/usr/local + fi + dnl if no exec_prefix given, then use prefix + if test "x$exec_prefix" = "xNONE"; then + exec_prefix=$prefix + fi + + full_var="$FROM_VAR" + dnl loop until it doesn't change anymore + while true; do + new_full_var="`eval echo $full_var`" + if test "x$new_full_var"="x$full_var"; then break; fi + full_var=$new_full_var + done + + dnl clean up + full_var=$new_full_var + AC_SUBST([$1], "$full_var") + + dnl restore prefix and exec_prefix + prefix=$prefix_save + exec_prefix=$exec_prefix_save +]) diff --git a/qt-recordmydesktop/m4/as-python.m4 b/qt-recordmydesktop/m4/as-python.m4 new file mode 100644 index 0000000..e810fa5 --- /dev/null +++ b/qt-recordmydesktop/m4/as-python.m4 @@ -0,0 +1,218 @@ +dnl as-python.m4 0.1.0 +dnl autostars m4 macro for python checks + +dnl From Andrew Dalke +dnl Updated by James Henstridge +dnl Updated by Andy Wingo to loop through possible pythons +dnl Updated by Thomas Vander Stichele to check for presence of packages/modules + +dnl $Id: as-python.m4,v 1.1.1.1 2007-04-27 02:45:16 iovar Exp $ + +# AS_PATH_PYTHON([MINIMUM-VERSION]) + +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. + +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. + +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). + +# If the MINIMUM-VERSION argument is passed, AS_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. + +# Updated to loop over all possible python binaries by Andy Wingo +# <wingo@pobox.com> + +AC_DEFUN([AS_PATH_PYTHON], + [ + dnl Find a version of Python. I could check for python versions 1.4 + dnl or earlier, but the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5, and I don't want to maintain that logic. + + dnl should we do the version check? + ifelse([$1],[], + [AC_PATH_PROG(PYTHON, python python2.1 python2.0 python1.6 python1.5)], + [ + AC_MSG_NOTICE(Looking for Python version >= $1) + changequote(<<, >>)dnl + prog=" +import sys, string +minver = '$1' +pyver = string.split(sys.version)[0] # first word is version string +# split strings by '.'. just compare textually to allow for versions like +# 2.4.1a0 +minver = string.split(minver, '.') +pyver = string.split(pyver, '.') +# we can now do comparisons on the two lists: +if pyver >= minver: + sys.exit(0) +else: + sys.exit(1)" + changequote([, ])dnl + + python_good=false + for python_candidate in python python2.2 python2.1 python2.0 python2 python1.6 python1.5; do + unset PYTHON + AC_PATH_PROG(PYTHON, $python_candidate) 1> /dev/null 2> /dev/null + + if test "x$PYTHON" = "x"; then continue; fi + + if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC; then + AC_MSG_CHECKING(["$PYTHON":]) + AC_MSG_RESULT([okay]) + python_good=true + break; + else + dnl clear the cache val + unset ac_cv_path_PYTHON + fi + done + ]) + + if test "$python_good" != "true"; then + AC_MSG_ERROR([No suitable version of python found]) + fi + + AC_MSG_CHECKING([local Python configuration]) + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. Need to change quote character because of [:3] + + AC_SUBST(PYTHON_VERSION) + changequote(<<, >>)dnl + PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` + changequote([, ])dnl + + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST(PYTHON_PREFIX) + PYTHON_PREFIX='${prefix}' + + AC_SUBST(PYTHON_EXEC_PREFIX) + PYTHON_EXEC_PREFIX='${exec_prefix}' + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_SUBST(PYTHON_PLATFORM) + PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"` + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behaviour + dnl is more consistent with lispdir.m4 for example. + dnl + dnl Also, if the package prefix isn't the same as python's prefix, + dnl then the old $(pythondir) was pretty useless. + + AC_SUBST(pythondir) + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpythondir) + pkgpythondir=\${pythondir}/$PACKAGE + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. + + AC_SUBST(pyexecdir) + pyexecdir=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + dnl Maybe this should be put in python.am? + + AC_SUBST(pkgpyexecdir) + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + AC_MSG_RESULT([looks good]) +]) + +dnl AS_PYTHON_IMPORT(PACKAGE/MODULE, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND, [PREAMBLE, [POSTAMBLE]]]]) +dnl Try to import the given PACKAGE/MODULE + +AC_DEFUN([AS_PYTHON_IMPORT], +[ + dnl Check if we can import a given module. + dnl Requires AS_PATH_PYTHON to be called before. + + AC_MSG_CHECKING([for python module $1]) + + prog=" +import sys + +try: + $4 + import $1 + $5 + sys.exit(0) +except ImportError: + sys.exit(1) +except SystemExit: + raise +except Exception, e: + print ' Error while trying to import $1:' + print ' %r: %s' % (e, e) + sys.exit(1)" + +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC +then + AC_MSG_RESULT(found) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(not found) + ifelse([$3], , :, [$3]) +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + [ + AC_REQUIRE([AM_PATH_PYTHON]) + AC_MSG_CHECKING(for headers required to compile python extensions) + + dnl deduce PYTHON_INCLUDES + py_prefix=`$PYTHON -c "import sys; print sys.prefix"` + py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + AC_SUBST(PYTHON_INCLUDES) + + dnl check if the headers exist: + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include <Python.h>],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) diff --git a/qt-recordmydesktop/m4/as-version.m4 b/qt-recordmydesktop/m4/as-version.m4 new file mode 100644 index 0000000..343f408 --- /dev/null +++ b/qt-recordmydesktop/m4/as-version.m4 @@ -0,0 +1,59 @@ +dnl version.m4 0.0.6 +dnl autostars m4 macro for versioning +dnl thomas@apestaart.org +dnl +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO) +dnl example +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,) +dnl for a 0.3.2 release version +dnl +dnl this macro +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE +dnl - executes the relevant action +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE +dnl as well as the little ones +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents +dnl maintainer mode from running ok +dnl +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h + +AC_DEFUN([AS_VERSION], +[ + PACKAGE=[$1] + [$2]_MAJOR=[$3] + [$2]_MINOR=[$4] + [$2]_MICRO=[$5] + NANO=[$6] + [$2]_NANO=$NANO + if test "x$NANO" = "x" || test "x$NANO" = "x0"; + then + AC_MSG_NOTICE(configuring [$1] for release) + VERSION=[$3].[$4].[$5] + [$2]_RELEASE=1 + dnl execute action + ifelse([$7], , :, [$7]) + else + AC_MSG_NOTICE(configuring [$1] for development with nano $NANO) + VERSION=[$3].[$4].[$5].$NANO + [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S` + dnl execute action + ifelse([$8], , :, [$8]) + fi + + [$2]=$VERSION + AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version]) + AC_SUBST([$2]) + AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version]) + AC_SUBST([$2]_RELEASE) + + AC_SUBST([$2]_MAJOR) + AC_SUBST([$2]_MINOR) + AC_SUBST([$2]_MICRO) + AC_SUBST([$2]_NANO) + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name]) + AC_SUBST(PACKAGE) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version]) + AC_SUBST(VERSION) +]) diff --git a/qt-recordmydesktop/m4/common.mk b/qt-recordmydesktop/m4/common.mk new file mode 100644 index 0000000..e6b86a1 --- /dev/null +++ b/qt-recordmydesktop/m4/common.mk @@ -0,0 +1,28 @@ +clean-local: + @rm -rf _trial_temp + +test: + @make check -C flumotion/test + +check-docs: + @make check -C doc/reference + +coverage: + @trial --coverage coverage -R flumotion.test + @$(PYTHON) common/show-coverage.py _trial_temp/coverage/flumotion.* + +fixme: + tools/fixme | less -R + +release: dist + make $(PACKAGE)-$(VERSION).tar.bz2.md5 + +# generate md5 sum files +%.md5: % + md5sum $< > $@ + +# generate a sloc count +sloc: + sloccount flumotion | grep "(SLOC)" | cut -d = -f 2 + +.PHONY: test diff --git a/qt-recordmydesktop/m4/py-compile-destdir b/qt-recordmydesktop/m4/py-compile-destdir new file mode 100755 index 0000000..e85695e --- /dev/null +++ b/qt-recordmydesktop/m4/py-compile-destdir @@ -0,0 +1,153 @@ +#!/bin/sh +# py-compile - Compile a Python program + +# modified by thomasvs to have DESTDIR support so rpm packages have correct +# compiled-in paths + +scriptversion=2004-01-12.23 + +# Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +if [ -z "$PYTHON" ]; then + PYTHON=python +fi + +basedir= + +#echo "THOMAS: args: $*" +loop=true +while test "x$loop" = "xtrue" +do + case "$1" in + --basedir) + basedir=$2 + if test -z "$basedir"; then + echo "$0: Missing argument to --basedir." 1>&2 + exit 1 + fi + shift 2 + ;; + --destdir) + destdir=$2 + if test -z "$destdir"; then + echo "$0: Missing argument to --destdir." 1>&2 + exit 1 + fi + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: py-compile [--help] [--version] [--basedir DIR] FILES..." + +Byte compile some python scripts FILES. This should be performed +after they have been moved to the final installation location + +Report bugs to <bug-automake@gnu.org>. +EOF + exit 0 + ;; + -v|--v*) + echo "py-compile $scriptversion" + exit 0 + ;; + *) + loop=false + ;; + esac +done + +if [ $# = 0 ]; then + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 +fi + +# if basedir was given, then it should be prepended to filenames before +# byte compilation. +if [ -z "$basedir" ]; then + trans=" path = file" +else + trans=" path = os.path.join('$basedir', file)" +fi + +# if destdir was given, then it should be stripped from path when storing +# the intended file name +if [ -z "$destdir" ]; then + transdfile=" dfile = path" +else + transdfile=" + if path.startswith('$destdir'): + dfile = path.split('$destdir')[1] + else: + dfile = path + " +fi +#echo "THOMAS: args after parse: $*" +#echo THOMAS: transdfile: $transdfile + +$PYTHON -c " +import sys, os, string, py_compile + +files = '''$*''' +# print 'THOMAS: files: %s' % files +print 'Byte-compiling python modules...' +for file in string.split(files): +$trans + # print 'THOMAS: looking at file %s for path %s' % (file, path) +$transdfile + # print 'THOMAS: dfile: %s' % dfile + if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + # print 'THOMAS: compiling path %s' % path + py_compile.compile(path, dfile=dfile) +print" || exit $? + +# this will fail for python < 1.5, but that doesn't matter ... +$PYTHON -O -c " +import sys, os, string, py_compile + +files = '''$*''' +print 'Byte-compiling python modules (optimized versions) ...' +for file in string.split(files): +$trans +$transdfile + if not os.path.exists(path) or not (len(path) >= 3 and path[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + py_compile.compile(path, dfile=dfile) +print" 2>/dev/null || : + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/qt-recordmydesktop/m4/pychecker.mk b/qt-recordmydesktop/m4/pychecker.mk new file mode 100644 index 0000000..1e1f72a --- /dev/null +++ b/qt-recordmydesktop/m4/pychecker.mk @@ -0,0 +1,43 @@ +# include this snippet for the pychecker stuff +# Makefile.am needs to define +# PYCHECKER_WHITELIST +# and +# PYCHECKER_BLACKLIST + +# we redirect stderr so we don't get messages like +# warning: couldn't find real module for class SSL.Error (module name: SSL) +# which can't be turned off in pychecker +pycheckersplit: + @echo running pychecker on each file ... + @for file in $(filter-out $(PYCHECKER_BLACKLIST),$(wildcard $(PYCHECKER_WHITELIST))); \ + do \ + PYTHONPATH=`pwd` \ + pychecker -Q -F misc/pycheckerrc \ + `ls $(top_srcdir)/misc/setup.py 2> /dev/null` \ + `ls $(top_srcdir)/misc/pycheckerhelp.py 2> /dev/null` \ + $$file \ + > /dev/null 2>&1; \ + if test $$? -ne 0; then \ + echo "Error on $$file"; \ + pychecker -Q -F misc/pycheckerrc \ + `ls $(top_srcdir)/misc/setup.py 2> /dev/null` \ + `ls $(top_srcdir)/misc/pycheckerhelp.py 2> /dev/null` \ + $$file; break; fi; \ + done + +pychecker: + @echo running pychecker ... + @PYTHONPATH=`pwd` \ + pychecker -Q -F misc/pycheckerrc \ + `ls $(top_srcdir)/misc/setup.py 2> /dev/null` \ + `ls $(top_srcdir)/misc/pycheckerhelp.py 2> /dev/null` \ + $(filter-out $(PYCHECKER_BLACKLIST),$(wildcard $(PYCHECKER_WHITELIST)))\ + 2> /dev/null || make pycheckerverbose + +pycheckerverbose: + @echo running pychecker ... + PYTHONPATH=`pwd` \ + pychecker -F misc/pycheckerrc \ + `ls $(top_srcdir)/misc/setup.py 2> /dev/null` \ + `ls $(top_srcdir)/misc/pycheckerhelp.py 2> /dev/null` \ + $(filter-out $(PYCHECKER_BLACKLIST),$(wildcard $(PYCHECKER_WHITELIST))) diff --git a/qt-recordmydesktop/m4/python.mk b/qt-recordmydesktop/m4/python.mk new file mode 100644 index 0000000..244df22 --- /dev/null +++ b/qt-recordmydesktop/m4/python.mk @@ -0,0 +1,11 @@ +py_compile = $(top_srcdir)/m4/py-compile-destdir --destdir $(DESTDIR) + +#if HAVE_PYCHECKER +#check-local: $(PYCHECKER_FILES) +# if test ! -z "$(PYCHECKER_FILES)"; \ +# then \ +# PYTHONPATH=$(top_srcdir):$(top_builddir) \ +# pychecker -Q -F $(top_srcdir)/misc/pycheckerrc \ +# $(PYCHECKER_FILES); \ +# fi +#endif |