1 | #! /usr/bin/env python |
---|
2 | # -*- coding: iso-8859-15 -*- |
---|
3 | |
---|
4 | """Packaging and installation script for PyKotIcon.""" |
---|
5 | |
---|
6 | # PyKotIcon - Client side helper for PyKota and other applications |
---|
7 | # |
---|
8 | # (c) 2003-2013 Jerome Alet <alet@librelogiciel.com> |
---|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | # |
---|
23 | # $Id$ |
---|
24 | # |
---|
25 | # |
---|
26 | |
---|
27 | from distutils.core import setup |
---|
28 | import sys |
---|
29 | import os |
---|
30 | import imp |
---|
31 | import glob |
---|
32 | try : |
---|
33 | import py2exe |
---|
34 | except ImportError : |
---|
35 | if sys.platform == "win32" : |
---|
36 | sys.stderr.write("py2exe is not installed ! ABORTING.\n") |
---|
37 | sys.exit(-1) |
---|
38 | else : |
---|
39 | directory = os.sep.join(["share", "pykoticon"]) |
---|
40 | mandir = os.sep.join(["share", "man", "man1"]) |
---|
41 | manpages = glob.glob(os.sep.join(["man", "*.1"])) |
---|
42 | initialdatafiles = [(mandir, manpages)] |
---|
43 | withPy2EXE = False |
---|
44 | else : |
---|
45 | directory = "." |
---|
46 | initialdatafiles = [] |
---|
47 | withPy2EXE = True |
---|
48 | |
---|
49 | config = imp.load_source("config", os.path.join("bin", "pykoticon")) |
---|
50 | setupDictionary = { "name" : "pykoticon", |
---|
51 | "version" : config.__version__, |
---|
52 | "license" : config.__license__, |
---|
53 | "description" : config.__doc__, |
---|
54 | "author" : config.__author__, |
---|
55 | "author_email" : config.__author_email__, |
---|
56 | "url" : config.__url__, |
---|
57 | "data_files" : initialdatafiles \ |
---|
58 | + [(directory, glob.glob(os.path.join("icons", "*.ico")))], |
---|
59 | } |
---|
60 | if withPy2EXE : |
---|
61 | setupDictionary["windows"] = [ os.path.join("bin", "pykoticon") ] |
---|
62 | setupDictionary["data_files"].append((directory, [os.path.join("bin", "pykoticon.vbs")])) |
---|
63 | setupDictionary["data_files"].append((directory, [os.path.join(".", "COPYING")])) |
---|
64 | else : |
---|
65 | setupDictionary["scripts"] = [os.path.join("bin", "pykoticon")] |
---|
66 | setup(**setupDictionary) |
---|