root/trunk/install_scripts/windows/setup.py @ 4042

Revision 4042, 8.6 kB (checked in by luis, 4 years ago)

Added missing pixmaps

  • 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
31from umitCore.Version import VERSION
32
33################################################################################
34# Main Variables
35
36# Directories for POSIX operating systems
37# These are created after a "install" or "py2exe" command
38# These directories are relative to the installation or dist directory
39# Ex: python setup.py install --prefix=/tmp/umit
40# Will create the directory /tmp/umit with the following directories
41pixmaps_dir = os.path.join('share', 'pixmaps', 'umit')
42icons_dir = os.path.join('share', 'icons', 'umit')
43locale_dir = os.path.join('share', 'locale')
44config_dir = os.path.join('share', 'umit', 'config')
45docs_dir = os.path.join('share', 'doc', 'umits')
46misc_dir = os.path.join('share', 'umit', 'misc')
47sql_dir = os.path.join('share', 'umit', 'sql')
48
49def mo_find(result, dirname, fnames):
50    files = []
51    for f in fnames:
52        p = os.path.join(dirname, f)
53        if os.path.isfile(p) and f.endswith(".mo"):
54            files.append(p)
55       
56    if files:
57        result.append((dirname, files))
58
59
60################################################################################
61# Installation variables
62
63# What to copy to the destiny
64# Here, we define what should be put inside the directories set in the beginning
65# of this file. This list contain tuples where the first element contains
66# a path to where the other elements of the tuple should be installed.
67# The first element is a path in the INSTALLATION PREFIX, and the other elements
68# are the path in the source base.
69# Ex: [("share/pixmaps", "/umit/trunk/share/pixmaps/test.png")]
70# This will install the test.png file in the installation dir share/pixmaps.
71svg = glob(os.path.join('share', 'pixmaps', '*.svg'))
72data_files = [ (pixmaps_dir, glob(os.path.join(pixmaps_dir, '*.svg')) +
73                             glob(os.path.join(pixmaps_dir, '*.png')) +
74                             glob(os.path.join(pixmaps_dir, '*.xpm')) +
75
76                             glob(os.path.join(pixmaps_dir, 'umit.o*'))),
77
78               (config_dir, [os.path.join(config_dir, 'umit.conf')] +
79                            [os.path.join(config_dir, 'scan_profile.usp')] +
80                            [os.path.join(config_dir, 'umit_version')] +
81                            [os.path.join(config_dir, 'umitng.db')] +
82                            [os.path.join(config_dir,
83                                          'timeline-settings.conf')] +
84                            [os.path.join(config_dir,
85                                          'tl_colors_evt_std.conf')] +
86                            [os.path.join(config_dir,
87                                          'scheduler-schemas.conf')] +
88                            [os.path.join(config_dir,
89                                          'scheduler-profiles.conf')] +
90                            [os.path.join(config_dir, 'scheduler.log')] +
91                            [os.path.join(config_dir, 'smtp-schemas.conf')] +
92                            glob(os.path.join(config_dir, '*.xml'))+
93                            glob(os.path.join(config_dir, '*.txt'))),
94               # Radialnet
95                (os.path.join(pixmaps_dir, 'radialnet', 'application'),                            glob(os.path.join(pixmaps_dir, 'radialnet','application', '*.png')) ),
96                (os.path.join(pixmaps_dir, 'radialnet', 'icons'),                            glob(os.path.join(pixmaps_dir, 'radialnet','icons', '*.png')) ),
97               
98                # Network Inventory
99                (os.path.join(pixmaps_dir, 'networkinventory'),                            glob(os.path.join(pixmaps_dir, 'networkinventory', '*.png')) ),
100               
101                # InterfaceEditor
102                (os.path.join(pixmaps_dir, 'uie'),                            glob(os.path.join(pixmaps_dir, 'uie', '*.png')) ),
103               
104               # umitDB SQL
105               (sql_dir, glob(os.path.join("umitDB/sql", "*.sql"))),
106
107               (misc_dir, glob(os.path.join(misc_dir, '*.dmp'))),
108
109               (icons_dir, glob(os.path.join('share', 'icons', 'umit',
110                                             '*.ico'))+
111                           glob(os.path.join('share', 'icons', 'umit',
112                                             '*.png'))),
113
114               (docs_dir, glob(os.path.join(docs_dir, '*.html'))+
115                          glob(os.path.join(docs_dir,
116                                            'comparing_results', '*.xml'))+
117                          glob(os.path.join(docs_dir,
118                                            'profile_editor', '*.xml'))+
119                          glob(os.path.join(docs_dir,
120                                            'scanning', '*.xml'))+
121                          glob(os.path.join(docs_dir,
122                                            'searching', '*.xml'))+
123                          glob(os.path.join(docs_dir,
124                                            'wizard', '*.xml'))+
125                          glob(os.path.join(docs_dir, 'scheduler', '*.xml')) +
126                          glob(os.path.join(docs_dir, 'smtpsetup', '*.xml')) +
127                          glob(os.path.join(docs_dir,
128                                            'screenshots', '*.png')))]
129
130# Add i18n files to data_files list
131os.path.walk(locale_dir, mo_find, data_files)
132
133
134class umit_py2exe(build_exe):
135    def run(self):
136        build_exe.run(self)
137        self.finish_banner()
138
139    def finish_banner(self):
140        print 
141        print "%s The compiled version of Umit %s is in ./dist %s" % \
142              ("#"*10, VERSION, "#"*10)
143        print
144
145
146##################### Umit banner ###################################
147print
148print "%s Umit for Windows %s %s" % ("#"*10, VERSION, "#"*10)
149print
150#####################################################################
151
152setup(name = 'umit',
153      license = 'GNU GPL (version 2 or later)',
154      url = 'http://www.umitproject.org',
155      download_url = 'http://www.umitproject.org',
156      author = 'Adriano Monteiro & Cleber Rodrigues',
157      author_email = 'adriano@umitproject.org, cleber@globalred.com.br',
158      maintainer = 'Adriano Monteiro',
159      maintainer_email = 'adriano@umitproject.org',
160      description = """Umit is a network scanning frontend, developed in \
161Python and GTK and was started with the sponsoring of Google's Summer of \
162Code.""",
163      long_description = """The project goal is to develop a network scanning \
164frontend that is really useful for advanced users and easy to be used by \
165newbies. With Umit, a network admin could create scan profiles for faster and \
166easier network scanning or even compare scan results to easily see any \
167changes. A regular user will also be able to construct powerful scans with \
168Umit command creator wizards.""",
169      version = VERSION,
170      scripts = ['umit'],
171      packages = ['', 'umitCore','umitCore.radialnet', 'umitDB', 'umitGUI', 'umitInventory',
172                  'umitPlugin', 'umitGUI.radialnet', 'umitInterfaceEditor', 'umitInterfaceEditor.selectborder',
173                  'higwidgets'],
174      data_files = data_files,
175      zipfile=None,
176      cmdclass = {"py2exe":umit_py2exe},
177      windows = [{"script" : "umit",
178                  "icon_resources" : [(1, os.path.join(icons_dir,
179                                                       "umit_48.ico"))]}],
180      options = {"py2exe":{"compressed":1,
181                           "optimize":2,
182                           "packages":"encodings",
183                           "includes" : "pango,\
184atk,\
185gobject,\
186pickle,\
187bz2,\
188encodings,\
189encodings.*,\
190cairo,\
191pangocairo,\
192atk,\
193psyco"}})
Note: See TracBrowser for help on using the browser.