To build ganglia-python-3.3.0 RPM package for Linux i386, x86_64 and ia64
I have integrated this patch provided below.
summary:
* You have to set environment var PY_VERSION to build an rpm package.
For example set it like export PY_VERSION="2.3".
* changes in Makefile
- subtitute python2.2 through python$(PY.VERSION)
* changes in modules/Makefile
- don't use hardcoded PY.VERSION
- for ia64 set -I/usr/src/linux/include to get correct value of
PAGE_SHIFT
* changes in python.mk
- if PY_VERSION exists use its content. In other cases use "2.2".
With this complete patch it was no problem to build rpm packages.
best regards,
mike
diff -u -r -N ganglia-python-3.3.0.orig/Makefile ganglia-python-3.3.0/Makefile
--- ganglia-python-3.3.0.orig/Makefile 2004-03-25 04:15:01.000000000 +0100
+++ ganglia-python-3.3.0/Makefile 2004-12-16 08:14:51.116818007 +0100
@@ -155,12 +155,12 @@
mkdir -p $(ROOT)/$(PKGROOT)/lib/python/gmon
mkdir -p $(ROOT)/etc/rc.d/init.d/
mkdir -p $(ROOT)/usr/lib/python1.5/site-packages/
- mkdir -p $(ROOT)/usr/lib/python2.2/site-packages/
+ mkdir -p $(ROOT)/usr/lib/python$(PY.VERSION)/site-packages/
# Include required python library links.
ln -nsf $(PKGROOT)/lib/python/gmon \
$(ROOT)/usr/lib/python1.5/site-packages/
ln -nsf $(PKGROOT)/lib/python/gmon \
- $(ROOT)/usr/lib/python2.2/site-packages/
+ $(ROOT)/usr/lib/python$(PY.VERSION)/site-packages/
install -ma+rx $(SCRIPTS) $(ROOT)/$(PKGROOT)/bin/
install -ma+r $(PYLIB) $(ROOT)/$(PKGROOT)/lib/python/gmon/
install -ma+r etc/glue.schema $(ROOT)/$(PKGROOT)/etc/
diff -u -r -N ganglia-python-3.3.0.orig/ganglia-python.spec.in
ganglia-python-3.3.0/ganglia-python.spec.in
--- ganglia-python-3.3.0.orig/ganglia-python.spec.in 2004-03-25
04:15:01.000000000 +0100
+++ ganglia-python-3.3.0/ganglia-python.spec.in 2004-12-16 08:26:05.316951296
+0100
@@ -131,6 +131,17 @@
## PREP
##
%prep
+if [ "_$PY_VERSION" = "_" ]; then
+ cat >&2 <<EOF
+
+
+
+error: Envenvironment variable PY_VERSION not set.
+ For example set it like export PY_VERSION="2.3".
+
+
+
+EOF
%setup
##
diff -u -r -N ganglia-python-3.3.0.orig/modules/Makefile
ganglia-python-3.3.0/modules/Makefile
--- ganglia-python-3.3.0.orig/modules/Makefile 2004-03-25 04:15:03.000000000
+0100
+++ ganglia-python-3.3.0/modules/Makefile 2004-12-16 08:30:56.901991971
+0100
@@ -78,7 +78,8 @@
MODULES = $(wildcard *.c)
HEADERS = $(wildcard *.h)
# The default Python version.
-PY.VERSION = 2.2
+#PY.VERSION = 2.2
+PY.VERSION = $(PY.VERSION)
# The 411 service requires Python 2.1 or better.
PY_INCLUDE = /usr/include/python$(PY.VERSION)
@@ -94,7 +95,7 @@
these_modules: $(MODULES:.c=.so)
%.so: %.c $(HEADERS)
- gcc -fPIC -g -I$(PY_INCLUDE) -c $<
+ gcc -fPIC -g -I/usr/src/linux/include -I$(PY_INCLUDE) -c $<
gcc -shared -Wl -o $@ $(<:.c=.o)
diff -u -r -N ganglia-python-3.3.0.orig/python.mk ganglia-python-3.3.0/python.mk
--- ganglia-python-3.3.0.orig/python.mk 2004-10-13 01:02:54.000000000 +0200
+++ ganglia-python-3.3.0/python.mk 2004-12-16 08:50:46.698455032 +0100
@@ -14,7 +14,11 @@
# Python Version: the major-minor version of the default 'python'
# executable (not python2). Used to locate Python libraries.
+ifndef PY_VERSION
PY.VERSION = 2.2
+else
+PY.VERSION = $(PY_VERSION)
+endif
# This must match the python library location:
# /usr/lib/[PY.LIB]/