[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

building RPM fails on RH9 (+ fix)



hi,

I installed the RPM 4.2 source RPM on one of my machines (vanilla Red
Hat 9 install), unpacked the source, did a configure with a few options,
such as changing the prefix to /tmp or even leaving it out, so it
defaults to /usr/local and building Python bindings.

Configures all nicely, but in the "python" directory it barfs:

[major cut]

...
rpmmodule.c:254: warning: implicit declaration of function `PyDict_New'
rpmmodule.c:257: warning: implicit declaration of function
`PyInt_FromLong'
rpmmodule.c:259: warning: implicit declaration of function `Py_DECREF'
rpmmodule.c:260: warning: implicit declaration of function
`PyDict_SetItem'
rpmmodule.c:260: warning: implicit declaration of function
`PyString_FromString'rpmmodule.c:267: warning: implicit declaration of
function `PyCObject_FromVoidPtr'
make[3]: *** [rpmmodule.lo] Error 1
make[3]: Leaving directory `/root/rpm-4.2/python'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/rpm-4.2/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpm-4.2'
make: *** [all] Error 2

The actual error is that it can't find "Python.h" (but Python 2.2.2 is
installed on the system).

I had configured it with --prefix=/tmp. A little digging through the
Makefile revealed this:

pyincdir = $(prefix)/include/python${PYVER}

This dir is added to the include path for the compile. Now wait a minute,
that actually means that it searches for "Python.h" in
/tmp/include/python2.2/. That surely can't be right...

This problem doesn't occur when you want to install RPM in the default
location on Red Hat for RPM (/usr), because that's also the default
location for Python.

Attached is a trivial patch for python/Makefile.am with a small bit of
Python code. This should not be a problem because:

- Python is already a dependency to build Python bindings
- there is already some Python code in the Makefile.am

The patch is for rpm-4.2, but I checked rpm-4.2.1 and this "bug" is also
in there...

armijn

-- 
 ---------------------------------------------------------------------------
  armijn@uulug.nl | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
 ---------------------------------------------------------------------------
diff -ruN rpm-4.2.old/python/Makefile.am rpm-4.2/python/Makefile.am
--- rpm-4.2.old/python/Makefile.am	2003-01-08 23:33:12.000000000 +0100
+++ rpm-4.2/python/Makefile.am	2003-09-23 13:51:49.000000000 +0200
@@ -7,7 +7,8 @@
 PYVER= @WITH_PYTHON_VERSION@
 
 pylibdir = $(shell python -c 'import sys; print sys.path[1]')
-pyincdir = $(prefix)/include/python${PYVER}
+pyprefix = $(shell python -c 'import sys; print sys.prefix')
+pyincdir = $(pyprefix)/include/python${PYVER}
 
 SUBDIRS = rpmdb test
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]