Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

in the way of setuptooling

eduardoa85e53053dad
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'],
+)