forked from managarm/xbstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·53 lines (46 loc) · 1.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
#!/usr/bin/python3
import os
import shutil
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
with open('README.md', 'r') as f:
readme = f.read()
class CompletionDevelop(develop):
def run(self):
if(os.access('/etc/bash_completion.d', os.W_OK)):
shutil.copyfile('extrafiles/completion.sh', '/etc/bash_completion.d/xbstrap')
else:
print('Insufficient permissions to install the completion script to /etc/bash_completion.d')
develop.run(self)
class CompletionInstall(install):
def run(self):
if(os.access('/etc/bash_completion.d', os.W_OK)):
shutil.copyfile('extrafiles/completion.sh', '/etc/bash_completion.d/xbstrap')
else:
print('Insufficient permissions to install the completion script to /etc/bash_completion.d')
install.run(self)
setup(name='xbstrap',
version='0.16',
packages=['xbstrap'],
package_data={
'xbstrap': ['schema.yml']
},
scripts=['scripts/xbstrap', 'scripts/xbstrap-pipeline'],
install_requires=[
'colorama',
'jsonschema',
'pyyaml'
],
cmdclass={
'develop': CompletionDevelop,
'install': CompletionInstall,
},
# Package metadata.
author='Alexander van der Grinten',
author_email='alexander.vandergrinten@gmail.com',
license='MIT',
url='https://github.com/managarm/xbstrap',
long_description=readme,
long_description_content_type='text/markdown'
)