#!/usr/bin/python from distutils.core import setup from distutils.extension import Extension import Pyrex.Distutils, time, re from version import * LONG_DESC='''\ This is DSpam native support for python via pydspam for SAGATOR, but may be used for any python script. Script "example.py" is a part of this package. ''' # update spec file if re.compile('^[0-9]+$').search(RELEASE): UNSTABLE_RELEASE='' else: UNSTABLE_RELEASE='-'+RELEASE open(PROJECT+'.spec','w').write( open(PROJECT+'.spec.in','r').read( ).replace( '%VERSION%', VERSION ).replace( '%RELEASE%', RELEASE ).replace( '%UNSTABLE_RELEASE%', UNSTABLE_RELEASE ) ) # update debian changelog file open('debian/changelog','w').write('''\ %s (%s-%s) unstable; urgency=low * This file is automatically generated by sagator's configure script. -- Jan ONDREJ (SAGATOR) %s ''' % (PROJECT,VERSION,RELEASE,time.strftime('%a, %d %b %Y %H:%M:%S %z')) ) # update gentoo ebuild rel_path='%s-%s-%s.tar.bz2' % (PROJECT, VERSION, RELEASE) if ('beta' in RELEASE) or ('rc' in RELEASE): rel_path='unstable/' + rel_path eb_name='%s-%s.ebuild' % (PROJECT, VERSION) # re.compile('^[0-9]*').sub('_', RELEASE)) else: eb_name='%s-%s.ebuild' % (PROJECT, VERSION) open(eb_name, 'w').write( open(PROJECT+'.ebuild.in').read() % rel_path ) setup( name=PROJECT, version=VERSION, description="ClamAV module for python, created for SAGATOR project", long_description=LONG_DESC, author="Jan ONDREJ (SAL)", author_email="ondrejj(at)salstar.sk", url="http://www.salstar.sk/sagator/", license="LGPL", ext_modules=[ Extension( "pydspam", ["pydspam.pyx"], include_dirs=['/usr/include/dspam'], libraries=['dspam'], extra_compile_args=['-DCONFIG_DEFAULT=/etc/dspam.conf', '-DLOGDIR=/var/log/sagator'] ) ], cmdclass = {'build_ext': Pyrex.Distutils.build_ext} )