-
Notifications
You must be signed in to change notification settings - Fork 1
/
pavement.py
65 lines (58 loc) · 1.62 KB
/
pavement.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
import errno
import os
from setuptools import Extension
from paver.easy import *
from paver.path import path
from paver.setuputils import setup
setup(
name="prctl",
description="C extension for access to the prctl(2) system call",
version="1.0.1",
license="bsd",
author="Libor Michalek",
author_email="[email protected]",
ext_modules=[Extension(
'prctl',
['prctlmodule.c'],
include_dirs=['/usr/include'],
depends=['/usr/include/sys/prctl.h'],
extra_compile_args=['-Wall'])],
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: C",
"Topic :: System",
]
)
MANIFEST = (
"LICENSE",
"setup.py",
"paver-minilib.zip",
"prctlmodule.c",
)
@task
def manifest():
path('MANIFEST.in').write_lines('include %s' % x for x in MANIFEST)
@task
@needs('generate_setup', 'minilib', 'manifest', 'setuptools.command.sdist')
def sdist():
pass
@task
def clean():
for p in map(path, ('prctl.egg-info', 'dist', 'build', 'MANIFEST.in')):
if p.exists():
if p.isdir():
p.rmtree()
else:
p.remove()
for p in path(__file__).abspath().parent.walkfiles():
if p.endswith(".pyc") or p.endswith(".pyo"):
try:
p.remove()
except OSError, exc:
if exc.args[0] == errno.EACCES:
continue
raise