#!/usr/bin/python # # Linux Desktop Testing Project http://www.gnomebangalore.org/ldtp # # Author: # A. Nagappan # # Copyright 2004, 2005 Novell, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # from distutils.core import setup, Extension import string, commands, os, sys inc_path = [string.split (commands.getoutput ('pwd'), '/build')[0]] lib_path = [] lib_name = [] lib_other = '' inc_other = '' status, data = commands.getstatusoutput ('pkg-config --libs-only-L cspi-1.0') if status == 0: tmp = string.split (data, '-L') for i in tmp: if i.strip() == '': continue else: lib_path.insert (0, string.strip (i)) else: sys.exit ('Unable to get: pkg-config --libs-only-L cspi-1.0') status, data = commands.getstatusoutput ('pkg-config --libs-only-l cspi-1.0') if status == 0: tmp = string.split (data, '-l') for i in tmp: if i == '': continue else: lib_name.insert (0, string.strip (i)) lib_name.insert (0, 'gettextpo') else: sys.exit ('Unable to get: pkg-config --libs-only-l cspi-1.0') status, data = commands.getstatusoutput ('pkg-config --cflags-only-I cspi-1.0') if status == 0: tmp = string.split (data, '-I') for i in tmp: if i == '': continue else: inc_path.insert (0, string.strip (i)) else: sys.exit ('Unable to get: pkg-config --cflags-only-I cspi-1.0') status, lib_other = commands.getstatusoutput ('pkg-config --libs-only-other cspi-1.0') if status != 0: sys.exit ('Unable to get: pkg-config --libs-only-other cspi-1.0') status, inc_other = commands.getstatusoutput ('pkg-config --cflags-only-other cspi-1.0') if status != 0: sys.exit ('Unable to get: pkg-config --cflags-only-other cspi-1.0') source_files = ['appmap.c', 'calendar_view.c', 'check_box.c', 'check_menu_item.c', 'combo_box.c', 'gui.c', 'icon.c', 'label.c', 'layered_pane.c', 'ldtp.c', 'list.c', 'log.c', 'menu.c', 'menu_item.c', 'panel.c', 'page_tab_list.c', 'push_button.c', 'radio_button.c', 'radio_menu_item.c', 'remap.c', 'scroll_bar.c', 'slider.c', 'spin_button.c', 'status_bar.c', 'table.c', 'text.c', 'toggle_button.c', 'tool_bar.c', 'tree_table.c', 'localization.c'] ldtp_module = Extension ('ldtp', library_dirs=lib_path, libraries=lib_name, include_dirs=inc_path, extra_compile_args=['-g'], sources = source_files) ldtp_classify = [ 'Development Status :: 2 - Pre-Alpha', 'Environment :: X11 Applications', 'Environment :: X11 Applications :: GNOME', 'Environment :: X11 Applications :: KDE', 'Intended Audience :: Developers', 'Intended Audience :: Quality Engineers', 'License :: OSI Approved :: GNU General Public License (GPL)', 'License :: OSI Approved :: GNU Lesser General Public License (LGPL)', 'Operating System :: Linux', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: C', 'Topic :: Desktop Environment', 'Topic :: Software Development :: Quality Assurance', 'Topic :: Software Development :: Testing', ] data_file_list = '' local_bin_file_list = '' cwd = commands.getoutput ('pwd') if os.access (string.split (cwd, '/build')[0] + '/appmap', os.F_OK | os.R_OK) == 1: local_bin_file_list = ['appmap'] if os.access (string.split (cwd, '/build')[0] + '/ltfx', os.F_OK | os.R_OK) == 1: if local_bin_file_list == '': local_bin_file_list = ['ltfx'] else: local_bin_file_list = local_bin_file_list + ['ltfx'] if os.access (string.split (cwd, '/build')[0] + '/digwin', os.F_OK | os.R_OK) == 1: if local_bin_file_list == '': local_bin_file_list = ['digwin'] else: local_bin_file_list = local_bin_file_list + ['digwin'] if os.access (string.split (cwd, '/build')[0] + '/gldap.py', os.F_OK | os.R_OK) == 1: if local_bin_file_list == '': local_bin_file_list = ['gldap.py'] else: local_bin_file_list = local_bin_file_list + ['gldap.py'] local_bin_list = [] for i in local_bin_file_list: local_bin_list = local_bin_list + [string.split (cwd, '/build')[0] + '/' + i] data_file_list = ('bin', local_bin_list) setup (name="ldtp", version="0.2.1", description="GNU/Linux Desktop Testing Project", author="Nagappan A", classifiers=ldtp_classify, author_email="nagappan@gmail.com", url="http://gnomebangalore.org/ldtp", data_files=[data_file_list], ext_modules=[ldtp_module], py_modules=["ldtputils"] )