File plucker-1.8.diff of Package plucker

--- Makefile.in
+++ Makefile.in
@@ -94,7 +94,7 @@
 	$(MKINSTALLDIRS) $(BINDIR)
 	cp $(UNIX_DIR)/setup.py $(BINDIR)/plucker-setup ; chmod 755 $(BINDIR)/plucker-setup
 	$(MKINSTALLDIRS) $(DOCDIR)
-	cp AUTHORS BUGREPORT COPYING CREDITS ChangeLog FAQ NEWS README REQUIREMENTS TODO $(DOCDIR)
+	cp AUTHORS BUGREPORT COPYING CREDITS ChangeLog FAQ NEWS README REQUIREMENTS $(DOCDIR)
 	cd $(PARSER_DIR) ; $(MAKE) $@
 
 install-pyplucker: pyplucker
--- configure.in
+++ configure.in
@@ -48,6 +48,10 @@
 AC_PROG_RANLIB
 AC_PROG_INSTALL
 
+AC_MSG_CHECKING(what libname should be used)                                   
+AC_ARG_WITH(libname, [ --with-libname   should be lib (default) or lib64], [], [with_libname=lib])                                                     
+AC_MSG_RESULT($with_libname)
+
 dnl ===============================
 dnl      Python Distiller Section
 dnl ===============================
@@ -59,10 +63,10 @@
 AC_MSG_CHECKING("Python version")
 PYTHON_MAJOR_LIBVER=[`$PYTHON -c "\
 import sys, string
-print string.splitfields(string.splitfields(sys.version, ' ')[0], '.')[0]"`]
+print string.splitfields(string.splitfields(sys.version[0:3], ' ')[0], '.')[0]"`]
 PYTHON_MINOR_LIBVER=[`$PYTHON -c "\
 import sys, string
-print string.splitfields(string.splitfields(sys.version, ' ')[0], '.')[1]"`]
+print string.splitfields(string.splitfields(sys.version[0:3], ' ')[0], '.')[1]"`]
 PYTHON_MINOR_MINOR_VER=[`$PYTHON -c "\
 import sys, string
 fields = string.splitfields(string.splitfields(sys.version, ' ')[0], '.')
@@ -72,7 +76,7 @@
   print '0'"`]
 AC_MSG_RESULT("$PYTHON_MAJOR_LIBVER.$PYTHON_MINOR_LIBVER.$PYTHON_MINOR_MINOR_VER")
 if test $PYTHON_MAJOR_LIBVER -gt 1 -o $PYTHON_MINOR_LIBVER -gt 5 -o \( $PYTHON_MINOR_LIBVER -eq 5 -a $PYTHON_MINOR_MINOR_VER -ge 2 \); then
-  PYTHON_LIBDIR=[`$PYTHON -c "import sys, os; print os.path.join(os.path.join(sys.prefix, 'lib'),'python%s.%s' % ($PYTHON_MAJOR_LIBVER, $PYTHON_MINOR_LIBVER))"`]
+  PYTHON_LIBDIR=[`$PYTHON -c "import sys, os; print os.path.join(os.path.join(sys.prefix, '$with_libname'),'python%s.%s' % ($PYTHON_MAJOR_LIBVER, $PYTHON_MINOR_LIBVER))"`]
 else
   AC_MSG_ERROR(["Python version too low -- at least 1.5.2 is required."])
 fi
--- parser/python/PyPlucker/ImageParser.py
+++ parser/python/PyPlucker/ImageParser.py
@@ -435,21 +435,18 @@
             if self._maxwidth != None:
                 maxwidth = self._maxwidth
         
-            command = "identify -ping " + infile
+            command = "identify -ping -format '%w %h' " + infile
             message("Running: " + command)
             pipe = os.popen(command)
-            info = pipe.read()
+            width_height = pipe.read()
             pipe.close()
-            match = re.search(r"\s([0-9]+)x([0-9]+)[+\s]", info)
-            if not match:
-                raise RuntimeError, "Can't determine image size from output of ImageMagick 'identify' program:  " + info
-            else:
-                mywidth = int(match.group(1))
-                myheight = int(match.group(2))
-            if mywidth > int(maxwidth) \
-                    or myheight > int(maxheight):
+            width_height = string.split(width_height) #width_height is now an array
+
+            if string.atoi(width_height[0]) > string.atoi(maxwidth) \
+                    or string.atoi(width_height[1]) > string.atoi(maxheight):
+
                 self._scaled = 1
-                if self._verbose > 2: print '...image (natively %dx%d) must be scaled' % (mywidth, myheight)
+                if self._verbose > 2: print '...image (natively %sx%s) must be scaled' % (width_height[0], width_height[1])
 
             size = "\"" + maxwidth + "x" + maxheight + ">\""
 
openSUSE Build Service is sponsored by