]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
build for whatever versions of python are installed; also, move to r0-50-35
authornotting <notting>
Mon, 18 Mar 2002 17:31:59 +0000 (17:31 +0000)
committernotting <notting>
Mon, 18 Mar 2002 17:31:59 +0000 (17:31 +0000)
site-packages

Makefile.in
newt.spec

index 8b92f26176a6fb47c02e27fb3e2800fb67a2a0c3..8784c26d74dc676776d4d695d94c6617778979c9 100644 (file)
@@ -12,6 +12,8 @@ VERSION = @VERSION@
 CVSTAG = r$(subst .,-,$(VERSION))
 SONAME = @SONAME@
 
+PYTHONVERS = $(shell ls -d /usr/include/python* | sed "s|/usr/include/||g")
+
 WHIPTCLSO=
 #WHIPTCLSO=whiptcl.so
 
@@ -33,8 +35,6 @@ includedir = $(prefix)/include
 libdir = $(prefix)/lib
 bindir = $(prefix)/bin
 ARCHNAME = $(shell uname -m | sed 's/i.86/i386/')
-pythondir = $(prefix)/lib/python2.2
-pythonbindir = $(prefix)/lib/python2.2/lib-dynload
 
 #--------------------------------------
 
@@ -60,11 +60,14 @@ testgrid:   testgrid.o $(LIBNEWT)
 testtree:      testtree.o $(LIBNEWT)
        gcc -g -o testtree testtree.o $(LIBNEWT) $(LIBS)
 
-_snackmodule.so:   snackmodule.o $(LIBNEWTSH)
-       gcc --shared $(SHCFLAGS) -o _snackmodule.so snackmodule.o -L . $(LIBNEWTSH)
-
-snackmodule.o:   snackmodule.c
-       gcc -I/usr/include/python2.2 -fPIC $(CFLAGS) -c snackmodule.c
+_snackmodule.so:   snackmodule.c $(LIBNEWTSH)
+       for ver in $(PYTHONVERS) ; do \
+           if [ ! -f "$$ver/_snackmodule.so" -o $(LIBNEWTSH) -nt "$$ver/_snackmodule.so" ]; then \
+               mkdir -p $$ver ;\
+               gcc $(CFLAGS) -I/usr/include/$$ver -fPIC -c -o $$ver/snackmodule.o snackmodule.c ;\
+               gcc --shared $(SHCFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L . $(LIBNEWTSH) ;\
+           fi ; \
+       done
 
 whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
        gcc -g -o whiptail $(NDIALOGOBJS) -L . $(LIBNEWTSH) $(LIBS) -lpopt
@@ -114,10 +117,12 @@ install-sh: sharedlib $(WHIPTCLSO) _snackmodule.so
        [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
        install -s -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
        ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/libnewt.so
-       [ -n "$(WHIPTCLSO)" ] && install -s -m 755 whiptcl.so $(instroot)/$(libdir)
-       [ -d $(instroot)/$(pythonbindir) ] || install -m 755 -d $(instroot)/$(pythonbindir)
-       install -s -m 755 _snackmodule.so $(instroot)/$(pythonbindir)
-       install -m 755 snack.py $(instroot)/$(pythondir)
+       [ -n "$(WHIPTCLSO)" ] && install -s -m 755 whiptcl.so $(instroot)/$(libdir) || :
+       for ver in $(PYTHONVERS) ; do \
+          [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
+          install -s -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\
+          install -m 755 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
+       done
 
 configure:  configure.in
        autoconf
index dcc9674e58c5f05f45d5058c1fa3938a8fea056c..2ffd03bd26141aaadb327ec2f023002dc75014ef 100644 (file)
--- a/newt.spec
+++ b/newt.spec
@@ -1,6 +1,6 @@
 Summary: A development library for text mode user interfaces.
 Name: newt
-%define version 0.50.34
+%define version 0.50.35
 Version: %{version}
 Release: 1
 License: LGPL
@@ -71,8 +71,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc CHANGES COPYING
 /usr/lib/libnewt.so.*
 /usr/bin/whiptail
-/usr/lib/python2.2/snack.py*
-/usr/lib/python2.2/lib-dynload/_snackmodule.so
+/usr/lib/python*/site-packages/*
 
 %files devel
 %defattr (-,root,root)
@@ -82,6 +81,9 @@ rm -rf $RPM_BUILD_ROOT
 /usr/lib/libnewt.so
 
 %changelog
+* Mon Mar 18 2002 Bill Nottingham <notting@redhat.com> 0.50.35-1
+- build for whatever version of python happens to be installed
+
 * Fri Sep 15 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.50.34-1
 - remove python2 subpackage
 - compile package for python 2.2