source: epoptes/trunk/fuentes/setup.py @ 295

Last change on this file since 295 was 295, checked in by mabarracus, 4 years ago

copy trusty epoptes code

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4###########################################################################
5# This script needs python-distutils-extra, an extension to the standard
6# distutils which provides i18n, icon support, etc.
7# https://launchpad.net/python-distutils-extra
8#
9# Copyright (C) 2011 Alkis Georgopoulos <alkisg@gmail.com>
10#
11# This program is free software: you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation, either version 3 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FINESS FOR A PARTICULAR PURPOSE.  See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23#
24# On Debian GNU/Linux systems, the complete text of the GNU General
25# Public License can be found in `/usr/share/common-licenses/GPL".
26###########################################################################
27
28from glob import glob
29from distutils.version import StrictVersion
30
31try:
32    import DistUtilsExtra.auto
33except ImportError:
34    import sys
35    print >> sys.stderr, 'To build epoptes you need https://launchpad.net/python-distutils-extra'
36    sys.exit(1)
37
38assert StrictVersion(DistUtilsExtra.auto.__version__) >= '2.4', 'needs DistUtilsExtra.auto >= 2.4'
39
40import posixpath, re
41
42def changelog_version(changelog="debian/changelog"):
43    version = "dev"
44    if posixpath.exists(changelog):
45        head=open(changelog).readline()
46        match = re.compile(".*\((.*)\).*").match(head)
47        if match:
48            version = match.group(1)
49
50    return version
51
52def subtract_files(a, b):
53    res = set(a)
54    for dir, files in b:
55        res -= set(files)
56    return list(res)
57
58client_special_files=[
59    ('/etc/xdg/autostart/',
60        ['epoptes-client/epoptes-client.desktop']),
61    ('/usr/sbin/',
62        ['epoptes-client/epoptes-client']),
63    ('/usr/share/ldm/rc.d/',
64        ['epoptes-client/X50-client-env']),
65    ]
66client_usr_share_files=[
67    ('/usr/share/epoptes-client/',
68        subtract_files(glob('epoptes-client/*'), client_special_files))
69    ]
70server_special_files=[
71    ('/usr/share/ltsp/plugins/ltsp-build-client/common/',
72        ['data/040-epoptes-certificate'])];
73
74DistUtilsExtra.auto.setup(
75    name='epoptes',
76    version = changelog_version(),
77    description = 'Computer lab administration and monitoring tool',
78    url = 'http://www.epoptes.org',
79    license = 'GNU GPL v3',
80    author = 'Fotis Tsamis',
81    author_email = 'ftsamis@gmail.com',
82    py_modules = ['twisted.plugins.epoptesd'],
83    data_files = client_special_files + client_usr_share_files +
84        server_special_files
85)
Note: See TracBrowser for help on using the repository browser.