Skip to content

Commit

Permalink
Splitted single Debian package into two packages (closes scrapy#187):
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
pablohoffman committed Jul 31, 2010
1 parent e145ec6 commit f6eac8e
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 104 deletions.
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scrapy (0.9~r2000-1) unstable; urgency=low
scrapy (0.10) unstable; urgency=low

* Initial release.

Expand Down
3 changes: 0 additions & 3 deletions debian/conf/environment

This file was deleted.

15 changes: 10 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion debian/pycompat

This file was deleted.

2 changes: 1 addition & 1 deletion debian/pyversions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5-2.6
2.5-
9 changes: 4 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions debian/scrapy-service.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Defaults for Scrapy service

export PYTHONPATH=/etc/scrapy
export SCRAPY_SETTINGS_MODULE=service_conf
2 changes: 0 additions & 2 deletions debian/scrapy.dirs → debian/scrapy-service.dirs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
usr/bin
usr/share/scrapy
var/lib/scrapy
var/log/scrapy
2 changes: 2 additions & 0 deletions debian/scrapy-service.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debian/service_conf.py etc/scrapy
extras/scrapy.tac usr/share/scrapy
2 changes: 2 additions & 0 deletions debian/scrapy-service.lintian-overrides
Original file line number Diff line number Diff line change
@@ -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 changes: 34 additions & 0 deletions debian/scrapy-service.postinst
Original file line number Diff line number Diff line change
@@ -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


4 changes: 1 addition & 3 deletions debian/scrapy.postrm → debian/scrapy-service.postrm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

set -e

if [ purge = "$1" ]; then
Expand All @@ -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
Expand Down
21 changes: 21 additions & 0 deletions debian/scrapy-service.prerm
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions debian/scrapy-service.upstart
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions debian/scrapy.install
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions debian/scrapy.lintian-overrides
Original file line number Diff line number Diff line change
@@ -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
60 changes: 0 additions & 60 deletions debian/scrapy.postinst

This file was deleted.

17 changes: 0 additions & 17 deletions debian/scrapy.upstart

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions debian/watch

This file was deleted.

0 comments on commit f6eac8e

Please sign in to comment.