-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·49 lines (43 loc) · 1.71 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
#!/usr/bin/env python
#Copyright 2008 Sebastian Hagen
# This file is part of teucrium.
# teucrium is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation
#
# teucrium is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from distutils.core import setup
from distutils.command.install_scripts import install_scripts as _install_scripts
from distutils.util import byte_compile
class install_scripts(_install_scripts):
def run(self, *args, **kwargs):
# __ugly__
tdir = os.path.join(os.path.split(self.install_dir.rstrip('/'))[0], 'sbin/')
if not (os.path.exists(tdir)):
os.makedirs(tdir)
fn = os.path.join(tdir, 'teucrium')
fn_src = 'src/teucrium/main.py'
byte_compile((fn_src,))
self.copy_file(fn_src + 'c', fn)
os.system('chmod g+x,o-x %r' % (fn,))
setup(name='teucrium',
version='0.3.6',
description='teucrium: using linux netfilter and rrdtool to graph traffic',
author='Sebastian Hagen',
author_email='[email protected]',
url='http://git.memespace.net/git/teucrium.git',
packages=('teucrium',),
package_dir={'teucrium':'src/teucrium'},
scripts=('src/teucrium/main.py',),
data_files=(
('/etc/teucrium/', ('examples/teucrium.conf.example',)),
),
cmdclass={'install_scripts': install_scripts}
)