[svn] r5426 - trunk/tools/unoconv

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Sun May 20 14:14:14 CEST 2007


Author: dag
Date: 2007-05-20 14:14:13 +0200 (Sun, 20 May 2007)
New Revision: 5426

Modified:
   trunk/tools/unoconv/ChangeLog
   trunk/tools/unoconv/unoconv
   trunk/tools/unoconv/unoconv.spec
Log:
Use glob to find possible location of pyuno

Modified: trunk/tools/unoconv/ChangeLog
===================================================================
--- trunk/tools/unoconv/ChangeLog	2007-05-20 12:04:17 UTC (rev 5425)
+++ trunk/tools/unoconv/ChangeLog	2007-05-20 12:14:13 UTC (rev 5426)
@@ -6,6 +6,7 @@
 - Show proper error when file does not exist (Peter Draho)
 - Make long options work :)
 - If format is not recognized, scan by extension
+- Use glob to find possible location of pyuno
 
 * 0.1 - released 19/05/2007
 - Initial release

Modified: trunk/tools/unoconv/unoconv
===================================================================
--- trunk/tools/unoconv/unoconv	2007-05-20 12:04:17 UTC (rev 5425)
+++ trunk/tools/unoconv/unoconv	2007-05-20 12:14:13 UTC (rev 5426)
@@ -14,18 +14,19 @@
 ### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 ### Copyright 2007 Dag Wieers <dag at wieers.com>
 
-import getopt, sys, os, distutils.sysconfig
+import getopt, sys, os, distutils.sysconfig, glob
 
 try:
     import uno
 except:
-    extrapaths = ('/usr/lib/openoffice/program/', '/usr/lib/openoffice.org2.0/program/')
+#    extrapaths = ('/usr/lib/openoffice/program/', '/usr/lib/openoffice.org2.0/program/')
+    extrapaths = glob.glob('/usr/lib*/openoffice*/program/')
     for path in extrapaths:
         if os.path.isfile(os.path.join(path, 'pyuno.so')):
             sys.path.append(path)
             break
     else:
-        print >>sys.stderr, "Error: Cannot find the pyuno.so library."
+        print >>sys.stderr, "unoconv: Cannot find the pyuno.so library."
         print >>sys.stderr, "Please locate this library and send feedback to <tools at lists.rpmforge.net>."
         sys.exit(1)
 

Modified: trunk/tools/unoconv/unoconv.spec
===================================================================
--- trunk/tools/unoconv/unoconv.spec	2007-05-20 12:04:17 UTC (rev 5425)
+++ trunk/tools/unoconv/unoconv.spec	2007-05-20 12:14:13 UTC (rev 5426)
@@ -2,6 +2,10 @@
 # Authority: dag
 # Upstream: Dag Wieers <dag$wieers,com>
 
+%{?dist: %{expand: %%define %dist 1}}
+
+%{el4:%define _with_openoffice.org2 1}
+
 Summary: Tool to convert between any document format supported by OpenOffice
 Name: unoconv
 Version: 0.1svn
@@ -18,7 +22,9 @@
 
 BuildArch: noarch
 BuildRequires: python >= 2.0
-Requires: python >= 2.0, openoffice.org-core, openoffice.org-pyuno
+Requires: python >= 2.0
+%{!?_with_openoffice.org2:Requires:openoffice.org-pyuno >= 2.0}
+%{?_with_openoffice.org2:Requires:openoffice.org2-pyuno >= 2.0}
 
 %description
 unoconv converts between any document format that OpenOffice understands.




More information about the commits mailing list