root/branch/umitweb-ng/install_scripts/windows/setup.py @ 4759

Revision 4759, 9.7 kB (checked in by rcarvalho, 4 years ago)

Merged revisions 4158-4168 via svnmerge from
http://svn.umitproject.org/svnroot/umit/trunk

........

r4158 | gpolo | 2009-02-21 17:39:10 -0300 (Sáb, 21 Fev 2009) | 1 line


Bump to 1.0beta2

........

r4159 | gpolo | 2009-02-21 18:13:06 -0300 (Sáb, 21 Fev 2009) | 1 line


Make it work under Windows too (os.uname is not available there).

........

r4160 | gpolo | 2009-02-21 18:15:04 -0300 (Sáb, 21 Fev 2009) | 1 line


Revert UMIT_DEVELOPMENT change

........

r4161 | gpolo | 2009-02-21 18:19:13 -0300 (Sáb, 21 Fev 2009) | 1 line


Reverting other things that shouldn't have been committed.

........

r4162 | gpolo | 2009-02-21 18:25:18 -0300 (Sáb, 21 Fev 2009) | 1 line


milestone

........

r4163 | luis | 2009-02-21 18:35:29 -0300 (Sáb, 21 Fev 2009) | 1 line


Including utils to unix setup -- generate mo files

........

r4164 | gpolo | 2009-02-21 18:42:06 -0300 (Sáb, 21 Fev 2009) | 1 line


umits -> umit

........

r4165 | gpolo | 2009-02-21 18:44:22 -0300 (Sáb, 21 Fev 2009) | 1 line


Include .db files

........

r4166 | luis | 2009-02-21 18:56:15 -0300 (Sáb, 21 Fev 2009) | 1 line


including some missing files at unix tarball

........

r4167 | luis | 2009-02-21 19:00:22 -0300 (Sáb, 21 Fev 2009) | 1 line


include missing images at unix tarball

........

r4168 | gpolo | 2009-02-21 20:04:33 -0300 (Sáb, 21 Fev 2009) | 1 line


Fixed ticket #214: Bugs while reporting bugs

