From 133f0c6dd58f6ea2c0c329c6fb3c59728be713e6 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Mon, 29 Jul 2013 15:59:57 -0300 Subject: [PATCH] Updating installation process --- MANIFEST.in | 5 ----- README.md | 2 -- requirements.txt | 3 +++ setup.py | 51 --------------------------------------------------- setupext/__init__.py | 15 --------------- setupext/install_data.py | 197 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- update-deploy.sh | 23 +++++++++++------------ 7 files changed, 14 insertions(+), 282 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 README.md delete mode 100755 setup.py delete mode 100755 setupext/__init__.py delete mode 100755 setupext/install_data.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index faf4ba0..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include colab/templates/*.html -include colab/super_archives/templates/*.html -include colab/super_archives/fixtures/initial_data.json -recursive-include etc * -recursive-include colab/static * \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 26bffb9..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -colab -===== diff --git a/requirements.txt b/requirements.txt index 8a6db67..687c462 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,13 @@ https://www.djangoproject.com/download/1.6b1/tarball/ South==0.8.1 +psycopg2==2.5.1 django-piston==0.2.3 pytz==2011n chardet==1.0.1 python-dateutil==1.5 django-cliauth==0.9 + +# Feedzilla (planet) and deps https://bitbucket.org/seocam/feedzilla/get/tip.tar.gz # Temporarily work around django-common django-tagging diff --git a/setup.py b/setup.py deleted file mode 100755 index ec796aa..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup, find_packages -from setupext import Data_Files, install_Data_Files - -setup(name='colab', - version='3.0', - description = 'Colab, a Software for Communities', - author='Sergio Oliveira', - author_email='seocam@seocam.com', - url='https://bitbucket.org/seocam/atu-colab', - license = "GPL 2", - packages=find_packages(), - package_data={'colab': ['templates/*.html', - 'super_archives/templates/*.html', - 'super_archives/fixtures/initial_data.json']}, - data_files=[ - Data_Files(base_dir='install_data', - copy_to='static', - template=['recursive-include colab/static *'], - preserve_path=1, - strip_dirs=2), - Data_Files(base_dir='install_data', - copy_to='wsgi', - template=['include etc/apache2/wsgi/colab.wsgi'], - preserve_path=0), - Data_Files(base_dir='install_data', - copy_to='apache-site', - template=['include etc/apache2/sites-available/colab'], - preserve_path=0), - Data_Files(base_dir='install_data', - copy_to='autofs', - template=['include etc/autofs/listas'], - preserve_path=0), - Data_Files(base_dir='install_data', - copy_to='cron.d', - template=['include etc/cron.d/*'], - preserve_path=0), - ], - install_requires=( - 'distribute', - 'Django==1.3.1', - 'South==0.7.3', - 'django-piston==0.2.3', - 'django-cliauth==0.9', - 'pytz==2011n', - 'chardet==1.0.1', - 'python-dateutil==1.5', - 'psycopg2==2.4.4'), - cmdclass = {"install_data": install_Data_Files}, -) diff --git a/setupext/__init__.py b/setupext/__init__.py deleted file mode 100755 index 5334452..0000000 --- a/setupext/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -"Package providing extensions to the standard distutils" - -from install_data import Data_Files, install_Data_Files - -from distutils.command.bdist_wininst import bdist_wininst - -# When building a windows installer, put some more text into -# the long description -class wininst_request_delete(bdist_wininst): - add_text = "\nIf you have installed earlier versions of this package, please remove them through 'Add/Remove Programs' before installing this release." - - def get_inidata(self): - m = self.distribution.metadata - m.long_description = m.long_description + self.add_text - return bdist_wininst.get_inidata(self) diff --git a/setupext/install_data.py b/setupext/install_data.py deleted file mode 100755 index 9774531..0000000 --- a/setupext/install_data.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -"""install_data.py - -Provides a more sophisticated facility to install data files -than distutils' install_data does. -You can specify your files as a template like in MANIFEST.in -and you have more control over the copy process. - -Copyright 2000 by Rene Liebscher, Germany. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -""" - -# created 2000/08/01, Rene Liebscher -# modified 2000/12/18, Martin v. Löwis - -########################################################################### -# import some modules we need - -import os,sys,string -from types import StringType,TupleType,ListType -from distutils.util import change_root -from distutils.filelist import FileList -from distutils.command.install_data import install_data - -########################################################################### -# a container class for our more sophisticated install mechanism - -class Data_Files: - """ container for list of data files. - supports alternate base_dirs e.g. 'install_lib','install_header',... - supports a directory where to copy files - supports templates as in MANIFEST.in - supports preserving of paths in filenames - eg. foo/xyz is copied to base_dir/foo/xyz - supports stripping of leading dirs of source paths - eg. foo/bar1/xyz, foo/bar2/abc can be copied to bar1/xyz, bar2/abc - """ - - def __init__(self,base_dir=None,files=None,copy_to=None,template=None,preserve_path=0,strip_dirs=0): - self.base_dir = base_dir - self.files = files - self.copy_to = copy_to - if template is not None: - t = [] - for item in template: - item = string.strip(item) - if not item:continue - t.append(item) - template = t - self.template = template - self.preserve_path = preserve_path - self.strip_dirs = strip_dirs - self.finalized = 0 - - def warn (self, msg): - sys.stderr.write ("warning: %s: %s\n" % - ("install_data", msg)) - - def debug_print (self, msg): - """Print 'msg' to stdout if the global DEBUG (taken from the - DISTUTILS_DEBUG environment variable) flag is true. - """ - from distutils.core import DEBUG - if DEBUG: - print msg - - - def finalize(self): - """ complete the files list by processing the given template """ - if self.finalized: - return - if self.files == None: - self.files = [] - if self.template != None: - if type(self.template) == StringType: - self.template = string.split(self.template,";") - filelist = FileList(self.warn,self.debug_print) - for line in self.template: - filelist.process_template_line(string.strip(line)) - filelist.sort() - filelist.remove_duplicates() - self.files.extend(filelist.files) - self.finalized = 1 - -# end class Data_Files - -########################################################################### -# a more sophisticated install routine than distutils install_data - -class install_Data_Files (install_data): - - def check_data(self,d): - """ check if data are in new format, if not create a suitable object. - returns finalized data object - """ - if not isinstance(d, Data_Files): - self.warn(("old-style data files list found " - "-- please convert to Data_Files instance")) - if type(d) is TupleType: - if len(d) != 2 or not (type(d[1]) is ListType): - raise DistutilsSetupError, \ - ("each element of 'data_files' option must be an " - "Data File instance, a string or 2-tuple (string,[strings])") - d = Data_Files(copy_to=d[0],files=d[1]) - else: - if not (type(d) is StringType): - raise DistutilsSetupError, \ - ("each element of 'data_files' option must be an " - "Data File instance, a string or 2-tuple (string,[strings])") - d = Data_Files(files=[d]) - d.finalize() - return d - - def run(self): - self.outfiles = [] - install_cmd = self.get_finalized_command('install') - - for d in self.data_files: - d = self.check_data(d) - - install_dir = self.install_dir - # alternative base dir given => overwrite install_dir - if d.base_dir != None: - install_dir = getattr(install_cmd,d.base_dir) - - # copy to an other directory - if d.copy_to != None: - if not os.path.isabs(d.copy_to): - # relatiev path to install_dir - dir = os.path.join(install_dir, d.copy_to) - elif install_cmd.root: - # absolute path and alternative root set - dir = change_root(self.root,d.copy_to) - else: - # absolute path - dir = d.copy_to - else: - # simply copy to install_dir - dir = install_dir - # warn if necceassary - self.warn("setup script did not provide a directory to copy files to " - " -- installing right in '%s'" % install_dir) - - dir=os.path.normpath(dir) - # create path - self.mkpath(dir) - - # copy all files - for src in d.files: - if d.strip_dirs > 0: - dst = string.join(string.split(os.path.normcase(src),os.sep)[d.strip_dirs:],os.sep) - else: - dst = src - if d.preserve_path: - # preserve path in filename - self.mkpath(os.path.dirname(os.path.join(dir,dst))) - out = self.copy_file(src, os.path.join(dir,dst)) - else: - out = self.copy_file(src, dir) - if type(out) is TupleType: - out = out[0] - self.outfiles.append(out) - - return self.outfiles - - def get_inputs (self): - inputs = [] - for d in self.data_files: - d = self.check_data(d) - inputs.append(d.files) - return inputs - - def get_outputs (self): - return self.outfiles - - -########################################################################### - diff --git a/update-deploy.sh b/update-deploy.sh index 45551fc..0830961 100755 --- a/update-deploy.sh +++ b/update-deploy.sh @@ -1,19 +1,18 @@ #!/bin/bash -cd /usr/local/src/colab/ -hg pull -hg up -rm -fR dist/ -python setup.py sdist +apt-get install apache2 libapache2-mod-wsgi +apt-get install libxml2-dev libxslt1-dev # lxml +apt-get install libpq-dev # psycopg2 + +cd /usr/local/src/colab2/ +git pull if [[ $1 == 'deps' ]] ; then # com dependencias - /usr/local/django/colab/bin/pip install dist/*.gz -U -else - # sem dependencias - /usr/local/django/colab/bin/pip install dist/*.gz -U --no-deps + + /usr/local/django/colab2/bin/pip install -r /usr/local/src/colab2/requirements.txt -U fi -/usr/local/django/colab/bin/python colab/manage.py syncdb -/usr/local/django/colab/bin/python colab/manage.py migrate -touch /usr/local/django/colab/wsgi/colab.wsgi +/usr/local/django/colab2/bin/python src/manage.py syncdb +/usr/local/django/colab2/bin/python src/manage.py migrate +touch src/colab/wsgi.py -- libgit2 0.21.2