Changeset 4272
- Timestamp:
- 03/04/09 23:20:04 (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 modified
-
install_scripts/common.py (added)
-
install_scripts/macosx/py2app_setup.py (modified) (1 diff)
-
install_scripts/windows/py2exe_setup.py (modified) (2 diffs)
-
setup.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/install_scripts/macosx/py2app_setup.py
r4271 r4272 24 24 from setuptools import setup 25 25 26 BIN_DIRNAME = 'bin' 26 from install_scripts.common import BIN_DIRNAME 27 27 28 28 py2app_options = dict( -
trunk/install_scripts/windows/py2exe_setup.py
r4271 r4272 26 26 from py2exe.build_exe import py2exe as build_exe 27 27 28 BIN_DIRNAME = 'bin' 28 from install_scripts.common import BIN_DIRNAME, ICONS_DIR 29 29 30 30 # Add the bin dir to the sys.path so we can indicate that the umit_scheduler … … 67 67 windows = [{ 68 68 "script": os.path.join(BIN_DIRNAME, "umit"), 69 "icon_resources": [(1, os.path.join( icons_dir, "umit_48.ico"))]69 "icon_resources": [(1, os.path.join(ICONS_DIR, "umit_48.ico"))] 70 70 }], 71 71 options = {"py2exe": { -
trunk/setup.py
r4271 r4272 34 34 from umit.core.Version import VERSION 35 35 from utils import msgfmt 36 37 from install_scripts.common import BIN_DIRNAME, PIXMAPS_DIR, ICONS_DIR, \ 38 DOCS_DIR, LOCALE_DIR, CONFIG_DIR, MISC_DIR, SQL_DIR 36 39 37 40 py2exe_cmdclass = py2exe_options = py2app_options = None … … 42 45 from install_scripts.macosx.py2app_setup import py2app_options 43 46 44 45 BIN_DIRNAME = 'bin'46 47 # Directories for POSIX operating systems48 # These are created after a "install" or "py2exe" command49 # These directories are relative to the installation or dist directory50 # Ex: python setup.py install --prefix=/tmp/umit51 # Will create the directory /tmp/umit with the following directories52 pixmaps_dir = os.path.join('share', 'pixmaps', 'umit')53 icons_dir = os.path.join('share', 'icons', 'umit')54 locale_dir = os.path.join('share', 'locale')55 config_dir = os.path.join('share', 'umit', 'config')56 docs_dir = os.path.join('share', 'doc', 'umit')57 misc_dir = os.path.join('share', 'umit', 'misc')58 sql_dir = os.path.join('share', 'umit', 'sql')59 47 60 48 def extension_find(result, dirname, fnames, suffix): … … 88 76 svg = glob(os.path.join('share', 'pixmaps', '*.svg')) 89 77 data_files = [ 90 ( pixmaps_dir,91 glob(os.path.join( pixmaps_dir, '*.svg')) +92 glob(os.path.join( pixmaps_dir, '*.png')) +93 glob(os.path.join( pixmaps_dir, '*.xpm')) +94 glob(os.path.join( pixmaps_dir, 'umit.o*'))),95 96 ( config_dir,97 [os.path.join( config_dir, 'umit.conf')] +98 [os.path.join( config_dir, 'scan_profile.usp')] +99 [os.path.join( config_dir, 'umit_version')] +100 [os.path.join( config_dir, 'umitng.db')] +101 [os.path.join( config_dir, 'timeline-settings.conf')] +102 [os.path.join( config_dir, 'tl_colors_evt_std.conf')] +103 [os.path.join( config_dir, 'scheduler-schemas.conf')] +104 [os.path.join( config_dir, 'scheduler-profiles.conf')] +105 [os.path.join( config_dir, 'scheduler.log')] +106 [os.path.join( config_dir, 'smtp-schemas.conf')] +107 glob(os.path.join( config_dir, '*.xml'))+108 glob(os.path.join( config_dir, '*.txt'))),78 (PIXMAPS_DIR, 79 glob(os.path.join(PIXMAPS_DIR, '*.svg')) + 80 glob(os.path.join(PIXMAPS_DIR, '*.png')) + 81 glob(os.path.join(PIXMAPS_DIR, '*.xpm')) + 82 glob(os.path.join(PIXMAPS_DIR, 'umit.o*'))), 83 84 (CONFIG_DIR, 85 [os.path.join(CONFIG_DIR, 'umit.conf')] + 86 [os.path.join(CONFIG_DIR, 'scan_profile.usp')] + 87 [os.path.join(CONFIG_DIR, 'umit_version')] + 88 [os.path.join(CONFIG_DIR, 'umitng.db')] + 89 [os.path.join(CONFIG_DIR, 'timeline-settings.conf')] + 90 [os.path.join(CONFIG_DIR, 'tl_colors_evt_std.conf')] + 91 [os.path.join(CONFIG_DIR, 'scheduler-schemas.conf')] + 92 [os.path.join(CONFIG_DIR, 'scheduler-profiles.conf')] + 93 [os.path.join(CONFIG_DIR, 'scheduler.log')] + 94 [os.path.join(CONFIG_DIR, 'smtp-schemas.conf')] + 95 glob(os.path.join(CONFIG_DIR, '*.xml'))+ 96 glob(os.path.join(CONFIG_DIR, '*.txt'))), 109 97 110 98 # umit.db SQL 111 ( sql_dir, glob(os.path.join(sql_dir, '*.sql'))),112 113 ( misc_dir, glob(os.path.join(misc_dir, '*.dmp'))),99 (SQL_DIR, glob(os.path.join(SQL_DIR, '*.sql'))), 100 101 (MISC_DIR, glob(os.path.join(MISC_DIR, '*.dmp'))), 114 102 115 103 # Radialnet 116 (os.path.join( pixmaps_dir, 'radialnet', 'application'),117 glob(os.path.join( pixmaps_dir, 'radialnet', 'application',104 (os.path.join(PIXMAPS_DIR, 'radialnet', 'application'), 105 glob(os.path.join(PIXMAPS_DIR, 'radialnet', 'application', 118 106 '*.png'))), 119 (os.path.join( pixmaps_dir, 'radialnet', 'icons'),120 glob(os.path.join( pixmaps_dir, 'radialnet', 'icons','*.png'))),107 (os.path.join(PIXMAPS_DIR, 'radialnet', 'icons'), 108 glob(os.path.join(PIXMAPS_DIR, 'radialnet', 'icons','*.png'))), 121 109 122 110 # Network Inventory 123 (os.path.join( pixmaps_dir, 'networkinventory'),124 glob(os.path.join( pixmaps_dir, 'networkinventory', '*.png'))),111 (os.path.join(PIXMAPS_DIR, 'networkinventory'), 112 glob(os.path.join(PIXMAPS_DIR, 'networkinventory', '*.png'))), 125 113 126 114 # InterfaceEditor 127 (os.path.join( pixmaps_dir, 'uie'),128 glob(os.path.join( pixmaps_dir, 'uie', '*.png'))),129 130 ( icons_dir,115 (os.path.join(PIXMAPS_DIR, 'uie'), 116 glob(os.path.join(PIXMAPS_DIR, 'uie', '*.png'))), 117 118 (ICONS_DIR, 131 119 glob(os.path.join('share', 'icons', 'umit', '*.ico')) + 132 120 glob(os.path.join('share', 'icons', 'umit', '*.png'))), 133 121 134 ( docs_dir,135 glob(os.path.join( docs_dir, '*.html')) +136 glob(os.path.join( docs_dir, 'comparing_results', '*.xml')) +137 glob(os.path.join( docs_dir, 'profile_editor', '*.xml')) +138 glob(os.path.join( docs_dir, 'scanning', '*.xml')) +139 glob(os.path.join( docs_dir, 'searching', '*.xml')) +140 glob(os.path.join( docs_dir, 'wizard', '*.xml')) +141 glob(os.path.join( docs_dir, 'scheduler', '*.xml')) +142 glob(os.path.join( docs_dir, 'smtpsetup', '*.xml')) +143 glob(os.path.join( docs_dir, 'screenshots', '*.png')))]122 (DOCS_DIR, 123 glob(os.path.join(DOCS_DIR, '*.html')) + 124 glob(os.path.join(DOCS_DIR, 'comparing_results', '*.xml')) + 125 glob(os.path.join(DOCS_DIR, 'profile_editor', '*.xml')) + 126 glob(os.path.join(DOCS_DIR, 'scanning', '*.xml')) + 127 glob(os.path.join(DOCS_DIR, 'searching', '*.xml')) + 128 glob(os.path.join(DOCS_DIR, 'wizard', '*.xml')) + 129 glob(os.path.join(DOCS_DIR, 'scheduler', '*.xml')) + 130 glob(os.path.join(DOCS_DIR, 'smtpsetup', '*.xml')) + 131 glob(os.path.join(DOCS_DIR, 'screenshots', '*.png')))] 144 132 145 133 # Add i18n files to data_files list 146 os.path.walk( locale_dir, mo_find, data_files)134 os.path.walk(LOCALE_DIR, mo_find, data_files) 147 135 148 136 … … 155 143 """ Remove *.mo files """ 156 144 tmp = [] 157 os.path.walk( locale_dir, mo_find, tmp)145 os.path.walk(LOCALE_DIR, mo_find, tmp) 158 146 for (path, t) in tmp: 159 147 os.remove(t[0]) … … 162 150 """Build mo files from po and put it into LC_MESSAGES """ 163 151 tmp = [] 164 os.path.walk( locale_dir, po_find, tmp)152 os.path.walk(LOCALE_DIR, po_find, tmp) 165 153 for (path, t) in tmp: 166 154 full_path = os.path.join(path , "LC_MESSAGES", "umit.mo") … … 169 157 msgfmt.make(t[0], full_path, False) 170 158 # like guess 171 os.path.walk( locale_dir, mo_find, data_files)159 os.path.walk(LOCALE_DIR, mo_find, data_files) 172 160 173 161 def run(self): … … 181 169 def run(self): 182 170 # Add i18n files to data_files list 183 os.path.walk( locale_dir, mo_find, data_files)171 os.path.walk(LOCALE_DIR, mo_find, data_files) 184 172 install.run(self) 185 173 … … 267 255 268 256 def fix_paths(self): 269 interesting_paths = {"CONFIG_DIR": config_dir,270 "DOCS_DIR": docs_dir,271 "LOCALE_DIR": locale_dir,272 "MISC_DIR": misc_dir,273 "PIXMAPS_DIR": pixmaps_dir,274 "ICONS_DIR": icons_dir}257 interesting_paths = {"CONFIG_DIR": CONFIG_DIR, 258 "DOCS_DIR": DOCS_DIR, 259 "LOCALE_DIR": LOCALE_DIR, 260 "MISC_DIR": MISC_DIR, 261 "PIXMAPS_DIR": PIXMAPS_DIR, 262 "ICONS_DIR": ICONS_DIR} 275 263 276 264 pcontent = ""
