commit-gnue
[Top][All Lists]
Advanced

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

r5763 - trunk/gnue-common


From: btami
Subject: r5763 - trunk/gnue-common
Date: Tue, 27 Apr 2004 02:54:49 -0500 (CDT)

Author: btami
Date: 2004-04-27 02:54:48 -0500 (Tue, 27 Apr 2004)
New Revision: 5763

Modified:
   trunk/gnue-common/MANIFEST.in
   trunk/gnue-common/setup.py
Log:
work on setup.py bdist_rpm

Modified: trunk/gnue-common/MANIFEST.in
===================================================================
--- trunk/gnue-common/MANIFEST.in       2004-04-27 07:51:37 UTC (rev 5762)
+++ trunk/gnue-common/MANIFEST.in       2004-04-27 07:54:48 UTC (rev 5763)
@@ -22,7 +22,8 @@
 include packaging/win32/*
 
 include po/*
+include locale/*/LC_MESSAGES/*
 
 include scripts/gnue-*
 
-include setupext/*
+include setupext/*
\ No newline at end of file

Modified: trunk/gnue-common/setup.py
===================================================================
--- trunk/gnue-common/setup.py  2004-04-27 07:51:37 UTC (rev 5762)
+++ trunk/gnue-common/setup.py  2004-04-27 07:54:48 UTC (rev 5763)
@@ -73,6 +73,10 @@
                              'prune etc/.svn'],
                  preserve_path = 0),
      Data_Files (base_dir = 'install_data',
+                 copy_to = 'share',
+                 template = ['recursive-include locale *.mo'],
+                 preserve_path = 1),
+     Data_Files (base_dir = 'install_data',
                  copy_to = 'share/man/man1',
                  template = ['recursive-include doc/man *.1'],
                  preserve_path = 0),
@@ -91,7 +95,7 @@
 # Gets called on sdist (always) and on build/install (only when run from SVN).
 # -----------------------------------------------------------------------------
 
-def build_files (action):
+def build_files (action, cmdclass):
 
   if os.name == 'posix':
 
@@ -128,6 +132,26 @@
       if os.system ("cd po && make update-po gmo") != 0:
         sys.exit (1)
 
+    # install translations
+    if os.path.isdir ('po'):
+
+      # find out domain
+      domain = None
+      for f in os.listdir ('po'):
+        if f [-4:] == '.pot':
+          domain = f[:-4]
+      if not domain:
+        print "warning: cannot determine domain, not installing translations"
+      else:
+        # copy files
+        for f in os.listdir ('po'):
+          if f [-4:] == '.gmo':
+            src = os.path.join ('po', f)
+#            dst = os.path.join (self.install_data, 'share', 'locale', f [:-4],
+            dst = os.path.join ('locale', f [:-4], 'LC_MESSAGES')
+            cmdclass.mkpath (dst)
+            cmdclass.copy_file (src, os.path.join (dst, domain + '.mo'))
+
   else:
     # on non posix systems just run msgfmt on existing .po files
     if os.path.isdir ('po'):
@@ -242,7 +266,7 @@
 class sdist (distutils.command.sdist.sdist):
 
   def run (self):
-    build_files ('sdist')
+    build_files ('sdist', self)
     distutils.command.sdist.sdist.run (self)
 
 # =============================================================================
@@ -253,7 +277,7 @@
 
   def run (self):
     if not os.path.isfile ("PKG-INFO"):         # downloaded from SVN?
-      build_files ('build')
+      build_files ('build', self)
     distutils.command.build.build.run (self)
 
 # =============================================================================
@@ -328,12 +352,14 @@
         # add --root to target directory for gnue.py
         site_dir = change_root (self.root, site_dir)
 
+
       # especially if we have --root, the directory might not exist
       if not os.path.isdir (site_dir):
         os.makedirs (site_dir)
 
       # now create the file
       file = os.path.join (site_dir, "gnue.pth")
+      self.distribution.data_files.append((get_python_lib(), [file]))
       print "trying to create %s" % file
       try:
         output = open (file, "w")
@@ -385,27 +411,9 @@
 
     self._write_paths_py ()
 
-    distutils.command.install.install.run (self)
 
-    # install translations
-    if os.path.isdir ('po'):
 
-      # find out domain
-      domain = None
-      for f in os.listdir ('po'):
-        if f [-4:] == '.pot':
-          domain = f[:-4]
-      if not domain:
-        print "warning: cannot determine domain, not installing translations"
-      else:
-        # copy files
-        for f in os.listdir ('po'):
-          if f [-4:] == '.gmo':
-            src = os.path.join ('po', f)
-            dst = os.path.join (self.install_data, 'share', 'locale', f [:-4],
-                                'LC_MESSAGES')
-            self.mkpath (dst)
-            self.copy_file (src, os.path.join (dst, domain + '.mo'))
+    distutils.command.install.install.run (self)
 
 # -----------------------------------------------------------------------------
 # Get all packages in a directory





reply via email to

[Prev in Thread] Current Thread [Next in Thread]