#! /usr/bin/env python # # Copyright (c) 2003,2004 Guilherme Salgado # All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser 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 # # Author: Guilherme Salgado # import os, sys if sys.version < '2.3': # we need at least python2.3 raise SystemExit, """Coverhunter needs at least python2.3, you'll have to update your python package in order to install coverhunter.""" from distutils.command.install_lib import install_lib from distutils.core import setup VERSION = "0.2" PACKAGE = "coverhunter" LIB_DIR = os.path.join('lib', PACKAGE) DATA_DIR = os.path.join(LIB_DIR, 'data') DATA_FILES = ['data/nocover.gif', 'data/fetch_all.png', 'data/picture.png', 'data/CoverHunter.glade', 'data/searching.png'] class my_install_lib(install_lib): """my_install_lib: install libraries in $PREFIX/lib/$PACKAGE""" def run(self): prefix = os.sep.join(self.install_dir.split(os.sep)[:-4]) self.install_dir = os.path.join(prefix, LIB_DIR) install_lib.run(self) dict = { 'name': PACKAGE, 'version': VERSION, 'license': 'GPL', 'author': 'Guilherme Salgado', 'author_email': 'salgado@async.com.br', 'description': 'download album covers', 'url': 'http://sourceforge.net/projects/coverhunter', 'scripts': ['bin/coverhunter'], 'packages': ['lib'], 'data_files': [(DATA_DIR, DATA_FILES)], 'cmdclass' : {'install_lib': my_install_lib } } setup(**dict)