-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·43 lines (34 loc) · 1.28 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
#!/usr/bin/env python3
import sys, os, shutil
from distutils.core import setup
sys.path.insert(1, 'src')
from latre.config import version, package
# Clean pycache
cachefolder = os.path.join('src', package, '__pycache__')
shutil.rmtree(cachefolder)
# Copy the script to other place, rename it for building
src_bin = os.path.join('src', 'latre-bin')
bin_folder = 'bin'
bin_file = os.path.join(bin_folder, package)
if len(sys.argv) > 1:
if not os.path.isdir(bin_folder):
os.mkdir(bin_folder)
print('Copy {} to {}'.format(src_bin, bin_file))
shutil.copy(src_bin, bin_file)
setup(name=package,
version=version,
description='A phonebook app, allow to import contacts from vCard files, delete contact. This app uses the same storage as GNOME Contacts, so the contacts can seen in both application.',
author='Nguyễn Hồng Quân',
author_email='[email protected]',
url='http://heomoi.wordpress.com',
package_dir = {'': 'src'},
packages=['latre'],
scripts=[bin_file],
data_files=[('share/latre', ['data/MainWindow.ui']),
('share/icons/hicolor/scalable/apps', ['data/latre.svg']),
('share/applications', ['data/latre.desktop'])]
)
# Remove the copied file
if os.path.exists(bin_folder):
print('Remove', bin_folder)
shutil.rmtree(bin_folder)