#!/usr/bin/env python2 # -*- coding: utf-8 -*- # setup.py --- Setup script for calculate-ldap # Copyright 2010 Calculate Ltd. http://www.calculate-linux.org # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import stat from distutils.core import setup from distutils.command.install_data import install_data data_files = [] var_data_files = [] data_files += [('/usr/share/icons/hicolor/48x48/client-gui',['api/images/tool.png'])] data_files += [('/usr/share/icons/hicolor/48x48/client-gui',['api/images/Exit.png'])] data_files += [('/usr/share/icons/hicolor/48x48/client-gui',['api/images/help.png'])] __version__ = "0.1" __app__ = "caqlculate-api" class cl_api_data(install_data): def run (self): install_data.run(self) data_file = [("/usr/lib/python2.7/site-packages/calculate/api/images/tool.png",0755)] fileNames = map(lambda x: os.path.split(x[0])[1], data_file) listNames = map(lambda x: filter(lambda y: y, x[0].split("/")), data_file) data_find = {} for i in range(len(fileNames)): listNames[i].reverse() data_find[fileNames[i]] =[listNames[i],data_file[i][1]] for path in self.get_outputs(): nameFile = os.path.split(path)[1] if nameFile in data_find.keys(): data = data_find[nameFile][0] mode = data_find[nameFile][1] flagFound = True iMax = len(data) pathFile = path for i in range(iMax): if data[i] != os.path.split(pathFile)[1]: flagFound = False break pathFile = os.path.split(pathFile)[0] if flagFound: os.chmod(path, mode) setup( name = __app__, version = __version__, description = "GUI client for WSDL server", author = "Calculate Ltd.", author_email = "support@calculate.ru", url = "http://calculate-linux.org", license = "http://www.apache.org/licenses/LICENSE-2.0", data_files = data_files, package_dir = {'calculate.api': "api"}, packages = ['calculate.api','calculate.api.gui', 'calculate.api.images'], scripts = ['./scripts/client-gui'], cmdclass={'cl_api_data': cl_api_data} )