From 0e4037b4776ba30e5c718a92a22b3f24d33695bf1c6b4a61484e21de261af54f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 16 Oct 2007 23:31:34 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gtk?expand=0&rev=6 --- python-gtk-acinclude.m4 | 129 ++++++++++++++++++++++++++++++++++++++++ python-gtk.changes | 8 +++ python-gtk.spec | 21 +++++-- 3 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 python-gtk-acinclude.m4 diff --git a/python-gtk-acinclude.m4 b/python-gtk-acinclude.m4 new file mode 100644 index 0000000..fa6d903 --- /dev/null +++ b/python-gtk-acinclude.m4 @@ -0,0 +1,129 @@ +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) +dnl +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=$ac_default_prefix + 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 +]) + +dnl +dnl JH_ADD_CFLAG(FLAG) +dnl checks whether the C compiler supports the given flag, and if so, adds +dnl it to $CFLAGS. If the flag is already present in the list, then the +dnl check is not performed. +AC_DEFUN([JH_ADD_CFLAG], +[ +case " $CFLAGS " in +*@<:@\ \ @:>@$1@<:@\ \ @:>@*) + ;; +*) + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_MSG_CHECKING([whether [$]CC understands $1]) + AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no]) + AC_MSG_RESULT($jh_has_option) + if test $jh_has_option = no; then + CFLAGS="$save_CFLAGS" + fi + ;; +esac]) + +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +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"` +if test -x "$PYTHON-config"; then +PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` +else +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 +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include ],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +]) + diff --git a/python-gtk.changes b/python-gtk.changes index c82500c..beb6c3a 100644 --- a/python-gtk.changes +++ b/python-gtk.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 16 18:25:49 CEST 2007 - sbrabec@suse.cz + +- Fixed autoreconf. +- Use requirement versions defined by upstream. +- Use %fdupes. +- Fixed scripts executable flag. + ------------------------------------------------------------------- Thu Sep 20 11:57:38 CEST 2007 - sbrabec@suse.cz diff --git a/python-gtk.spec b/python-gtk.spec index 3d27117..8c2c5ee 100644 --- a/python-gtk.spec +++ b/python-gtk.spec @@ -12,7 +12,7 @@ Name: python-gtk %define _name pygtk -BuildRequires: libglade2-devel python-cairo-devel python-devel python-gobject2-devel python-numeric +BuildRequires: fdupes libglade2-devel python-cairo-devel python-devel python-gobject2-devel python-numeric %if %suse_version > 1020 || 0%{?opensuse_bs} BuildRequires: python-gobject2-doc %endif @@ -21,14 +21,16 @@ BuildRequires: gtk-doc Url: http://www.pygtk.org/ Summary: Python bindings for the GTK+ widget set Version: 2.12.0 -Release: 1 +Release: 2 License: LGPL v2 or later Group: Development/Libraries/Python Source: %{_name}-%{version}.tar.bz2 +Source1: python-gtk-acinclude.m4 BuildRoot: %{_tmppath}/%{name}-%{version}-build -AutoReqProv: on -Requires: python-cairo python-numeric python-gobject2 -Requires: gtk2 >= %(rpm -q --queryformat=%{VERSION} gtk2) +%define lparen ( +%define rparen ) +%define python_gtk_req %(zgrep -a _required_version %{S:0} | sed -n 's/_required_version,[[:space:]]*/ >= /;s/%{rparen}$//;s/1.0.2%{rparen} dnl or 1.1.7/1.1.7/;s/\\%{lparen}glib\\|gtk\\|libglade\\%{rparen}/&2/;s/py\\%{lparen}.*\\%{rparen} /python-\\1 /;/gtk2unixprint/d;s/^m4_define%{lparen}//p' | tr '\\n' ' ') +Requires: %python_gtk_req python-numeric %{py_requires} %description @@ -77,6 +79,7 @@ Authors: %prep %setup -q -n %{_name}-%{version} +cat %{S:1} >>acinclude.m4 %build autoreconf -f -i @@ -88,6 +91,9 @@ make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -v mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name} cp -a AUTHORS NEWS README MAPPING ChangeLog THREADS COPYING examples $RPM_BUILD_ROOT%{_docdir}/%{name} +chmod +x $RPM_BUILD_ROOT%{_libdir}/pygtk/2.0/{,*/}*.py $RPM_BUILD_ROOT%{_datadir}/pygtk/2.0/*/*.py +%fdupes $RPM_BUILD_ROOT%{_libdir} +%fdupes $RPM_BUILD_ROOT%{_datadir} %clean rm -rf $RPM_BUILD_ROOT @@ -112,6 +118,11 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %{_datadir}/gtk-doc/html/* %changelog +* Tue Oct 16 2007 - sbrabec@suse.cz +- Fixed autoreconf. +- Use requirement versions defined by upstream. +- Use %%fdupes. +- Fixed scripts executable flag. * Thu Sep 20 2007 - sbrabec@suse.cz - Updated to version 2.12.0: * Make pango bindings more pythonic