@@ -0,0 +1,2636 @@
+#!/usr/bin/python%0A%0A'''%0ACopyright(c)2009 Internet Archive. Software license AGPL version 3.%0A%0AThis file is part of IA Bookserver.%0A%0A    IA Bookserver is free software: you can redistribute it and/or modify%0A    it under the terms of the GNU Affero General Public License as published by%0A    the Free Software Foundation, either version 3 of the License, or%0A    (at your option) any later version.%0A%0A    IA Bookserver is distributed in the hope that it will be useful,%0A    but WITHOUT ANY WARRANTY; without even the implied warranty of%0A    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A    GNU Affero General Public License for more details.%0A%0A    You should have received a copy of the GNU Affero General Public License%0A    along with IA Bookserver.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A    %0A'''    %0A%0A'''%0AThis script downloads, installs, and configures the OPDS crawler.%0A'''%0A%0Aimport commands%0Aimport os%0A%0Acrawler_dir = '/crawler'%0Awarc_dir    = crawler_dir + '/data'%0A%0Adef cmd(description, command):%0A    print description%0A    (ret, out) = commands.getstatusoutput(command)%0A    print out%0A    assert 0 == ret%0A    %0A%0Aprint 'installing build-essential, swig, and svn'%0A(ret, out) = commands.getstatusoutput(%22%22%22DEBIAN_FRONTEND=noninteractive apt-get --force-yes -qq install build-essential subversion swig1.3%22%22%22)%0Aprint out%0Aassert 0 == ret%0A%0Aprint 'installing warc-tools'%0Aif not os.path.exists('/tmp/warc-tools'):%0A    (ret, out) = commands.getstatusoutput('svn checkout http://warc-tools.googlecode.com/svn/trunk/ /tmp/warc-tools')%0A    print out%0A    assert 0==ret%0A%0Aprint 'patching warc-tools makefile'%0A(ret, out) = commands.getstatusoutput(%22%22%22wget -q -O /tmp/warc-tools/makefile 'http://home.us.archive.org/~rkumar/git/gitweb.cgi?p=bookserver/.git;a=blob_plain;f=aggregator/install/warc-tools-makefile-64bit'%22%22%22);%0Aprint out%0Aassert 0==ret%0A    %0Aprint 'building and installing warc-tools'%0A(ret, out) = commands.getstatusoutput(%22%22%22make -C /tmp/warc-tools install%22%22%22);%0Aprint out%0Aassert 0==ret%0A%0Aprint 'installing python-feedparser, python-lxml, python-simplejson, and curl'%0A(ret, out) = commands.getstatusoutput(%22%22%22DEBIAN_FRONTEND=noninteractive apt-get --force-yes -qq install python-feedparser python-lxml python-simplejson curl%22%22%22)%0Aprint out%0Aassert 0==ret%0A%0Acmd('installing greenlet', %22%22%22DEBIAN_FRONTEND=noninteractive apt-get --force-yes -qq install python-codespeak-lib%22%22%22)%0A%0Acmd('installing eventlet', 'easy_install eventlet')%0A%0Acmd('installing python-xml', 'DEBIAN_FRONTEND=noninteractive apt-get --force-yes -qq install python-xml')%0A%0Aif not os.path.exists(warc_dir):%0A    print 'making warc_dir ' + warc_dir%0A    os.makedirs(warc_dir)

add install script for OPDS crawler.