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

- scrapy: which provides only the library and scrapy-ctl command
- scrapy-service: which provides the service, upstart script, system user, etc

This allows a clean install of just the library for those which are not
interested in the Scrapy service.

--HG--
rename : debian/scrapy.dirs => debian/scrapy-service.dirs
rename : debian/scrapy.install => debian/scrapy-service.install
rename : debian/scrapy.postinst => debian/scrapy-service.postinst
rename : debian/scrapy.postrm => debian/scrapy-service.postrm
rename : debian/scrapy.upstart => debian/scrapy-service.upstart
rename : debian/conf/service_conf.py => debian/service_conf.py
This commit is contained in:
Pablo Hoffman 2010-07-31 15:50:12 -03:00
parent e145ec686c
commit f6eac8e348
21 changed files with 98 additions and 104 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
scrapy (0.9~r2000-1) unstable; urgency=low
scrapy (0.10) unstable; urgency=low
* Initial release.

View File

@ -1,3 +0,0 @@
# Environment variables to use in Scrapy service
#export PYTHONPATH=/var/lib/scrapy/myproject

15
debian/control vendored
View File

@ -2,17 +2,22 @@ Source: scrapy
Section: python
Priority: optional
Maintainer: Insophia Team <info@insophia.com>
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.

2
debian/copyright vendored
View File

@ -1,4 +1,4 @@
This package was debianized by Insophia <info@insophia.com>.
This package was debianized by the Insophia <info@insophia.com>.
It was downloaded from http://scrapy.org

1
debian/pycompat vendored
View File

@ -1 +0,0 @@
2

2
debian/pyversions vendored
View File

@ -1 +1 @@
2.5-2.6
2.5-

9
debian/rules vendored
View File

@ -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

4
debian/scrapy-service.default vendored Normal file
View File

@ -0,0 +1,4 @@
# Defaults for Scrapy service
export PYTHONPATH=/etc/scrapy
export SCRAPY_SETTINGS_MODULE=service_conf

View File

@ -1,4 +1,2 @@
usr/bin
usr/share/scrapy
var/lib/scrapy
var/log/scrapy

2
debian/scrapy-service.install vendored Normal file
View File

@ -0,0 +1,2 @@
debian/service_conf.py etc/scrapy
extras/scrapy.tac usr/share/scrapy

View File

@ -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

34
debian/scrapy-service.postinst vendored Normal file
View File

@ -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

View File

@ -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

21
debian/scrapy-service.prerm vendored Normal file
View File

@ -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

12
debian/scrapy-service.upstart vendored Normal file
View File

@ -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

View File

@ -1,3 +1 @@
debian/conf/service_conf.py etc/scrapy
debian/conf/environment etc/scrapy
extras/scrapy.tac usr/share/scrapy
debian/tmp/usr

4
debian/scrapy.lintian-overrides vendored Normal file
View File

@ -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

View File

@ -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

17
debian/scrapy.upstart vendored
View File

@ -1,17 +0,0 @@
# Scrapy service
description "Scrapy web crawler"
author "Pablo Hoffman <pablo@pablohoffman.com>"
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

2
debian/watch vendored
View File

@ -1,2 +0,0 @@
version=3
http://scrapy.org/releases/(\d\.\d)/Scrapy-([\d\.]+)\.tar\.gz