os.path.getmtime may return float in newer Pythons; compensate in test case
[joel/kofoto.git] / setup.py
1 #! /usr/bin/env python
2
3 from distutils.core import setup
4 import glob
5 import os
6 import shutil
7 import sys
8
9 package_dirs = {
10     "kofoto": "src/packages/kofoto",
11     }
12 packages = [
13     "kofoto",
14     "kofoto.commandline",
15     "kofoto.gkofoto",
16     "kofoto.output",
17     ]
18 data_files = [
19     ("share/gkofoto/glade", ["src/gkofoto/glade/gkofoto.glade"]),
20     ("share/gkofoto/icons", glob.glob("src/gkofoto/icons/*.png")),
21     ]
22 versionDict = {}
23 execfile("src/packages/kofoto/version.py", versionDict)
24 common_setup_options = {
25     "name": "kofoto",
26     "version": versionDict["version"],
27     "description": "A tool for organizing and viewing images.",
28     "package_dir": package_dirs,
29     "packages": packages,
30     "data_files": data_files,
31     "author": "Joel Rosdahl and Ulrik Svensson",
32     "author_email": "kofoto@rosdahl.net",
33     "maintainer": "Joel Rosdahl and Ulrik Svensson",
34     "maintainer_email": "kofoto@rosdahl.net",
35     "url": "http://kofoto.rosdahl.net",
36     "license": "BSD",
37     "group": "Applications/Graphics",
38     "requires": "python >= 2.4, gtk+ >= 2.4, glade >= 2.6, pygtk, sqlite >= 2.8, pysqlite, PIL",
39 }
40
41 def run(**setup_options):
42     options = common_setup_options.copy()
43     options.update(setup_options)
44     setup(**options)
45
46 def unix_install():
47     shutil.copy("src/gkofoto/start-installed.py", "gkofoto")
48     setup_options = {
49         "scripts": [
50             "src/cmdline/kofoto",
51             "gkofoto",
52             ]
53         }
54     run(**setup_options)
55     os.unlink("gkofoto")
56
57 if __name__ == "__main__":
58     unix_install()