Skip to content

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

Splitted single Debian package into two packages (closes #187):

Pablo Hoffmanf6eac8e348ef
diff --git a/debian/changelog b/debian/changelog
index b1f6b3d94..a01ddd7bb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-scrapy (0.9~r2000-1) unstable; urgency=low
+scrapy (0.10) unstable; urgency=low
* Initial release.
diff --git a/debian/conf/environment b/debian/conf/environment
deleted file mode 100644
index bea783073..000000000
--- a/debian/conf/environment
+++ /dev/null
@@ -1,3 +0,0 @@
-# Environment variables to use in Scrapy service
-
-#export PYTHONPATH=/var/lib/scrapy/myproject
diff --git a/debian/control b/debian/control
index 54cf6a236..a6a1788c0 100644
--- a/debian/control
+++ b/debian/control
@@ -2,17 +2,22 @@ Source: scrapy
Section: python
Priority: optional
Maintainer: Insophia Team <[email protected]>
-Build-Depends: debhelper (>= 7.0.50), python-twisted
-Build-Depends-Indep: python-support, python, python-sphinx, libjs-jquery
+Build-Depends: debhelper (>= 7.0.50), python (>=2.5), python-twisted
Standards-Version: 3.8.4
Homepage: http://scrapy.org/
Package: scrapy
Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-libxml2, python-twisted, python-openssl
-Provides: ${python:Provides}
-Description: Python web scraping and crawling framework
+Depends: ${python:Depends}, python-libxml2, python-twisted, python-openssl
+Description: Python web crawling and scraping framework
Scrapy is a fast high-level screen scraping and web crawling framework,
used to crawl websites and extract structured data from their pages.
It can be used for a wide range of purposes, from data mining to
monitoring and automated testing.
+
+Package: scrapy-service
+Architecture: all
+Depends: scrapy
+Description: Scrapy Service
+ This package provides support for running Scrapy as a system service,
+ controlled through an upstart script.
diff --git a/debian/copyright b/debian/copyright
index 452544013..71d3765e6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,4 @@
-This package was debianized by Insophia <[email protected]>.
+This package was debianized by the Insophia <[email protected]>.
It was downloaded from http://scrapy.org
diff --git a/debian/pycompat b/debian/pycompat
deleted file mode 100644
index 0cfbf0888..000000000
--- a/debian/pycompat
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/debian/pyversions b/debian/pyversions
index 3ec13be1a..b3dc41ebc 100644
--- a/debian/pyversions
+++ b/debian/pyversions
@@ -1 +1 @@
-2.5-2.6
+2.5-
diff --git a/debian/rules b/debian/rules
index 0e30f3a98..13d85dc9c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,12 @@
#!/usr/bin/make -f
# -*- makefile -*-
-export DH_ALWAYS_EXCLUDE=license.txt:_sources/:.buildinfo
-
%:
dh $@
override_dh_auto_install:
dh_auto_install
- mv $(CURDIR)/debian/scrapy/usr/bin/scrapy-ctl.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-ctl
- mv $(CURDIR)/debian/scrapy/usr/bin/scrapy-ws.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-ws
- mv $(CURDIR)/debian/scrapy/usr/bin/scrapy-sqs.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-sqs
+ mkdir -p $(CURDIR)/debian/scrapy/usr/bin
+ mv $(CURDIR)/debian/tmp/usr/bin/scrapy-ctl.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-ctl
+ mv $(CURDIR)/debian/tmp/usr/bin/scrapy-ws.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-ws
+ mv $(CURDIR)/debian/tmp/usr/bin/scrapy-sqs.py $(CURDIR)/debian/scrapy/usr/bin/scrapy-sqs
diff --git a/debian/scrapy-service.default b/debian/scrapy-service.default
new file mode 100644
index 000000000..59852048d
--- /dev/null
+++ b/debian/scrapy-service.default
@@ -0,0 +1,4 @@
+# Defaults for Scrapy service
+
+export PYTHONPATH=/etc/scrapy
+export SCRAPY_SETTINGS_MODULE=service_conf
diff --git a/debian/scrapy.dirs b/debian/scrapy-service.dirs
similarity index 54%
rename from debian/scrapy.dirs
rename to debian/scrapy-service.dirs
index b3c079630..a9eaa09f0 100644
--- a/debian/scrapy.dirs
+++ b/debian/scrapy-service.dirs
@@ -1,4 +1,2 @@
-usr/bin
-usr/share/scrapy
var/lib/scrapy
var/log/scrapy
diff --git a/debian/scrapy-service.install b/debian/scrapy-service.install
new file mode 100644
index 000000000..7ee823edc
--- /dev/null
+++ b/debian/scrapy-service.install
@@ -0,0 +1,2 @@
+debian/service_conf.py etc/scrapy
+extras/scrapy.tac usr/share/scrapy
diff --git a/debian/scrapy-service.lintian-overrides b/debian/scrapy-service.lintian-overrides
new file mode 100644
index 000000000..48868e9a7
--- /dev/null
+++ b/debian/scrapy-service.lintian-overrides
@@ -0,0 +1,2 @@
+new-package-should-close-itp-bug
+script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/scrapy-service
diff --git a/debian/scrapy-service.postinst b/debian/scrapy-service.postinst
new file mode 100644
index 000000000..9dc708fff
--- /dev/null
+++ b/debian/scrapy-service.postinst
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure)
+ # Create user to run the service as
+ if [ -z "`id -u scrapy 2> /dev/null`" ]; then
+ adduser --system --home /var/lib/scrapy --gecos "scrapy" \
+ --no-create-home --disabled-password \
+ --quiet scrapy || true
+ fi
+ if [ ! -d /var/run/scrapy ]; then
+ mkdir /var/run/scrapy
+ chown scrapy:nogroup /var/run/scrapy
+ fi
+
+ chown scrapy:nogroup /var/log/scrapy /var/lib/scrapy /var/run/scrapy
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/scrapy.postrm b/debian/scrapy-service.postrm
similarity index 74%
rename from debian/scrapy.postrm
rename to debian/scrapy-service.postrm
index b6a3bf880..b16d0c2b6 100644
--- a/debian/scrapy.postrm
+++ b/debian/scrapy-service.postrm
@@ -1,4 +1,5 @@
#!/bin/sh
+
set -e
if [ purge = "$1" ]; then
@@ -10,9 +11,6 @@ if [ purge = "$1" ]; then
rm -rf /var/run/scrapy
fi
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
#DEBHELPER#
exit 0
diff --git a/debian/scrapy-service.prerm b/debian/scrapy-service.prerm
new file mode 100644
index 000000000..96ba07ea3
--- /dev/null
+++ b/debian/scrapy-service.prerm
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ rm -f /etc/scrapy-service/service_conf.pyc
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/scrapy-service.upstart b/debian/scrapy-service.upstart
new file mode 100644
index 000000000..8e7d33c6a
--- /dev/null
+++ b/debian/scrapy-service.upstart
@@ -0,0 +1,12 @@
+# Scrapy service
+
+start on runlevel [2345]
+stop on runlevel [06]
+
+script
+ [ -r /etc/default/scrapy-service ] && . /etc/default/scrapy-service
+ exec twistd -ny /usr/share/scrapy/scrapy.tac \
+ -u scrapy -g nogroup \
+ -l /var/log/scrapy/service.log \
+ --pidfile /var/run/scrapy/scrapy.pid
+end script
diff --git a/debian/scrapy.install b/debian/scrapy.install
index 7bbeab3c5..856338403 100644
--- a/debian/scrapy.install
+++ b/debian/scrapy.install
@@ -1,3 +1 @@
-debian/conf/service_conf.py etc/scrapy
-debian/conf/environment etc/scrapy
-extras/scrapy.tac usr/share/scrapy
+debian/tmp/usr
diff --git a/debian/scrapy.lintian-overrides b/debian/scrapy.lintian-overrides
new file mode 100644
index 000000000..e22020de1
--- /dev/null
+++ b/debian/scrapy.lintian-overrides
@@ -0,0 +1,4 @@
+new-package-should-close-itp-bug
+binary-without-manpage usr/bin/scrapy-sqs
+binary-without-manpage usr/bin/scrapy-ws
+extra-license-file usr/share/pyshared/scrapy/xlib/pydispatch/license.txt
diff --git a/debian/scrapy.postinst b/debian/scrapy.postinst
deleted file mode 100644
index cbc63b20c..000000000
--- a/debian/scrapy.postinst
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-# postinst script for scrapy
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-case "$1" in
- configure)
- # Fix for old packages not managing pyc files
- for d in /usr/lib/python*/site-packages/scrapy ; do
- if [ -d "$d" ] ; then
- echo "Removing old python byte-compiled files in $d"
- rm -rf "$d"
- fi
- done
-
- # Create user to run the service as
- if [ -z "`id -u scrapy 2> /dev/null`" ]; then
- adduser --system --home /var/lib/scrapy --gecos "scrapy" \
- --no-create-home --disabled-password \
- --quiet scrapy || true
- fi
- if [ ! -d /var/run/scrapy ]; then
- mkdir /var/run/scrapy
- chown scrapy:nogroup /var/run/scrapy
- fi
-
- chown scrapy:nogroup /var/log/scrapy /var/lib/scrapy /var/run/scrapy
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/debian/scrapy.upstart b/debian/scrapy.upstart
deleted file mode 100644
index c4cf6f0f4..000000000
--- a/debian/scrapy.upstart
+++ /dev/null
@@ -1,17 +0,0 @@
-# Scrapy service
-
-description "Scrapy web crawler"
-author "Pablo Hoffman <[email protected]>"
-
-start on runlevel [2345]
-stop on runlevel [!2345]
-
-script
- [ -r /etc/scrapy/environment ] && . /etc/scrapy/environment
- export PYTHONPATH=/etc/scrapy:$PYTHONPATH
- export SCRAPY_SETTINGS_MODULE=service_conf
- exec twistd -ny /usr/share/scrapy/scrapy.tac \
- -u scrapy -g nogroup \
- -l /var/log/scrapy/service.log \
- --pidfile /var/run/scrapy/scrapy.pid
-end script
diff --git a/debian/conf/service_conf.py b/debian/service_conf.py
similarity index 100%
rename from debian/conf/service_conf.py
rename to debian/service_conf.py
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index a62198e8b..000000000
--- a/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://scrapy.org/releases/(\d\.\d)/Scrapy-([\d\.]+)\.tar\.gz