[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5780 - in trunk/gnue-common: . module/base src/setup
From: |
reinhard |
Subject: |
r5780 - in trunk/gnue-common: . module/base src/setup |
Date: |
Wed, 5 May 2004 08:41:59 -0500 (CDT) |
Author: reinhard
Date: 2004-05-05 08:41:58 -0500 (Wed, 05 May 2004)
New Revision: 5780
Removed:
trunk/gnue-common/module/base/paths.py
Modified:
trunk/gnue-common/MANIFEST.in
trunk/gnue-common/setup.py
trunk/gnue-common/src/setup/GSetup.py
Log:
Proper fix for RPM generation.
Modified: trunk/gnue-common/MANIFEST.in
===================================================================
--- trunk/gnue-common/MANIFEST.in 2004-05-04 01:19:53 UTC (rev 5779)
+++ trunk/gnue-common/MANIFEST.in 2004-05-05 13:41:58 UTC (rev 5780)
@@ -22,8 +22,7 @@
include packaging/win32/*
include po/*
-include locale/*/LC_MESSAGES/*
include scripts/gnue-*
-include setupext/*
\ No newline at end of file
+include setupext/*
Deleted: trunk/gnue-common/module/base/paths.py
===================================================================
--- trunk/gnue-common/module/base/paths.py 2004-05-04 01:19:53 UTC (rev
5779)
+++ trunk/gnue-common/module/base/paths.py 2004-05-05 13:41:58 UTC (rev
5780)
@@ -1 +0,0 @@
-# placeholder for .rpm packaging
Modified: trunk/gnue-common/setup.py
===================================================================
--- trunk/gnue-common/setup.py 2004-05-04 01:19:53 UTC (rev 5779)
+++ trunk/gnue-common/setup.py 2004-05-05 13:41:58 UTC (rev 5780)
@@ -73,10 +73,6 @@
'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),
@@ -95,7 +91,7 @@
# Gets called on sdist (always) and on build/install (only when run from SVN).
# -----------------------------------------------------------------------------
-def build_files (action, cmdclass):
+def build_files (action):
if os.name == 'posix':
@@ -132,26 +128,6 @@
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'):
@@ -266,7 +242,7 @@
class sdist (distutils.command.sdist.sdist):
def run (self):
- build_files ('sdist', self)
+ build_files ('sdist')
distutils.command.sdist.sdist.run (self)
# =============================================================================
@@ -277,7 +253,7 @@
def run (self):
if not os.path.isfile ("PKG-INFO"): # downloaded from SVN?
- build_files ('build', self)
+ build_files ('build')
distutils.command.build.build.run (self)
# =============================================================================
@@ -342,7 +318,7 @@
# Create gnue.pth
# ---------------------------------------------------------------------------
- def _write_gnue_pth (self):
+ def __write_gnue_pth (self):
# we need gnue.pth only if we don't install in python's search path
if self.install_lib not in sys.path:
@@ -352,14 +328,12 @@
# 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")
@@ -368,6 +342,8 @@
# It worked. Turn off error message about installing into directory
# not in path.
sys.path.append (self.install_lib)
+ # Record file
+ self.__outputs.append (file)
except:
pass
@@ -375,7 +351,7 @@
# Create paths.py
# ---------------------------------------------------------------------------
- def _write_paths_py (self):
+ def __write_paths_py (self):
dir = os.path.join (self.install_lib, "gnue")
if not os.path.isdir (dir):
os.makedirs (dir)
@@ -399,22 +375,63 @@
output.write (" data = \"%s\"\n" % self._quote (self.install_data))
output.write (" config = \"%s\"\n" % self._quote (self.install_config))
output.close ()
+ # Record file
+ self.__outputs.append (file)
# ---------------------------------------------------------------------------
- # install.run: generate and install path dependent files afterwards
+ # Install translations by copying the files to the correct location
# ---------------------------------------------------------------------------
+ def __install_translations (self):
+
+ 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)
+ dst = os.path.join (dst, domain + '.mo')
+ self.copy_file (src, dst)
+ # Record file
+ self.__outputs.append (dst)
+
+ # ---------------------------------------------------------------------------
+ # install.run: generate and install path dependent files
+ # ---------------------------------------------------------------------------
+
def run (self):
check_dependencies ()
- self._write_gnue_pth ()
+ self.__outputs = []
- self._write_paths_py ()
+ self.__write_gnue_pth ()
+ self.__write_paths_py ()
+ self.__install_translations ()
distutils.command.install.install.run (self)
+ # ---------------------------------------------------------------------------
+ # install.get_outputs: list all installed files
+ # ---------------------------------------------------------------------------
+
+ def get_outputs (self):
+ return distutils.command.install.install.get_outputs (self) \
+ + self.__outputs
+
# -----------------------------------------------------------------------------
# Get all packages in a directory
# -----------------------------------------------------------------------------
Modified: trunk/gnue-common/src/setup/GSetup.py
===================================================================
--- trunk/gnue-common/src/setup/GSetup.py 2004-05-04 01:19:53 UTC (rev
5779)
+++ trunk/gnue-common/src/setup/GSetup.py 2004-05-05 13:41:58 UTC (rev
5780)
@@ -72,7 +72,7 @@
distutils.command.sdist.sdist.run (self)
# =============================================================================
-# build: if done from CVS, build files to be installed first
+# build: if done from SVN, build files to be installed first
# =============================================================================
class build (distutils.command.build.build):
@@ -80,7 +80,7 @@
def run (self):
global _setup
- if not os.path.isfile ("PKG-INFO"): # downloaded from CVS?
+ if not os.path.isfile ("PKG-INFO"): # downloaded from SVN?
_setup.do_build_files ('build')
distutils.command.build.build.run (self)
@@ -118,7 +118,7 @@
_setup.check_dependencies ()
- distutils.command.install.install.run (self)
+ self.__outputs = []
# install translations
if os.path.isdir ('po'):
@@ -127,7 +127,8 @@
domain = None
for f in os.listdir ('po'):
if f [-4:] == '.pot':
- domain = f[:-4]
+ domain = f [:-4]
+
if not domain:
print "warning: cannot determine domain, not installing translations"
else:
@@ -138,15 +139,25 @@
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'))
+ dst = os.path.join (dst, domain + '.mo')
+ self.copy_file (src, dst)
+ self.__outputs.append (dst)
+ distutils.command.install.install.run (self)
+
+ # ---------------------------------------------------------------------------
+ # install.get_outputs: list all installed files
+ # ---------------------------------------------------------------------------
+
+ def get_outputs (self):
+ return distutils.command.install.install.get_outputs (self) \
+ + self.__outputs
+
# =============================================================================
# GSetup: Basic class for setup scripts of GNUe packages
# =============================================================================
class GSetup:
-
- packege = None
# ---------------------------------------------------------------------------
# Abstract methods: setup.py scripts generally override these
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5780 - in trunk/gnue-common: . module/base src/setup,
reinhard <=