........

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2005-2006 Insecure.Com LLC.
5# Copyright (C) 2007-2008 Adriano Monteiro Marques
6#
7# Author: Adriano Monteiro Marques <adriano@umitproject.org>
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
23import sys
24import os.path
25import os
26
27from py2exe.build_exe import py2exe as build_exe
28from distutils.core import setup
29from glob import glob
30
31sys.path += [os.getcwd()]
32
33from umitWeb.Version import VERSION
34
35################################################################################
36# Main Variables
37
38# Directories for POSIX operating systems
39# These are created after a "install" or "py2exe" command
40# These directories are relative to the installation or dist directory
41# Ex: python setup.py install --prefix=/tmp/umit
42# Will create the directory /tmp/umit with the following directories
43pixmaps_dir = os.path.join('share', 'pixmaps', 'umit')
44icons_dir = os.path.join('share', 'icons', 'umit')
45locale_dir = os.path.join('share', 'locale')
46config_dir = os.path.join('share', 'umit', 'config')
47docs_dir = os.path.join('share', 'doc', 'umit')
48misc_dir = os.path.join('share', 'umit', 'misc')
49templates_dir = os.path.join('share', 'umit', 'templates')
50media_dir = os.path.join('share', 'umit', 'umitweb_media')
51sql_dir = os.path.join('share', 'umit', 'sql')
52
53def mo_find(result, dirname, fnames):
54    files = []
55    for f in fnames:
56        p = os.path.join(dirname, f)
57        if os.path.isfile(p) and f.endswith(".mo"):
58            files.append(p)
59       
60    if files:
61        result.append((dirname, files))
62
63
64##############################################################################
65# Installation variables
66
67# What to copy to the destiny
68# Here, we define what should be put inside the directories set in the
69# beginning of this file. This list contain tuples where the first element
70# contains a path to where the other elements of the tuple should be installed.
71# The first element is a path in the INSTALLATION PREFIX, and the other
72# elements are the path in the source base.
73# Ex: [("share/pixmaps", "/umit/trunk/share/pixmaps/test.png")]
74# This will install the test.png file in the installation dir share/pixmaps.
75svg = glob(os.path.join('share', 'pixmaps', '*.svg'))
76data_files = [
77        (pixmaps_dir, glob(os.path.join(pixmaps_dir, '*.svg')) +
78            glob(os.path.join(pixmaps_dir, '*.png')) +
79            glob(os.path.join(pixmaps_dir, '*.xpm')) +
80            glob(os.path.join(pixmaps_dir, 'umit.o*'))),
81
82        (config_dir, [os.path.join(config_dir, 'umit.conf')] +
83            [os.path.join(config_dir, 'scan_profile.usp')] +
84            [os.path.join(config_dir, 'umit_version')] +
85            [os.path.join(config_dir, 'umitweb.conf')] +
86            [os.path.join(config_dir, 'umitng.db')] +
87            [os.path.join(config_dir, 'timeline-settings.conf')] +
88            [os.path.join(config_dir, 'tl_colors_evt_std.conf')] +
89            [os.path.join(config_dir, 'scheduler-schemas.conf')] +
90            [os.path.join(config_dir, 'scheduler-profiles.conf')] +
91            [os.path.join(config_dir, 'scheduler.log')] +
92            [os.path.join(config_dir, 'smtp-schemas.conf')] +
93            glob(os.path.join(config_dir, '*.xml'))+
94            glob(os.path.join(config_dir, '*.txt'))),
95
96        # Radialnet
97        (os.path.join(pixmaps_dir, 'radialnet', 'application'),
98            glob(os.path.join(pixmaps_dir, 'radialnet', 'application',
99                '*.png'))),
100        (os.path.join(pixmaps_dir, 'radialnet', 'icons'),
101            glob(os.path.join(pixmaps_dir, 'radialnet', 'icons','*.png'))),
102
103        # Network Inventory
104        (os.path.join(pixmaps_dir, 'networkinventory'),
105            glob(os.path.join(pixmaps_dir, 'networkinventory', '*.png'))),
106
107        # InterfaceEditor
108        (os.path.join(pixmaps_dir, 'uie'),
109            glob(os.path.join(pixmaps_dir, 'uie', '*.png'))),
110
111        # umitDB SQL
112        (sql_dir, glob(os.path.join("umitDB/sql", "*.sql"))),
113
114        (misc_dir, glob(os.path.join(misc_dir, '*.dmp'))),
115               (docs_dir, glob(os.path.join(docs_dir, '*.html'))+
116                          glob(os.path.join(docs_dir,
117                                            'comparing_results', '*.xml'))+
118                          glob(os.path.join(docs_dir,
119                                            'profile_editor', '*.xml'))+
120                          glob(os.path.join(docs_dir,
121                                            'scanning', '*.xml'))+
122                          glob(os.path.join(docs_dir,
123                                            'searching', '*.xml'))+
124                          glob(os.path.join(docs_dir,
125                                            'wizard', '*.xml'))+
126                          glob(os.path.join(docs_dir, 'scheduler', '*.xml')) +
127                          glob(os.path.join(docs_dir, 'smtpsetup', '*.xml')) +
128                          glob(os.path.join(docs_dir,
129                                            'screenshots', '*.png'))),
130                (os.path.join(media_dir, 'js'),
131                          glob(os.path.join(media_dir, 'js', '*.js'))),
132               (os.path.join(media_dir, 'css'),
133                          glob(os.path.join(media_dir, 'css', '*.css'))),
134               (os.path.join(media_dir, 'images'), 
135                          glob(os.path.join(media_dir, 'images', '*.jpg')) +
136                          glob(os.path.join(media_dir, 'images', '*.png')) +
137                          glob(os.path.join(media_dir, 'images', '*.gif'))),
138               (templates_dir, glob(os.path.join(templates_dir, '*.html'))),
139               (os.path.join(templates_dir, 'html'),
140                          glob(os.path.join(templates_dir, 'html', '*.html')))]
141
142        (icons_dir, glob(os.path.join('share', 'icons', 'umit', '*.ico')) +
143            glob(os.path.join('share', 'icons', 'umit', '*.png'))),
144
145        (docs_dir, glob(os.path.join(docs_dir, '*.html')) +
146            glob(os.path.join(docs_dir, 'comparing_results', '*.xml')) +
147            glob(os.path.join(docs_dir, 'profile_editor', '*.xml')) +
148            glob(os.path.join(docs_dir, 'scanning', '*.xml')) +
149            glob(os.path.join(docs_dir, 'searching', '*.xml')) +
150            glob(os.path.join(docs_dir, 'wizard', '*.xml')) +
151            glob(os.path.join(docs_dir, 'scheduler', '*.xml')) +
152            glob(os.path.join(docs_dir, 'smtpsetup', '*.xml')) +
153            glob(os.path.join(docs_dir, 'screenshots', '*.png')))]
154
155# Add i18n files to data_files list
156os.path.walk(locale_dir, mo_find, data_files)
157
158
159class umit_py2exe(build_exe):
160    def run(self):
161        build_exe.run(self)
162        self.finish_banner()
163
164    def finish_banner(self):
165        print
166        print "%s The compiled version of Umit %s is in ./dist %s" % \
167              ("#"*10, VERSION, "#"*10)
168        print
169
170
171##################### Umit banner ###################################
172print
173print "%s Umit for Windows %s %s" % ("#"*10, VERSION, "#"*10)
174print
175#####################################################################
176
177setup(name = 'umit',
178      license = 'GNU GPL (version 2 or later)',
179      url = 'http://www.umitproject.org',
180      download_url = 'http://www.umitproject.org',
181      author = 'Adriano Monteiro, Cleber Rodrigues & Rodolfo Carvalho',
182      author_email = 'adriano@umitproject.org, cleber@globalred.com.br, rodolfo@umitproject.org',
183      maintainer = 'Adriano Monteiro',
184      maintainer_email = 'adriano@umitproject.org',
185      description = """Umit is a network scanning frontend, developed in \
186Python and GTK and was started with the sponsoring of Google's Summer of \
187Code.""",
188      long_description = """The project goal is to develop a network scanning \
189frontend that is really useful for advanced users and easy to be used by \
190newbies. With Umit, a network admin could create scan profiles for faster and \
191easier network scanning or even compare scan results to easily see any \
192changes. A regular user will also be able to construct powerful scans with \
193Umit command creator wizards.""",
194      version = VERSION,
195      scripts = ['umitwebserver', 'umit-scheduler'],
196      packages = [
197          'umitCore', 'umitCore.radialnet', 'umitDB', 'umitWeb', 'umitWeb.views', 'umitWeb.views.html', 
198          'umitInventory', 'umitPlugin', 'umitInterfaceEditor', 'umitInterfaceEditor.selectborder',
199          'higwidgets'],
200      data_files = data_files,
201      zipfile=None,
202      cmdclass = {"py2exe":umit_py2exe},
203      windows = [{"script": "management_console.pyw",
204                  "icon_resources" : [(1, os.path.join("share", "icons", "umit_48.ico"))]}],
205      console = [{"script": "umitwebserver",
206                  "icon_resources" : [(1, os.path.join("share", "icons", "umit_48.ico"))]}],
207      options = {"py2exe":{"compressed": 1,
208                           "optimize": 2,
209                           "packages": "encodings",
210                           "includes" : "pango,\
211atk,\
212gobject,\
213pickle,\
214bz2,\
215encodings,\
216encodings.*,\
217cairo,\
218pangocairo,\
219atk,\
220psyco"}})
Note: See TracBrowser for help on using the browser.