~ubuntu-branches/ubuntu/precise/inotifyx/precise-201110182259

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Ritesh Raj Sarraf
  • Date: 2011-04-11 18:31:00 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110411183100-0b1c92aalv5almvj
Tags: 0.1.2-1
* New Upstream Release (Closes: #620329) 
* Change address to my official Debian address
* Add debian/source/format to explictly specify the source format
* debian/rules:
  - Drop the example as it is not shipped any more
  - Update clean target
* debian/control:
  - Add misc:Depends
  - Update Standards Version to 3.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
 
3
 
# Author: Forest Bond <forest@alittletooquiet.net>
 
3
# Author: Forest Bond <forest.bond@outpostembedded.com>
4
4
# This file is in the public domain.
5
5
 
6
 
 
7
 
from distutils.core import (
8
 
  setup,
9
 
  Extension,
10
 
  Command,
11
 
)
12
 
 
13
 
 
14
 
################################################################################
15
 
 
16
 
 
17
 
class test(Command):
18
 
    description = 'run tests'
19
 
    user_options = []
20
 
 
21
 
    def initialize_options(self):
22
 
        pass
23
 
 
24
 
    def finalize_options(self):
25
 
        pass
26
 
 
27
 
    def run(self):
28
 
        from tests import main
29
 
        main()
30
 
 
31
 
 
32
 
################################################################################
 
6
import os, sys, commands
 
7
from distutils.core import Extension
 
8
 
 
9
 
 
10
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'modules'))
 
11
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
 
12
 
 
13
 
 
14
from setuplib import setup
 
15
 
 
16
 
 
17
def get_version(release_file):
 
18
    try:
 
19
        f = open(release_file, 'r')
 
20
        try:
 
21
            return f.read().strip()
 
22
        finally:
 
23
            f.close()
 
24
    except (IOError, OSError):
 
25
        status, output = commands.getstatusoutput('bzr revno')
 
26
        if status == 0:
 
27
            return 'bzr%s' % output.strip()
 
28
    return 'unknown'
33
29
 
34
30
 
35
31
setup(
36
 
  cmdclass = {'test': test},
37
32
  name = 'inotifyx',
38
 
  version = '0.1.1',
 
33
  version = get_version('release'),
39
34
  description = 'Simple Linux inotify bindings',
40
35
  author = 'Forest Bond',
41
36
  author_email = 'forest@alittletooquiet.net',