Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from yolk.pypi import CheeseShop
- template = '''Info3: <<
- Package: {fink_name}%type_pkg[python]
- Version: {version}
- Revision: {revision}
- Source: {url}
- Source-MD5: {md5}
- Type: python ({types})
- Depends: python%type_pkg[python]
- BuildDepends: distribute-py%type_pkg[python]
- CompileScript: true
- InstallScript: %p/bin/python%type_raw[python] setup.py install --root=%d --single-version-externally-managed
- License: OSI-Approved
- Homepage:
- Maintainer: Kurt Schwehr <goatbar@users.sourceforge.net>
- Description:
- DescDetail: <<
- <<
- # Info3
- <<
- '''
- def pypi_to_fink(package_name):
- cs = CheeseShop()
- release = cs.package_releases(package_name)[0] # Hope that highest is first
- # FIX: make a function that pulls the first sdist
- # Possibly prioritize by tar.bz2 -> tar.gz -> zip
- url = cs.release_urls(package_name,release)[0]
- fink = {}
- fink['name'] = package_name.lower()
- fink['fink_name'] = fink['name']+'-py'
- fink['version'] = release
- fink['revision'] = 1
- # FIX: remove the package name if need be from the URL
- fink['url'] = url['url']
- fink['md5'] = url['md5_digest']
- py_types = ['2.7', '3.2'] # FIX: figure this out
- fink['types'] = ' '.join(py_types)
- return template.format(**fink)
- if __name__ == '__main__':
- import sys
- print pypi_to_fink(sys.argv[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement