This commit is contained in:
parent
003eedb5da
commit
0e4037b477
129
python-gtk-acinclude.m4
Normal file
129
python-gtk-acinclude.m4
Normal file
@ -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 <Python.h>],dnl
|
||||||
|
[AC_MSG_RESULT(found)
|
||||||
|
$1],dnl
|
||||||
|
[AC_MSG_RESULT(not found)
|
||||||
|
$2])
|
||||||
|
CPPFLAGS="$save_CPPFLAGS"
|
||||||
|
])
|
||||||
|
|
@ -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
|
Thu Sep 20 11:57:38 CEST 2007 - sbrabec@suse.cz
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
Name: python-gtk
|
Name: python-gtk
|
||||||
%define _name pygtk
|
%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}
|
%if %suse_version > 1020 || 0%{?opensuse_bs}
|
||||||
BuildRequires: python-gobject2-doc
|
BuildRequires: python-gobject2-doc
|
||||||
%endif
|
%endif
|
||||||
@ -21,14 +21,16 @@ BuildRequires: gtk-doc
|
|||||||
Url: http://www.pygtk.org/
|
Url: http://www.pygtk.org/
|
||||||
Summary: Python bindings for the GTK+ widget set
|
Summary: Python bindings for the GTK+ widget set
|
||||||
Version: 2.12.0
|
Version: 2.12.0
|
||||||
Release: 1
|
Release: 2
|
||||||
License: LGPL v2 or later
|
License: LGPL v2 or later
|
||||||
Group: Development/Libraries/Python
|
Group: Development/Libraries/Python
|
||||||
Source: %{_name}-%{version}.tar.bz2
|
Source: %{_name}-%{version}.tar.bz2
|
||||||
|
Source1: python-gtk-acinclude.m4
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
AutoReqProv: on
|
%define lparen (
|
||||||
Requires: python-cairo python-numeric python-gobject2
|
%define rparen )
|
||||||
Requires: gtk2 >= %(rpm -q --queryformat=%{VERSION} gtk2)
|
%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}
|
%{py_requires}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -77,6 +79,7 @@ Authors:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{_name}-%{version}
|
%setup -q -n %{_name}-%{version}
|
||||||
|
cat %{S:1} >>acinclude.m4
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -f -i
|
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
|
find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -v
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
|
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
|
||||||
cp -a AUTHORS NEWS README MAPPING ChangeLog THREADS COPYING examples $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
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -112,6 +118,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_datadir}/gtk-doc/html/*
|
%{_datadir}/gtk-doc/html/*
|
||||||
%changelog
|
%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
|
* Thu Sep 20 2007 - sbrabec@suse.cz
|
||||||
- Updated to version 2.12.0:
|
- Updated to version 2.12.0:
|
||||||
* Make pango bindings more pythonic
|
* Make pango bindings more pythonic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user