-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
executable file
·61 lines (56 loc) · 2.36 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
#!/usr/bin/env python
from distutils.core import setup, Command
import os, sys
from StoneVPN import STONEVPN_VERSION
class SetupBuildCommand(Command):
user_options = []
def initialize_options(self):
self._dir = os.getcwd()
def finalize_options(self):
pass
class InstallDocsCommand(SetupBuildCommand):
"""
Extra command to install documentation files
"""
description = "install documentation and sample configuration files"
def run(self):
import shutil
doc_files=(
('share/StoneVPN',['README','COPYING','Changelog','TODO']),
('share/StoneVPN/example',['conf/stonevpn.conf']),
('share/StoneVPN/rpm',['rpm/stonevpn.spec']),
('share/man/man1',['man/stonevpn.1']),
('share/man/man5',['man/stonevpn.conf.5'])
)
for dst_path,files in doc_files:
for src in files:
filename = str(src.split('/')[len(src.split('/'))-1])
print "copying %s to /usr/%s/%s" % (src,dst_path,filename)
if not os.path.isdir('/usr/' + str(dst_path)):
os.mkdir('/usr/' + str(dst_path))
shutil.copy(src, '/usr/' + str(dst_path) + "/" + str(filename))
cmd = 'gzip /usr/share/man/man1/stonevpn.1'
os.system(cmd)
cmd = 'gzip /usr/share/man/man5/stonevpn.conf.5'
os.system(cmd)
# Generate list of files
files=[]
for f in os.path.abspath(''):
files.append(f)
setup(name = 'stonevpn',
version = STONEVPN_VERSION,
description = 'Easy OpenVPN certificate and configuration management',
long_description = 'StoneVPN is a system that makes it easy to create certificates and configuration files for use with an OpenVPN server for Windows, Linux and Mac users. It has the ability to create a zip file and e-mail the entire package to a user. It uses pyOpenSSL, and the latest version of it allows it to manage a CRL file.',
author = 'Leon Keijser',
author_email = '[email protected]',
url = 'http://github.com/lkeijser/stonevpn/tree/master',
download_url = 'http://github.com/lkeijser/stonevpn/downloads',
license = 'GPLv2+',
packages = ['StoneVPN'],
package_data = {'stonevpn': files},
scripts = ["bin/stonevpn"],
data_files=[
('/etc',['conf/stonevpn.conf']),
],
cmdclass = { 'install_docs': InstallDocsCommand }
),