forked from leamas/ddupdate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
70 lines (58 loc) · 2.02 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
70
"""ddupdate install data."""
import shutil
import os
import subprocess
from distutils.command.clean import clean
from glob import glob
from setuptools import setup
# pylint: disable=bad-continuation
ROOT = os.path.dirname(__file__)
ROOT = ROOT if ROOT else '.'
def systemd_unitdir():
"""Return the official systemd unit dir path."""
cmd = 'pkg-config systemd --variable=systemdsystemunitdir'.split()
try:
return subprocess.check_output(cmd).decode().strip()
except (OSError, subprocess.CalledProcessError):
return "/usr/lib/systemd/system"
DATA = [
(systemd_unitdir(), glob('systemd/*')),
('share/bash-completion/completions/', ['bash_completion.d/ddupdate']),
('share/man/man8', ['ddupdate.8', 'ddupdate-config.8']),
('share/man/man5', ['ddupdate.conf.5']),
('share/ddupdate/plugins', glob('plugins/*.py')),
('share/ddupdate/dispatcher.d', ['dispatcher.d/50-ddupdate']),
('share/ddupdate/systemd', glob('systemd/*'))
]
class _ProjectClean(clean):
"""Actually clean up everything generated."""
def run(self):
super().run()
paths = ['build', 'install', 'dist', 'lib/ddupdate.egg-info']
for path in paths:
if os.path.exists(path):
shutil.rmtree(path)
setup(
name='ddupdate',
version='0.6.1',
description='Update dns data for dynamic ip addresses',
long_description=open(ROOT + '/README.md').read(),
include_package_data=True,
license='MIT',
url='http://github.com/leamas/ddupdate',
author='Alec Leamas',
author_email='[email protected]',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Topic :: System :: Networking',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.4',
],
keywords=['dyndns', 'dhcp', 'dns'],
package_dir={'': 'lib'},
packages=['ddupdate'],
scripts=['ddupdate', 'ddupdate-config'],
data_files=DATA,
cmdclass={'clean': _ProjectClean}
)