-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
executable file
·69 lines (60 loc) · 1.96 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
# Python Libs
import os
import shutil
# DistUtils
from distutils.core import setup
from distutils.cmd import Command
from distutils.command.build import build
from distutils.command.clean import clean
from distutils.command.sdist import sdist
from distutils.sysconfig import get_python_lib
PROJECT = 'pds'
def plp():
return os.path.join(get_python_lib(), PROJECT)
class Clean(clean):
def run(self):
print 'Cleaning ...'
os.system('find -name *.pyc|xargs rm -rf')
for dirs in ('build', 'dist'):
if os.path.exists(dirs):
print ' removing: ', dirs
shutil.rmtree(dirs)
clean.run(self)
class Dist(sdist):
def run(self):
os.system('python setup.py build')
sdist.run(self)
class Uninstall(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print 'Uninstalling ...'
project_dir = plp()
if os.path.exists(project_dir):
print ' removing: ', project_dir
shutil.rmtree(project_dir)
setup(name=PROJECT,
version='2.1.0',
description='Pds: Pisi Desktop Services',
long_description='Pds is a Python Library that helps developers for '\
'creating desktop environment independet UI applications',
license='GNU GPL2',
author='Pisi Linux',
author_email='admins@pisilinux.org',
url='http://pisilinux.org',
packages=[PROJECT, 'pds.tests', 'pds.ui'],
data_files = [(plp(), ['README', 'COPYING', 'HELP'])],
cmdclass = {
'uninstall':Uninstall,
'clean' :Clean,
}
)