summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-04-21 09:31:01 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-04-21 09:31:01 +0000
commit3a0f5530d80b0b331d2fd6a081485b2248a1f097 (patch)
tree006b038fb6c14ff9edd5d64d136398d1e732c11e
parent6fe397321747ac77231fe8155b4b6160a630344d (diff)
downloadpygtk-3a0f5530d80b0b331d2fd6a081485b2248a1f097.tar.gz
add devel packages and glarea package to build.
2001-04-21 James Henstridge <james@daa.com.au> * gnome-python.spec: add devel packages and glarea package to build. * pygnome/generate/Makefile.am (defsdir): install the defs files. * pygnome/Makefile.am, pygnome/gnome/Makefile.am: change some directory var names. * acinclude.m4: include newer macro * configure.in: use updated AM_PATH_PYTHON_JH macro 2001-04-21 James Henstridge <james@daa.com.au> * pygtk.spec: create devel subpackage to hold all the development files. * Makefile.am, pyglade/Makefile.am: use newer var names. * acinclude.m4: include updated macro. * configure.in: use my more useful AM_PATH_PYTHON_JH macro that does a python version check.
-rw-r--r--ChangeLog10
-rw-r--r--Makefile.am4
-rw-r--r--acinclude.m4134
-rw-r--r--configure.in2
-rw-r--r--pyglade/Makefile.am2
-rw-r--r--pygtk.spec36
6 files changed, 182 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c39f5b1..4520f63d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2001-04-21 James Henstridge <james@daa.com.au>
+ * pygtk.spec: create devel subpackage to hold all the development
+ files.
+
+ * Makefile.am, pyglade/Makefile.am: use newer var names.
+
+ * acinclude.m4: include updated macro.
+
+ * configure.in: use my more useful AM_PATH_PYTHON_JH macro that
+ does a python version check.
+
* generate/Makefile.am: install code generator and defs files.
Install pygtk-codegen-1.2 script.
diff --git a/Makefile.am b/Makefile.am
index 861cf753..c53a2177 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,6 @@ else
pixbuf_libs =
endif
-pyexecdir = $(PYTHON_SITE_EXEC)
pyexec_LTLIBRARIES = _gtkmodule.la $(imlib_libs) $(gtkgl_libs) \
$(libglade_libs) $(pixbuf_libs)
@@ -59,8 +58,7 @@ gdkpixbufmodule_la_LIBADD = $(GDK_PIXBUF_LIBS)
pkginclude_HEADERS = pygtk.h pygdkimlib.h pygdkpixbuf.h
-pysitedir = $(PYTHON_SITE)
-pysite_PYTHON = gtk.py Gtkinter.py GTK.py GDK.py GtkExtra.py \
+python_PYTHON = gtk.py Gtkinter.py GTK.py GDK.py GtkExtra.py \
$(imlib_mods) $(gtkgl_mods) $(libglade_mods)
noinst_PYTHON = mkgtk.py description.py
diff --git a/acinclude.m4 b/acinclude.m4
index c1e31aae..6a32dabf 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,3 +1,137 @@
+## ------------------------
+## Python file handling
+## From Andrew Dalke
+## Updated by James Henstridge
+## ------------------------
+
+# AM_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 MINIUMUM-VERSION argument is passed, AM_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.
+
+
+AC_DEFUN([AM_PATH_PYTHON_JH],
+ [
+ AC_PROVIDE([AM_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.
+
+ AC_PATH_PROG(PYTHON, python python2.1 python2.0 python1.6 python1.5)
+
+ dnl should we do the version check?
+ ifelse([$1],[],,[
+ AC_MSG_CHECKING(if 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 '.' and convert to numeric
+minver = map(string.atoi, string.split(minver, '.'))
+if hasattr(sys, 'version_info'):
+ pyver = sys.version_info[:3]
+else:
+ pyver = map(string.atoi, string.split(pyver, '.'))
+# we can now do comparisons on the two lists:
+if pyver >= minver:
+ sys.exit(0)
+else:
+ sys.exit(1)"
+ changequote([, ])dnl
+ if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+ then
+ AC_MSG_RESULT(okay)
+ else
+ AC_MSG_ERROR(too old)
+ 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])
+])
+
## this one is commonly used with AM_PATH_PYTHONDIR ...
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.
diff --git a/configure.in b/configure.in
index d921ad66..5bb343fd 100644
--- a/configure.in
+++ b/configure.in
@@ -6,7 +6,7 @@ AM_INIT_AUTOMAKE(pygtk, 0.6.7)
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-AM_PATH_PYTHON(module)
+AM_PATH_PYTHON_JH(1.5.2)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
AC_ARG_ENABLE(thread,
diff --git a/pyglade/Makefile.am b/pyglade/Makefile.am
index 8ca29972..77ea0e49 100644
--- a/pyglade/Makefile.am
+++ b/pyglade/Makefile.am
@@ -1,3 +1,3 @@
-pygladedir = $(PYTHON_SITE)/pyglade
+pygladedir = $(pythondir)/pyglade
pyglade_PYTHON = __init__.py build.py style.py xmlparse.py
diff --git a/pygtk.spec b/pygtk.spec
index 98b80d9d..51afd575 100644
--- a/pygtk.spec
+++ b/pygtk.spec
@@ -22,7 +22,7 @@ Requires: python >= 1.5.2
%description
PyGTK is an extension module for python that gives you access to the GTK+
widget set. Just about anything you can write in C with GTK+ you can write
-in python with PyGTK (within reason), but with all of python's benefits.
+in python with PyGTK (within reason), but with all of benefits of python.
%package glarea
Summary: A wrapper for the GtkGLArea widget for use with PyGTK
@@ -44,6 +44,15 @@ This module contains a wrapper for the libglade library. Libglade is a
library similar to the pyglade module, except that it is written in C (so
is faster) and is more complete.
+%package devel
+Summary: files needed to build wrappers for GTK+ addon libraries
+Group: Development/Languages
+Requires: pygtk = %{ver}
+
+%description devel
+This package contains files required to build wrappers for GTK+ addon
+libraries so that they interoperate with pygtk.
+
%prep
%setup
./configure --prefix=%{py_prefix}
@@ -66,6 +75,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
%{py_prefix}/lib/python%{py_ver}/site-packages/_gtkmodule.so
%{py_prefix}/lib/python%{py_ver}/site-packages/_gdkimlibmodule.so
+%{py_prefix}/lib/python%{py_ver}/site-packages/gdkpixbufmodule.so
%{py_prefix}/include/pygtk
@@ -79,3 +89,27 @@ make DESTDIR=$RPM_BUILD_ROOT install
%files libglade
%{py_prefix}/lib/python%{py_ver}/site-packages/libglade.py*
%{py_prefix}/lib/python%{py_ver}/site-packages/_libglademodule.so
+
+%files devel
+%{py_prefix}/bin/pygtk-codegen-1.2
+%dir %{py_prefix}/include/pygtk
+%{py_prefix}/include/pygtk/*.h
+%dir %{py_prefix}/share/pygtk
+%dir %{py_prefix}/share/pygtk/1.2
+%dir %{py_prefix}/share/pygtk/1.2/codegen
+%dir %{py_prefix}/share/pygtk/1.2/defs
+%{py_prefix}/share/pygtk/1.2/codegen/*
+%{py_prefix}/share/pygtk/1.2/defs/gtk.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkbase.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkcontainers.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkdata.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkdnd.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkedit.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkenums.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkgl.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtklists.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkmenus.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkmisc.defs
+%{py_prefix}/share/pygtk/1.2/defs/gtkranges.defs
+%{py_prefix}/share/pygtk/1.2/defs/libglade.defs
+