From a85e53053dadfb7ee5673dda26e7b953834f2f07 Mon Sep 17 00:00:00 2001 From: eduardo Date: Thu, 18 Sep 2008 14:58:43 +0000 Subject: [PATCH] in the way of setuptooling --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40251 --- scrapy/trunk/scripts/rpm-install.sh | 11 +++++++++++ scrapy/trunk/setup.cfg | 10 ++++++++++ scrapy/trunk/setup.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 scrapy/trunk/scripts/rpm-install.sh create mode 100644 scrapy/trunk/setup.cfg create mode 100644 scrapy/trunk/setup.py diff --git a/scrapy/trunk/scripts/rpm-install.sh b/scrapy/trunk/scripts/rpm-install.sh new file mode 100644 index 000000000..49d6c7dc6 --- /dev/null +++ b/scrapy/trunk/scripts/rpm-install.sh @@ -0,0 +1,11 @@ +#! /bin/sh +# +# This file becomes the install section of the generated spec file. +# + +# This is what dist.py normally does. +python2.5 setup.py install --root=${RPM_BUILD_ROOT} --record="INSTALLED_FILES" + +cat << EOF >> INSTALLED_FILES +/usr/bin/*.py* +EOF diff --git a/scrapy/trunk/setup.cfg b/scrapy/trunk/setup.cfg new file mode 100644 index 000000000..8bf2da1c3 --- /dev/null +++ b/scrapy/trunk/setup.cfg @@ -0,0 +1,10 @@ +[bdist_rpm] +release = 1 +python = python2.5 +install-script = scripts/rpm-install.sh + +[install] +optimize = 1 + +[aliases] +rpm = bdist_rpm --binary-only clean -a diff --git a/scrapy/trunk/setup.py b/scrapy/trunk/setup.py new file mode 100644 index 000000000..5a3ec75cd --- /dev/null +++ b/scrapy/trunk/setup.py @@ -0,0 +1,29 @@ +from setuptools import setup, find_packages +import os, os.path, glob + +def findfiles(pattern, base='.'): + matches = [] + for root, _, _ in os.walk(base): + matches.extend(glob.glob(os.path.join(root, pattern))) + return matches + + +name = 'scrapy' + +setup ( + name = name, + version = '0.1', + description = '', + long_description = '', + author = '', + author_email = '', + license = '', + url = 'http://scrapy.org', + + packages = [name] + ['%s.%s' % (name,p) for p in find_packages('scrapy')], + package_data = {name: + findfiles('*.tmpl', 'scrapy/templates') + }, + data_files = [], + scripts = ['scrapy/bin/scrapy-admin.py'], +)