forked from kalinon/ComicStreamer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpavement.py
52 lines (44 loc) · 1.46 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- mode: Python; tab-width: 4; indent-tabs-mode: nil; -*-
# Do not change the previous lines. See PEP 8, PEP 263.
#
from paver.easy import *
from paver.setuputils import setup
import urllib.request
import os
import platform
setup(
name="TestProject",
packages=[],
version="1.0",
url="http://example.com/",
author="Davide Romanini",
author_email="[email protected]")
@task
def libunrar():
if platform.system() == "Windows":
UNRAR_SRC = "http://www.rarlab.com/rar/UnRARDLL.exe"
else:
UNRAR_SRC = "http://www.rarlab.com/rar/unrarsrc-5.3.2.tar.gz"
dest = "libunrar/" + os.path.basename(UNRAR_SRC)
if not os.path.exists(dest):
print("Fetching " + UNRAR_SRC + "...")
urllib.request.urlretrieve(UNRAR_SRC, dest)
if platform.system() == "Windows":
print("Please extract UnRAR.dll from UnRARDLL.exe into libunrar/libunrar.so")
else:
if not os.path.exists("libunrar/unrar"):
print("Unpacking " + dest + "...")
sh("tar xfz %s -C libunrar" % dest)
print("Compiling unrar...")
sh("cd libunrar/unrar && make lib")
sh("cp libunrar/unrar/libunrar.so libunrar/libunrar.so")
print("Cleaning up ...")
sh("rm -rf libunrar/unrar*")
sh("rm -f libunrar/unrar/libunrar.so")
@task
@needs(["distutils.command.sdist"])
def sdist():
"""Generate docs and source distribution."""
pass