Commits

Kirill Simonov committed d6c524c

Ported development tools to `cogs`.

  • Participants
  • Parent commits 7b2fcdc

Comments (0)

Files changed (118)

 .*.sw?
 *.egg-info
 *.env
+*.conf
 *.sqlite
 build
 vm-build

File cogs.conf.sample

+#
+# Configuration parameters used by various development tasks.
+# Copy `cogs.conf.sample` to `cogs.conf` and make your edits.
+#
+
+
+#
+# Paths to executables.
+#
+
+#python: python
+#sphinx-build: sphinx-build
+#pyflakes: pyflakes
+#coverage: coverage
+#htsql-ctl: htsql-ctl
+
+
+#
+# The address of the demo HTSQL/HTTP server started by `cogs serve`.
+#
+
+#htsql-host: localhost
+#htsql-port: 8080
+
+
+#
+# Database servers for regression testing.  The database user must
+# have the right to create and drop users and databases.
+#
+
+#pgsql-username: postgres
+#pgsql-password:
+#pgsql-host: localhost
+#pgsql-port: 5432
+
+#mysql-username: root
+#mysql-password:
+#mysql-host: localhost
+#mysql-port: 3306
+
+#oracle-username: system
+#oracle-password:
+#oracle-host: localhost
+#oracle-port: 1521
+#oracle-sid: XE
+
+#mssql-username: sa
+#mssql-password:
+#mssql-host: localhost
+#mssql-port: 1433
+
+
+#
+# ISO images for VM.
+#
+
+#debian-iso: ./debian-6.0.3-i386-netinst.iso
+#ubuntu-iso: ./ubuntu-12.04.1-server-i386.iso
+#centos-iso: ./CentOS-6.0-i386-minimal.iso
+#windows-iso: ./en_win_srv_2003_r2_standard_with_sp2_cd1_x13-04790.iso
+#windows-key: '#####-#####-#####-#####-#####'
+
+
+# vim: set syntax=yaml:

File cogs.local/__init__.py

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+
+# Register all tasks and settings.
+import check, dist, pkg, test, vm
+
+

File cogs.local/check.py

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+
+from cogs import task
+from cogs.fs import sh
+from cogs.log import log, debug, warn, fail
+from .vm import LinuxBenchVM, WindowsBenchVM, CTL_DIR
+import sys
+import subprocess
+
+
+py26_vm = LinuxBenchVM('py26', 'debian', 22)
+py27_vm = LinuxBenchVM('py27', 'debian', 22)
+pgsql84_vm = LinuxBenchVM('pgsql84', 'debian', 5432)
+pgsql90_vm = LinuxBenchVM('pgsql90', 'debian', 5432)
+pgsql91_vm = LinuxBenchVM('pgsql91', 'debian', 5432)
+mysql51_vm = LinuxBenchVM('mysql51', 'debian', 3306)
+oracle10g_vm = LinuxBenchVM('oracle10g', 'debian', 1521)
+mssql2005_vm = WindowsBenchVM('mssql2005', 'windows', 1433)
+mssql2008_vm = WindowsBenchVM('mssql2008', 'windows', 1433)
+
+
+def trial(command, description):
+    # Run a command on VM; complain if exited with non-zero error code.
+    log("{}...", description)
+    command = "ssh -F %s linux-vm \"cd src/htsql && %s\"" \
+              % (CTL_DIR+"/ssh_config", command)
+    stream = subprocess.PIPE
+    debug("trying: {}", command)
+    proc = subprocess.Popen(command, shell=True,
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.STDOUT)
+    out, err = proc.communicate()
+    if proc.returncode == 0:
+        log("{}: PASSED", description)
+        return 0
+    out = out.strip()
+    log("{}: :warning:`FAILED!`", description)
+    log("*"*72)
+    sys.stdout.write(out+"\n")
+    log("*"*72)
+    return 1
+
+
+@task
+def CHECK_ALL():
+    """run regression tests for all supported backends
+
+    This task runs HTSQL regression tests on all combinations of client
+    and server platforms.
+    """
+    vms = [py26_vm, py27_vm, pgsql84_vm, pgsql90_vm, pgsql91_vm,
+           mysql51_vm, oracle10g_vm, mssql2005_vm, mssql2008_vm]
+    for vm in vms:
+        if vm.missing():
+            warn("VM is not built: {}", vm.name)
+    for vm in vms:
+        if vm.running():
+            vm.stop()
+    errors = 0
+    try:
+        for client_vm in [py26_vm, py27_vm]:
+            if client_vm.missing():
+                continue
+            client_vm.start()
+            sh("hg clone --ssh='ssh -F %s' . ssh://linux-vm/src/htsql"
+               % (CTL_DIR+"/ssh_config"))
+            errors += trial("hg update && python setup.py install",
+                            "installing HTSQL under %s" % client_vm.name)
+            errors += trial("htsql-ctl regress -qi test/regress.yaml sqlite",
+                            "testing sqlite backend")
+            for server_vm, suite in [(pgsql84_vm, 'pgsql'),
+                                     (pgsql90_vm, 'pgsql'),
+                                     (pgsql91_vm, 'pgsql'),
+                                     (mysql51_vm, 'mysql'),
+                                     (oracle10g_vm, 'oracle'),
+                                     (mssql2005_vm, 'mssql'),
+                                     (mssql2008_vm, 'mssql')]:
+                if server_vm.missing():
+                    continue
+                server_vm.start()
+                username_key = "%s_USERNAME" % suite.upper()
+                password_key = "%s_PASSWORD" % suite.upper()
+                host_key = "%s_HOST" % suite.upper()
+                port_key = "%s_PORT" % suite.upper()
+                username_value = { 'pgsql': "postgres",
+                                   'mysql': "root",
+                                   'oracle': "system",
+                                   'mssql': "sa" }[suite]
+                password_value = "admin"
+                host_value = "10.0.2.2"
+                port_value = 10000+server_vm.port
+                command = "%s=%s %s=%s %s=%s %s=%s" \
+                          " htsql-ctl regress -qi test/regress.yaml %s" \
+                          % (username_key, username_value,
+                             password_key, password_value,
+                             host_key, host_value, port_key, port_value,
+                             suite)
+                message = "testing %s backend against %s" \
+                          % (suite, server_vm.name)
+                errors += trial(command, message)
+                server_vm.stop()
+            errors += trial("htsql-ctl regress -qi test/regress.yaml routine",
+                            "testing htsql-ctl routines")
+            client_vm.stop()
+    except:
+        for vm in vms:
+            if vm.running():
+                vm.stop()
+        raise
+    log()
+    if errors:
+        if errors == 1:
+            warn("1 failed test")
+        else:
+            warn("{} failed tests", errors)
+    else:
+        log("`All tests passed`")
+
+

File cogs.local/data/pkg/debian/changelog

+htsql (2.3.3-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Kirill Simonov <xi@resolvent.net>  Fri, 01 Feb 2013 00:22:42 -0600
+
+htsql (2.3.2-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Kirill Simonov <xi@resolvent.net>  Thu, 23 Aug 2012 19:19:56 -0500
+
+htsql (2.3.1-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Kirill Simonov <xi@resolvent.net>  Thu, 28 Jun 2012 10:10:40 -0500
+
+htsql (2.3.0-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Clark C. Evans <cce@cantor>  Tue, 06 Mar 2012 11:53:26 -0500
+
+htsql (2.2.1-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Clark C. Evans <cce@clarkevans.com>  Thu, 15 Dec 2011 15:00:00 -0500
+
+htsql (2.2.0~c1-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Kirill Simonov <xi@resolvent.net>  Mon, 21 Nov 2011 22:11:02 -0500
+
+htsql (2.2.0~b2-1) unstable; urgency=low
+
+  * initial .deb distribution based on 9/22 release
+
+ -- Clark C. Evans <cce@clarkevans.com>  Mon, 19 Oct 2011 15:00:00 -0500

File cogs.local/data/pkg/debian/compat

+7

File cogs.local/data/pkg/debian/control

+Source: ${NAME}
+Section: database
+Priority: optional
+Maintainer: Clark C. Evans <cce@clarkevans.com>
+Build-Depends: python-all, debhelper (>= 7.4.3), python-setuptools (>= 0.6b3)
+Homepage: http://htsql.org/
+Vcs-Browser: https://bitbucket.org/prometheus/htsql/
+Standards-Version: 3.9.2
+X-Python-Version: >= 2.6
+
+Package: ${NAME}
+Architecture: all
+Depends: ${DEPENDS}
+Suggests: ${SUGGESTS}
+Description: ${DESCRIPTION_HEAD}
+ HTSQL is a comprehensive navigational query language for relational
+ databases.  HTSQL is designed for data analysts and other accidental
+ programmers who have complex business inquiries to solve and need a
+ productive tool to write and share database queries.  HTSQL is free
+ and open source software.  For more detail, visit http://htsql.org/.
+ .
+ ${DESCRIPTION_TAIL}
+

File cogs.local/data/pkg/debian/copyright

+Format: http://dep.debian.net/deps/dep5
+Upstream-Name: ${SOURCE_NAME}
+Source: http://pypi.python.org/pypi/${SOURCE_NAME}/
+
+Files: *
+Copyright: Copyright (c) 2006-2013, Prometheus Research, LLC
+License: AGPL-3 with 7b attribution and GPL-2 exception
+ This program is free software: you can use, redistribute, and/or modify
+ it under the terms of the GNU Affero General Public License, version 3
+ ("AGPL"), as published by the Free Software Foundation, and as
+ supplemented by additional terms according to section 7 of the AGPL:
+ .
+ This Program was created by members and contributors to the HTSQL
+ Project (http://htsql.org).  As permitted by section 7b of the AGPL,
+ we require preservation of copyright notices and author attributions
+ in this Program's documentation and Appropriate Legal Notices.  This
+ Program displays such notices in its "htsql-ctl version" command line
+ option, and also in its "About HTSQL" dialog box.  In the graphical
+ display of these notices, author attributions include "Powered By"
+ logos for HTSQL and for other software projects.
+ .
+ For works containing this Program or any covered work, each interactive
+ user interface must include a prominent and conveniently accessible
+ feature for the display of Appropriate Legal Notices.  This display
+ must include author attributions and copyright notices as found in this
+ Program.  This display of these author attributions must be convenient
+ for a user wishing to browse credits, shown in a manner separate and
+ distinct from license texts, and commensurately prominent with respect
+ to other author attributions.  To the extent that it is technically
+ feasible and not obtrusive, the graphical form of these author
+ attributions, such as a "Powered By" logo, must be preserved;
+ otherwise, a textual equivalent is permitted.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+ .
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ .
+ Additional permissions, which may be removed at your option, under
+ GNU AGPL version 3 section 7:
+ .
+ If you modify this Program, or any covered work, by linking or combining
+ it with parts that are otherwise independent works covered by the terms
+ of GNU GPL version 2, the licensors of this Program grant you additional
+ permission to convey the entire combined work containing those parts.
+

File cogs.local/data/pkg/debian/docs

+README
+LICENSE
+NEWS
+AUTHORS

File cogs.local/data/pkg/debian/htsql.doc-base

+Document: htsql
+Title: HTSQL Documentation
+Author: Clark C. Evans & Kirill Siminov
+Abstract: Overview, tutorial, reference, and other guides for
+ the HTSQL language and implementation.
+Section: Data Management
+
+Format: HTML
+Index: /usr/share/doc/htsql/doc/html/index.html
+Files: /usr/share/doc/htsql/doc/

File cogs.local/data/pkg/debian/htsql.docs

+README
+LICENSE
+NEWS
+AUTHORS
+doc/

File cogs.local/data/pkg/debian/htsql.manpages

+doc/man/htsql-ctl.1

File cogs.local/data/pkg/debian/moves.yaml

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+---
+code:
+files:
+  debian/changelog: changelog
+  debian/compat: compat
+  debian/control: control
+  debian/copyright: copyright
+  debian/docs: docs
+  debian/rules: rules
+  debian/source/format: source/format
+variables:
+  name:
+  source-name:
+  depends:
+  suggests:
+  description-head:
+  description-tail:
+
+---
+code: htsql
+files:
+  debian/docs: htsql.docs
+  debian/htsql.doc-base: htsql.doc-base
+  debian/manpages: htsql.manpages
+variables:
+  name: htsql
+  source-name: HTSQL
+  depends: python (>=2.6), python-yaml, python-pkg-resources, ${misc:Depends}
+  suggests: htsql-pgsql, htsql-mysql
+  description-head:
+    a database query language (core & SQLite backend)
+  description-tail:
+    This package provides HTSQL core and SQLite backend.
+
+---
+code: htsql-pgsql
+variables:
+  name: htsql-pgsql
+  source-name: HTSQL-PGSQL
+  depends: htsql, python-psycopg2
+  description-head:
+    a database query language (PostgreSQL backend)
+  description-tail:
+    This package provides HTSQL backend for PostgreSQL.
+
+---
+code: htsql-mysql
+variables:
+  name: htsql-mysql
+  source-name: HTSQL-MYSQL
+  depends: htsql, python-mysqldb
+  description-head:
+    a database query language (MySQL backend)
+  description-tail:
+    This package provides HTSQL backend for MySQL.
+

File cogs.local/data/pkg/debian/rules

+#!/usr/bin/make -f
+#export DH_VERBOSE=1
+
+%:
+	dh $@ --with python2 --buildsystem=python_distutils
+
+

File cogs.local/data/pkg/debian/source/format

+3.0 (quilt)

File cogs.local/data/pkg/redhat/.rpmmacros

+%_signature gpg
+%_gpg_name build@htsql.org
+%_gpg_path $HOME/.gnupg

File cogs.local/data/pkg/redhat/HTSQL.spec

+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+Name:           ${NAME}
+Version:        ${VERSION}
+Release:        1%{?dist}
+Summary:        ${SUMMARY}
+
+Group:          Application/Databases
+License:        AGPLv3 with 7b attribution and GPLv2 exception
+URL:            http://htsql.org/
+Source:         ${PACKAGE}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Prefix:         %{_prefix}
+
+BuildArch:      noarch
+Vendor:         Prometheus Research, LLC
+BuildRequires:  python-devel, python-setuptools
+Requires:       ${REQUIRES}
+
+%description
+HTSQL is a comprehensive navigational query language for relational
+databases.  HTSQL is designed for data analysts and other accidental
+programmers who have complex business inquiries to solve and need a
+productive tool to write and share database queries.  HTSQL is free
+and open source software.  For more detail, visit http://htsql.org/.
+
+${DESCRIPTION}
+
+%prep
+%setup -q -n ${PACKAGE}
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc ${DOC_FILES}
+${FILES}
+# For noarch packages: sitelib
+%{python_sitelib}/*
+
+%changelog
+* Fri Feb 01 2013 Kirill Simonov <xi@resolvent.net> - 2.3.3-1
+- Upstream release
+* Thu Aug 23 2012 Kirill Simonov <xi@resolvent.net> - 2.3.2-1
+- Upstream release
+* Thu Jun 28 2012 Kirill Simonov <xi@resolvent.net> - 2.3.1-1
+- Upstream release
+* Tue Mar 06 2012 Clark C. Evans <cce@clarkevans.com> - 2.3.0-1
+- Upstream release
+* Thu Dec 15 2011 Clark C. Evans <cce@clarkevans.com> - 2.2.1-1
+- Upstream release
+* Tue Nov 22 2011 Clark C. Evans <cce@clarkevans.com> - 2.2.0c1-1
+- Upstream release
+* Fri Nov 11 2011 Clark C. Evans <cce@clarkevans.com> - 2.2.0b2-1
+- Initial packaging

File cogs.local/data/pkg/redhat/moves.yaml

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+---
+code:
+files:
+  BUILD/:
+  RPMS/:
+  SOURCES/:
+  SPECS/:
+  SRPMS/:
+variables:
+  name:
+  version: # set by the build script
+  package: # set by the build script
+  requires:
+  summary:
+  description:
+  doc-files:
+  files:
+
+---
+code: htsql
+files:
+  SPECS/HTSQL.spec: HTSQL.spec
+variables:
+  name: HTSQL
+  requires: PyYAML, python-setuptools
+  summary:
+    a database query language (core & SQLite backend)
+  description:
+    This package provides HTSQL core and SQLite backend.
+  doc-files: README LICENSE NEWS AUTHORS doc
+  files: /usr/bin/htsql-ctl
+
+---
+code: htsql-pgsql
+files:
+  SPECS/HTSQL-PGSQL.spec: HTSQL.spec
+variables:
+  name: HTSQL-PGSQL
+  requires: HTSQL, python-psycopg2
+  summary:
+    a database query language (PostgreSQL backend)
+  description:
+    This package provides HTSQL backend for PostgreSQL.
+  doc-files: README LICENSE NEWS AUTHORS
+
+---
+code: htsql-mysql
+files:
+  SPECS/HTSQL-MYSQL.spec: HTSQL.spec
+variables:
+  name: HTSQL-MYSQL
+  requires: HTSQL, MySQL-python
+  summary:
+    a database query language (MySQL backend)
+  description:
+    This package provides HTSQL backend for MySQL.
+  doc-files: README LICENSE NEWS AUTHORS
+

File cogs.local/data/pkg/source/LICENSE-ALL

+HTSQL and its adapters for open source database systems are released under
+a Free Software, Permissive, and Evaluation licenses.  You may distribute
+HTSQL under your choice of these licenses, so long as you respect the
+licenses of other works it may be distributed and/or used in conjunction
+with.  For more information, please see http://htsql.org/license/. 
+

File cogs.local/data/pkg/source/LICENSE-EVALUATION

+HTSQL Evaluation License
+========================
+
+Copyright (c) 2006-2013 Prometheus Research, LLC.
+All rights reserved.
+
+This license is meant for the express purpose of permitting public
+evaluation (but not commercial use) of proprietary database adapters.
+By distributing, installing, modifying, or using this software you
+agree to be bound to the terms of this agreement.
+
+Limited redistribution and use, as well as the creation of Derivative
+Works, are permitted provided that the following conditions are met:
+
+1. The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of this software.
+
+2. You may only use this software for evaluation purposes, which are
+limited to: the discovery of how HTSQL works, testing of function or
+performance, the creation of prototype applications used for
+demonstrations, and communicating bug reports and/or feature requests.
+
+3. You may not use or distribute this software, or any Derivative
+Work, in any form for commercial purposes.  Examples of commercial
+purposes would be running business operations, licensing, leasing,
+or selling this software, or distributing this software for use
+with commercial products or services.
+
+4. You may distribute this software or Derivative Works, provided
+that such copies of this software or Derivative Works are licensed
+under this HTSQL Evaluation License.
+
+By "Derivative Work" we mean any derivative work under U.S. copyright
+law (or, for distribution or use outside the United States, the most
+closely equivalent concept under applicable law), including, without
+limitation, any improvement, translation, transformation, adaptation,
+modification, arrangement, plugin, wrapper, shim, or extension based
+on this software.
+
+THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY, AGAINST INFRINGEMENT, TITLE AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

File cogs.local/data/pkg/source/LICENSE-FREE-AGPL

+HTSQL Free Software License
+===========================
+
+Copyright (c) 2006-2013 Prometheus Research, LLC.
+All rights reserved.
+
+This program is free software: you can use, redistribute, and/or modify
+it under the terms of the GNU Affero General Public License, version 3
+or later ("AGPL"), as published by the Free Software Foundation, and as
+supplemented by additional terms according to section 7 of the AGPL:
+
+This Program was created by members and contributors to the HTSQL
+Project (http://htsql.org).  As permitted by section 7b of the AGPL,
+we require preservation of copyright notices and author attributions
+in this Program's documentation and Appropriate Legal Notices.  This
+Program displays such notices in its "htsql-ctl version" command line
+option, and also in its "About HTSQL" dialog box.  In the graphical
+display of these notices, author attributions include "Powered By"
+logos for HTSQL and for other software projects.
+
+For works containing this Program or any covered work, each interactive
+user interface must include a prominent and conveniently accessible
+feature for the display of Appropriate Legal Notices.  This display
+must include author attributions and copyright notices as found in this
+Program.  This display of these author attributions must be convenient
+for a user wishing to browse credits, shown in a manner separate and
+distinct from license texts, and commensurately prominent with respect
+to other author attributions.  To the extent that it is technically
+feasible and not obtrusive, the graphical form of these author
+attributions, such as a "Powered By" logo, must be preserved;
+otherwise, a textual equivalent is permitted.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Additional permissions, which may be removed at your option, under
+GNU AGPL version 3 section 7:
+
+If you modify this Program, or any covered work, by linking or combining
+it with parts that are otherwise independent works covered by the terms
+of GNU GPL version 2, the licensors of this Program grant you additional
+permission to convey the entire combined work containing those parts.
+

File cogs.local/data/pkg/source/LICENSE-PERMISSIVE

+HTSQL Permissive License
+========================
+
+Copyright (c) 2006-2013 Prometheus Research, LLC.
+All rights reserved.
+
+Redistribution and use, with or without modification, are permitted
+provided that the following conditions are met:
+
+1. The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the software.
+
+2. If this software or any Derivative Work is used or distributed for
+use with a database system, that database system must be Open Source.
+
+A database system is "Open Source" if, at the time of distribution or
+use in conjunction with this software, the system may be distributed
+or used without charge, the preferred source code for the database
+system is generally available, and this code is either in the public
+domain or licensed under terms approved by the Open Source Initiative.
+
+By "Derivative Work" we mean any derivative work under U.S. copyright
+law (or, for distribution or use outside the United States, the most
+closely equivalent concept under applicable law), including, without
+limitation, any improvement, translation, transformation, adaptation,
+modification, arrangement, plugin, wrapper, shim, or extension based
+on this software.
+
+THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY, AGAINST INFRINGEMENT, TITLE AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

File cogs.local/data/pkg/source/README-CORE

+**************************************
+  HTSQL -- A Database Query Language
+**************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  HTSQL is designed for data analysts and other *accidental
+programmers* who have complex business inquiries to solve and need a
+productive tool to write and share database queries.  HTSQL is *free
+and open source* software.  For more detail, visit http://htsql.org/.
+
+This package provides HTSQL core and *SQLite* backend.
+
+
+Installation Instructions
+=========================
+
+To install HTSQL using ``pip`` package manager, run::
+
+    # pip install HTSQL
+
+HTSQL works out of the box with SQLite databases.  To run HTSQL
+on top of other database servers, you need to install additional
+database backends.
+
+To install a PostgreSQL backend, run::
+
+    # pip install HTSQL-PGSQL
+
+To install a MySQL backend, run::
+
+    # pip install HTSQL-MYSQL
+
+To install an Oracle backend, run::
+
+    # pip install HTSQL-ORACLE
+
+To install a backend for Microsoft SQL Server, run::
+
+    # pip install HTSQL-MSSQL
+
+Alternatively, you may download binary packages for various
+Linux distributions from http://htsql.org/download/.
+
+
+Quick Start
+===========
+
+To verify that HTSQL is installed correctly, run::
+
+    $ htsql-ctl --version
+
+You can use HTSQL on top of any relational database.  In our examples,
+we use the HTSQL Demo database, which can be downloaded from
+http://dist.htsql.org/misc/htsql_demo.sqlite.
+
+To start a command-line shell where you can type and execute HTSQL
+queries, run::
+
+    $ htsql-ctl shell sqlite:htsql_demo.sqlite
+    Type 'help' for more information, 'exit' to quit the shell.
+
+The parameter ``sqlite:htsql_demo.sqlite`` is a database connection
+URI, which has the general form::
+
+    <engine>://<user>:<pass>@<host>:<port>/<database>
+
+For example, the following are valid connection URI::
+
+    sqlite:htsql_demo.sqlite
+    pgsql://localhost/htsql_demo
+    mysql://root@localhost:3306/htsql_demo
+
+Use option ``--password`` to make ``htsql-ctl`` ask you to type
+the password.
+
+In the shell, you can type and execute HTSQL queries::
+
+    htsql_demo$ /school
+     | school                                        |
+     +-----------------------------------------------+
+     | code | name                          | campus |
+    -+------+-------------------------------+--------+-
+     | art  | School of Art & Design        | old    |
+     | bus  | School of Business            | south  |
+     | edu  | College of Education          | old    |
+    ...
+
+The ``htsql-ctl`` script also provides a built-in web server.  It could
+be started as follows::
+
+    $ htsql-ctl serve sqlite:htsql_demo.sqlite
+    Starting an HTSQL server on localhost:8080 over htsql_demo.sqlite
+
+You could then access HTSQL using your browser or any other HTTP user
+agent.
+
+For more information on using and configuring HTSQL, see
+http://htsql.org/doc/handbook.html.
+
+
+Using HTSQL from Python
+=======================
+
+Create an HTSQL instance::
+
+    >>> from htsql import HTSQL
+    >>> demo = HTSQL("sqlite:htsql_demo")
+
+Use the instance to execute HTSQL queries.  For example, to
+find all school records matching the given pattern, write::
+
+    >>> query = "/school?name~$pattern"
+    >>> for row in demo.produce(query, pattern='art'):
+    ...     print row
+    ...
+    school(code=u'art', name=u'School of Art & Design', campus=u'old')
+    school(code=u'la', name=u'School of Arts and Humanities', campus=u'old')
+
+In the next example, for all schools in the old campus, we get the
+number of associated programs and departments::
+
+    >>> query = "/school{name, count(program), count(department)}?campus='old'"
+    >>> for row in demo.produce(query):
+    ...     print "%s: %d programs, %d departments" % row
+    ...
+    School of Art & Design: 3 programs, 2 departments
+    College of Education: 7 programs, 2 departments
+    School of Arts and Humanities: 9 programs, 5 departments
+    School of Natural Sciences: 6 programs, 4 departments
+
+For detailed instructions on use of HTSQL with Python, see
+http://htsql.org/doc/embed.html.
+
+
+Acknowledgements
+================
+
+HTSQL is copyright by Prometheus Research, LLC.  HTSQL is written by
+Clark C. Evans <cce@clarkevans.com> and Kirill Simonov <xi@resolvent.net>.
+
+Generous support for HTSQL was provided by the Simons Foundation.
+This material is also based upon work supported by the National
+Science Foundation under Grant #0944460.
+

File cogs.local/data/pkg/source/README-DJANGO

+*******************************************
+  HTSQL-DJANGO -- Django gateway to HTSQL
+*******************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  This package contains a Django application that provides
+a gateway to HTSQL service.
+
+This is an experimental package.  The usage, API, and security
+assumptions may change in future releases.
+
+For more information on HTSQL, please see:
+
+    http://htsql.org/
+        The HTSQL homepage
+
+    http://pypi.python.org/pypi/HTSQL/
+        The source package for HTSQL
+
+
+Installation and Usage
+======================
+
+This package allows you to use HTSQL in your Django projects.  To
+install it, run::
+
+    # pip install HTSQL-DJANGO
+
+This command installs HTSQL itself and a Django gateway.  Out of the
+box, HTSQL works with SQLite databases.  To run HTSQL on top of other
+database servers, install additional database backends::
+
+    # pip install HTSQL-PGSQL
+    # pip install HTSQL-MYSQL
+
+To use HTSQL in your Django project, open ``settings.py`` and add
+``'htsql_django'`` to the list of installed applications::
+
+    INSTALLED_APPS = (
+        # ...
+        'htsql_django',
+    )
+
+When used in a Django project, HTSQL service is automatically
+configured to serve on the default Django database.  You could provide
+additional configuration options using parameter ``HTSQL_CONFIG``.
+For instance, a reasonable configuration could be::
+
+    HTSQL_CONFIG = {
+        # Set query timeout in seconds (currently, PostgreSQL only).
+        'tweak.timeout': { 'timeout': 600 },
+        # Set the maximum number of output rows.
+        'tweak.autolimit': { 'limit': 10000 },
+        # Enable the web-based query editor.
+        'tweak.shell.default': {},
+        # Enable meta-data queries.
+        'tweak.meta': {},
+    }
+
+Next, add the gateway to the URL dispatcher.  Open ``urls.py`` and
+add the following line::
+
+    urlpatterns = patterns('',
+        # ...
+        url(r'^htsql/', include('htsql_django.urls')),
+    )
+
+This will forward HTTP requests starting from ``/htsql/`` to the HTSQL
+service.  The gateway is available only to authenticated users.
+
+You could also make HTSQL queries from Python code.  For example, to
+calculate the total number of votes per poll in the Django tutorial
+project, run::
+
+    >>> from htsql_django import produce
+    >>>
+    >>> query = "/polls_poll{question, total:=sum(polls_choice.votes)}"
+    >>> for row in produce(query):
+    ...     print "%s: %s" % (row.question, row.total)
+    ...
+    What's up?: 6
+

File cogs.local/data/pkg/source/README-MSSQL

+*********************************************************
+  HTSQL-MSSQL -- HTSQL backend for Microsoft SQL Server
+*********************************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  This package provides HTSQL backend for *Microsoft SQL
+Server*.
+
+To install this package, run::
+
+    # pip install HTSQL-MSSQL
+
+For more information, please see:
+
+    http://htsql.org/
+        The HTSQL homepage
+
+    http://pypi.python.org/pypi/HTSQL/
+        The source package for HTSQL
+

File cogs.local/data/pkg/source/README-MYSQL

+******************************************
+  HTSQL-MYSQL -- HTSQL backend for MySQL
+******************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  This package provides HTSQL backend for *MySQL*.
+
+To install this package, run::
+
+    # pip install HTSQL-MYSQL
+
+For more information, please see:
+
+    http://htsql.org/
+        The HTSQL homepage
+
+    http://pypi.python.org/pypi/HTSQL/
+        The source package for HTSQL
+

File cogs.local/data/pkg/source/README-ORACLE

+********************************************
+  HTSQL-ORACLE -- HTSQL backend for Oracle
+********************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  This package provides HTSQL backend for *Oracle*.
+
+To install this package, run::
+
+    # pip install HTSQL-ORACLE
+
+For more information, please see:
+
+    http://htsql.org/
+        The HTSQL homepage
+
+    http://pypi.python.org/pypi/HTSQL/
+        The source package for HTSQL
+

File cogs.local/data/pkg/source/README-PGSQL

+***********************************************
+  HTSQL-PGSQL -- HTSQL backend for PostgreSQL
+***********************************************
+
+HTSQL is a comprehensive navigational query language for relational
+databases.  This package provides HTSQL backend for *PostgreSQL*.
+
+To install this package, run::
+
+    # pip install HTSQL-PGSQL
+
+For more information, please see:
+
+    http://htsql.org/
+        The HTSQL homepage
+
+    http://pypi.python.org/pypi/HTSQL/
+        The source package for HTSQL
+

File cogs.local/data/pkg/source/moves.yaml

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+#
+# This file specifies the layout of source packages.  The first
+# document indicates common files and attributes, the rest describe
+# individual source packages.
+#
+
+---
+code:
+files:
+  README:
+  LICENSE: [LICENSE-ALL, "", LICENSE-FREE-AGPL, "",
+            LICENSE-PERMISSIVE, "", LICENSE-EVALUATION]
+  setup.py: setup.py
+variables:
+  name:
+  version: # populated by the build script
+  description:
+  author: Clark C. Evans and Kirill Simonov; Prometheus Research, LLC
+  author-email: cce@clarkevans.com, xi@resolvent.net
+  license: AGPLv3 or Permissive for use with Open Source databases
+  keywords: sql relational database query language
+  platforms: Any
+  url: http://htsql.org/
+  classifiers:
+  package-dir: src
+  packages:
+  install-requires:
+  console-scripts:
+  htsql-routines: # populated by the build script
+  htsql-addons: # populated by the build script
+  with-doc: false # not for substitution, used by the build script
+
+---
+code: htsql
+files:
+  README: README-CORE
+variables:
+  name: HTSQL
+  description: A Database Query Language (core & SQLite backend)
+  classifiers: |
+    Development Status :: 4 - Beta
+    Environment :: Console
+    Environment :: Web Environment
+    Intended Audience :: Developers
+    Intended Audience :: Information Technology
+    Intended Audience :: Science/Research
+    License :: OSI Approved :: GNU Affero General Public License v3
+    License :: Free To Use But Restricted
+    License :: Other/Proprietary License
+    Programming Language :: Python
+    Programming Language :: Python :: 2.6
+    Programming Language :: Python :: 2.7
+    Programming Language :: SQL
+    Topic :: Database :: Front-Ends
+    Topic :: Internet :: WWW/HTTP :: WSGI
+    Topic :: Software Development :: Libraries
+  packages: |
+    htsql
+    htsql_sqlite
+  install-requires: |
+    setuptools
+    pyyaml
+  console-scripts: |
+    htsql-ctl = htsql.ctl:main
+  with-doc: true
+
+---
+code: htsql-pgsql
+files:
+  README: README-PGSQL
+variables:
+  name: HTSQL-PGSQL
+  description: A Database Query Language (PostgreSQL backend)
+  packages: |
+    htsql_pgsql
+  install-requires: |
+    HTSQL
+    psycopg2
+
+---
+code: htsql-mysql
+files:
+  README: README-MYSQL
+variables:
+  name: HTSQL-MYSQL
+  description: A Database Query Language (MySQL backend)
+  packages: |
+    htsql_mysql
+  install-requires: |
+    HTSQL
+    MySQL-python
+
+---
+code: htsql-oracle
+files:
+  README: README-ORACLE
+  LICENSE: LICENSE-EVALUATION
+variables:
+  name: HTSQL-ORACLE
+  description: A Database Query Language (Oracle backend)
+  license: Evaluation License
+  packages: |
+    htsql_oracle
+  install-requires: |
+    HTSQL
+    cx_Oracle
+
+---
+code: htsql-mssql
+files:
+  README: README-MSSQL
+  LICENSE: LICENSE-EVALUATION
+variables:
+  name: HTSQL-MSSQL
+  description: A Database Query Language (Microsoft SQL Server backend)
+  license: Evaluation License
+  packages: |
+    htsql_mssql
+  install-requires: |
+    HTSQL
+    pymssql
+
+---
+code: htsql-django
+files:
+  README: README-DJANGO
+variables:
+  name: HTSQL-DJANGO
+  description: A Database Query Language (Django gateway)
+  packages: |
+    htsql_django
+  install-requires: |
+    HTSQL
+    Django
+

File cogs.local/data/pkg/source/setup.py

+#
+# Copyright (c) 2006-2013, Prometheus Research, LLC
+#
+
+
+#
+# To install ${NAME}, run `python setup.py install`.
+#
+
+
+from setuptools import setup
+import os.path
+
+
+NAME = "${NAME}"
+VERSION = "${VERSION}"
+DESCRIPTION = "${DESCRIPTION}"
+LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__),
+                                     "README")).read()
+AUTHOR = "${AUTHOR}"
+AUTHOR_EMAIL = "${AUTHOR_EMAIL}"
+LICENSE = "${LICENSE}"
+KEYWORDS = "${KEYWORDS}"
+PLATFORMS = "${PLATFORMS}"
+URL = "${URL}"
+CLASSIFIERS = """
+${CLASSIFIERS}""".strip().splitlines() or None
+PACKAGE_DIR = {'': '${PACKAGE_DIR}'}
+INCLUDE_PACKAGE_DATA = True
+ZIP_SAFE = False
+PACKAGES = """
+${PACKAGES}""".strip().splitlines()
+INSTALL_REQUIRES = """
+${INSTALL_REQUIRES}""".strip().splitlines()
+CONSOLE_SCRIPTS = """
+${CONSOLE_SCRIPTS}""".strip().splitlines() or None
+HTSQL_ROUTINES = """
+${HTSQL_ROUTINES}""".strip().splitlines() or None
+HTSQL_ADDONS = """
+${HTSQL_ADDONS}""".strip().splitlines() or None
+ENTRY_POINTS = {}
+if CONSOLE_SCRIPTS:
+    ENTRY_POINTS['console_scripts'] = CONSOLE_SCRIPTS
+if HTSQL_ROUTINES:
+    ENTRY_POINTS['htsql.routines'] = HTSQL_ROUTINES
+if HTSQL_ADDONS:
+    ENTRY_POINTS['htsql.addons'] = HTSQL_ADDONS
+
+
+setup(name=NAME,
+      version=VERSION,
+      description=DESCRIPTION,
+      long_description=LONG_DESCRIPTION,
+      author=AUTHOR,
+      author_email=AUTHOR_EMAIL,
+      license=LICENSE,
+      keywords=KEYWORDS,
+      platforms=PLATFORMS,
+      url=URL,
+      classifiers=CLASSIFIERS,
+      package_dir=PACKAGE_DIR,
+      include_package_data=INCLUDE_PACKAGE_DATA,
+      zip_safe=ZIP_SAFE,
+      packages=PACKAGES,
+      install_requires=INSTALL_REQUIRES,
+      entry_points=ENTRY_POINTS)
+
+

File cogs.local/data/vm/centos-install.sh

+#/bin/sh
+
+# Post-installation script for CentOS VM.
+set -ex
+
+# Add the public key to /root/.ssh/authorized_keys.
+mkdir /root/.ssh
+chmod go-rwx /root/.ssh
+cp identity.pub /root/.ssh/authorized_keys
+chmod u+rw,go-rwx /root/.ssh/authorized_keys
+

File cogs.local/data/vm/centos-isolinux.cfg

+# This is a configuration file for the ISOLINUX boot loader.
+# See http://syslinux.zytor.com/ for general information on ISOLINUX.
+
+default linux
+label linux
+say Installing CentOS Linux...
+kernel vmlinuz
+append initrd=initrd.img ks=cdrom:/ks.cfg
+

File cogs.local/data/vm/centos-ks.cfg

+# This is a kickstart script for automated installation for Red Hat/CentOS.
+# See http://fedoraproject.org/wiki/Anaconda/Kickstart for usage.
+
+# Run installation in text mode.
+text
+
+# Install a fresh system from CD-ROM.
+install
+cdrom
+
+# Set the default system language.
+lang en_US.UTF-8
+
+# Set the keyboard type.
+keyboard us
+
+# Set the root password.
+rootpw root
+
+# Do not install any iptables rules.
+firewall --disabled
+
+# Disable selinux.
+selinux --permissive
+
+# Shadow passwords.
+authconfig --enableshadow
+
+# Set timezone to US/Central.
+timezone --utc America/Chicago
+
+# Initialize disk partitions.
+zerombr
+clearpart --all --initlabel
+
+# Install the boot loader.
+bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
+
+# Set partition layout.
+part / --size=1024 --grow --maxsize=65536
+part swap --size=2048
+
+# Configure network.
+network --bootproto=dhcp --device=eth0
+
+# Turn the machine off after installation is complete.
+poweroff
+
+# Install core packages only.
+%packages --nobase
+@core
+%end
+
+# Copy the installation script and the public key from CD-ROM.
+%post --nochroot
+cp /mnt/source/install.sh /mnt/sysimage
+cp /mnt/source/identity.pub /mnt/sysimage
+%end
+
+# Execute the installation script.
+%post
+/install.sh
+rm /install.sh
+rm /identity.pub
+%end
+

File cogs.local/data/vm/deb-update.sh

+#/bin/sh
+
+# Post-installation script for the Debian DEB BuildBot.
+set -ex
+
+# Update the hostname.
+echo "deb-vm" >/etc/hostname
+
+# Register the testing repository.
+echo "deb http://ftp.us.debian.org/debian/ wheezy main" >/etc/apt/sources.list.d/testing.list
+cat <<END >>/etc/apt/preferences.d/pinning.pref
+Package: *
+Pin: release n=wheezy
+Pin-Priority: 90
+END
+apt-get -q update
+
+# Install Python 2.7 dependencies from testing.
+APT_LISTCHANGES_FRONTEND=none \
+DEBIAN_FRONTEND=noninteractive \
+apt-get -qy install -t wheezy gcc-4.4
+
+# Install Python 2.7 and other build dependencies.
+apt-get -qy install -t wheezy python-all
+apt-get -qy install -t wheezy python-setuptools
+apt-get -qy install -t wheezy python-yaml
+apt-get -qy install debhelper
+
+# Clean APT cache.
+apt-get clean
+

File cogs.local/data/vm/debian-install.sh

+#/bin/sh
+
+# Post-installation script for Debian6 VM.
+
+# Add the public key to /root/.ssh/authorized_keys.
+mkdir /root/.ssh
+chmod go-rwx /root/.ssh
+cp identity.pub /root/.ssh/authorized_keys
+

File cogs.local/data/vm/debian-isolinux.cfg

+# This is a configuration file for the ISOLINUX boot loader.
+# See http://syslinux.zytor.com/ for general information on ISOLINUX.
+# See http://www.debian.org/releases/stable/i386/apbs02.html.en#preseed-bootparms
+# for information on using boot parameters to preseed questions.
+
+default linux
+label linux
+say Installing Debian GNU/Linux...
+kernel /install.386/vmlinuz
+append vga=normal initrd=/install.386/initrd.gz debian-installer/locale=en_US.UTF-8 console-keymaps-at/keymap=us preseed/file=/cdrom/preseed.cfg -- quiet
+

File cogs.local/data/vm/debian-preseed.cfg

+# This is an answer file for the Debian installer.
+# See http://www.debian.org/releases/stable/i386/apb.html.en
+# for the general documentation on preseeding.
+# See http://www.debian.org/releases/stable/example-preseed.txt
+# for an example of a preseed file.
+
+# Set the locale (noop, must be set as a boot parameter).
+d-i debian-installer/locale string en_US.UTF-8
+
+# Choose the keyboard configuration (noop, must be set as a boot parameter).
+d-i console-keymaps-at/keymap select us
+
+# Set the hostname and the domain.
+d-i netcfg/get_hostname string linux-vm
+d-i netcfg/get_domain string
+
+# Select the time zone (we might want to use UTC here).
+d-i time/zone string America/Chicago
+
+# Choose regular partitioning, no LVM or encryption.
+d-i partman-auto/method string regular
+
+# We need to provide a custom partitioning recipe because the Oracle server
+# (and the client) requires a larger swap than provided by default.
+# So we allocate 2G for the swap (twice as much as required by Oracle)
+# and give the rest for the root filesystem.
+#
+# For general description of the recipe format, see
+# partman-auto-recipe.txt in the debian-installer package.
+d-i partman-auto/expert_recipe string   \
+    fs-recipe :                         \
+        1024 65536 65536 ext3           \
+            $primary{ }                 \
+            $bootable{ }                \
+            method{ format }            \
+            format{ }                   \
+            use_filesystem{ }           \
+            filesystem{ ext3 }          \
+            mountpoint{ / }             \
+        .                               \
+        2048 2048 2048 linux-swap       \
+            method{ swap }              \
+            format{ }                   \
+        .
+
+# Confirm the partitioning.
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
+# Set the root password: root.
+d-i passwd/root-password password root
+d-i passwd/root-password-again password root
+
+# Do not create a regular user.
+d-i passwd/make-user boolean false
+
+# Select APT mirror and proxy settings.
+d-i mirror/country string US
+d-i mirror/http/mirror select ftp.us.debian.org
+d-i mirror/http/proxy string
+
+# Add an extra repository for Debian backports.
+d-i apt-setup/local0/repository string http://backports.debian.org/debian-backports squeeze-backports main
+
+# Package selection: standard.
+tasksel tasksel/first multiselect standard
+
+# Additional packages to install.
+d-i pkgsel/include string openssh-server build-essential
+
+# Indicate how to upgrade packages after debootstrap.
+d-i pkgsel/upgrade select safe-upgrade
+
+# Do not participate in the popularity contest.
+popularity-contest popularity-contest/participate boolean false
+
+# Install the boot loader to the MBR.
+d-i grub-installer/only_debian boolean true
+
+# Execute the post-installation script in the chrooted environment.
+d-i preseed/late_command string         \
+    cp /cdrom/install.sh /target/;      \
+    cp /cdrom/identity.pub /target/;    \
+    in-target /install.sh;              \
+    rm /target/install.sh /target/identity.pub
+
+# Skip the reboot warning.
+d-i finish-install/reboot_in_progress note
+
+# Power off the machine after the installation is complete.
+d-i debian-installer/exit/poweroff boolean true
+

File cogs.local/data/vm/mssql2005-update.cmd

+@echo off
+cd %systemdrive%\INSTALL
+
+rem Post-installation script for the mssql2005 VM.
+
+rem For instructions on installing MS SQL Server 2005 Express Edition, see
+rem http://www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41&displaylang=en
+rem SQL Server 2005 requires Service Pack 1 when installing on
+rem Windows Server 2003, or Service Pack 2 when installing on
+rem Windows XP.  The other prerequisite is .NET Framework 2.0.
+
+set PATH=%PATH%;"%programfiles%\GnuWin32\bin"
+set PATH=%PATH%;"%programfiles%\7-Zip"
+
+
+rem Supress the prompt for CD2.
+reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\R2Setup" /v cd2chain /t REG_DWORD /d 0 /f
+
+
+rem Download and install .NET Framework 2.0.
+wget -q http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe
+rem dotnetfx /C /T:%systemdrive%/INSTALL/dotnetfx
+7z x dotnetfx.exe -odotnetfx
+cd dotnetfx
+install /q
+cd ..
+
+rem Download and install SQL Server 2005 Express Edition.
+wget -q http://download.microsoft.com/download/f/1/0/f10c4f60-630e-4153-bd53-c3010e4c513b/SQLEXPR.EXE
+rem SQLEXPR.EXE /x:%systemdrive%/INSTALL/SQLEXPR
+7z x SQLEXPR.EXE -oSQLEXPR
+cd SQLEXPR
+setup /qn ADDLOCAL=ALL SECURITYMODE=SQL SAPWD=tot8OmDeufi DISABLENETWORKPROTOCOLS=0
+cd ..
+
+rem Change the password for the SQL Server administrator account.
+set PATH=%PATH%;"%programfiles%\Microsoft SQL Server\90\Tools\binn"
+sqlcmd -S \SQLEXPRESS -Q "ALTER LOGIN sa WITH PASSWORD='admin', CHECK_POLICY=OFF"
+
+rem Enable TCP access to the SQL Server.
+reg add "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp\IP1" /v Enabled /t REG_DWORD /d 1 /f
+reg add "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp\IP1" /v TcpPort /t REG_SZ /d 1433 /f
+reg add "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp\IP2" /v Enabled /t REG_DWORD /d 1 /f
+reg add "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp\IP2" /v TcpPort /t REG_SZ /d 1433 /f
+reg add "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Tcp\IPAll" /v TcpPort /t REG_SZ /d 1433 /f
+
+rem Cleanup.
+del /q dotnetfx.exe
+rmdir /q /s dotnetfx
+del /q SQLEXPR.EXE
+rmdir /q /s SQLEXPR
+
+rem Shut down.
+shutdown /s /t 0 /f
+

File cogs.local/data/vm/mssql2008-update.cmd

+@echo off
+cd %systemdrive%\INSTALL
+
+rem Post-installation script for the mssql2008 VM.
+
+rem For instructions on installing MS SQL Server 2008 R2, see
+rem http://msdn.microsoft.com/en-us/library/ms143219.aspx
+
+rem SQL Server 2005 requires Service Pack 1 when installing on
+rem Windows Server 2003, or Service Pack 2 when installing on
+rem Windows XP.  The other prerequisite is .NET Framework 2.0.
+
+rem Prerequisites: .NET Framework 2.0 SP2, Windows Installer 4.5
+
+set PATH=%PATH%;"%programfiles%\GnuWin32\bin"
+set PATH=%PATH%;"%programfiles%\7-Zip"
+
+rem .NET Framework 2.0 SP2
+wget -q http://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe
+7z x NetFx20SP2_x86.exe -oNetFx20SP2_x86
+cd NetFx20SP2_x86
+setup.exe /q
+cd ..
+
+rem Windows Installer 4.5
+wget -q http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsServer2003-KB942288-v4-x86.exe
+WindowsServer2003-KB942288-v4-x86.exe /quiet /norestart
+
+rem MS SQL Server 2008 R2 Express
+wget -q http://download.microsoft.com/download/5/1/A/51A153F6-6B08-4F94-A7B2-BA1AD482BC75/SQLEXPR32_x86_ENU.exe
+SQLEXPR32_x86_ENU.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SECURITYMODE=SQL /SAPWD=tot8OmDeufi /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /TCPENABLED=1
+
+set path=%path%;"%programfiles%\Microsoft SQL Server\100\Tools\binn"
+sqlcmd -Q "ALTER LOGIN sa WITH PASSWORD='admin', CHECK_POLICY=OFF"
+
+rem Cleanup.
+del /q NetFx20SP2_x86.exe
+rmdir /q /s NetFx20SP2_x86
+del /q WindowsServer2003-KB942288-v4-x86.exe
+del /q SQLEXPR32_x86_ENU.exe
+
+rem Shut down.
+shutdown /s /t 0 /f
+
+

File cogs.local/data/vm/mysql51-update.sh

+#/bin/sh
+
+# Post-installation script for the mysql51 VM.
+set -ex
+
+# Update the hostname.
+echo mysql51-vm >/etc/hostname
+
+# Preset the password for the MySQL root user.
+echo "mysql-server-5.1 mysql-server/root_password password admin" | debconf-set-selections
+echo "mysql-server-5.1 mysql-server/root_password_again password admin" | debconf-set-selections
+
+# Install MySQL 5.1.
+apt-get -qy install mysql-server-5.1
+
+# Clean APT cache.
+apt-get clean
+
+# Configure MySQL to listen on all interfaces.
+cat <<END >/etc/mysql/conf.d/bind_address.cnf
+[mysqld]
+bind-address = 0.0.0.0
+END
+
+# Start the server (since it is not started during OS installation).
+/etc/init.d/mysql start
+
+# Grant administrative privileges to the root user regardless of the client
+# hostname.
+cat <<END | mysql -uroot -padmin
+GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;
+END
+

File cogs.local/data/vm/oracle10g-update.sh

+#/bin/sh
+
+# Post-installation script for the oracle10g VM.
+set -ex
+
+## Update the hostname.
+#echo oracle10g-vm >/etc/hostname
+
+# Enable HTTPS for APT repositories.
+apt-get -q update
+apt-get -qy install apt-transport-https
+
+# Register the Oracle repository.
+echo "deb https://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list
+wget -q https://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
+apt-get -q update
+
+# Install the Oracle 10g Express Edition.
+apt-get -qy install oracle-xe-universal
+
+# Clean APT cache.
+apt-get clean
+
+# Fix the problem when the configuration script eats the last
+# character of the password if it is 'n': replace IFS="\n" with IFS=$'\n'.
+sed -i -e s/IFS=\"\\\\n\"/IFS=\$\'\\\\n\'/ /etc/init.d/oracle-xe
+
+# Configure the server; provide the answers for the following questions:
+# The HTTP port for Oracle Application Express: 8080
+# A port for the database listener: 1521
+# The password for the SYS and SYSTEM database accounts: admin
+# Start the server on boot: yes
+/etc/init.d/oracle-xe configure <<END
+8080
+1521
+admin
+admin
+y
+END
+
+# Load Oracle environment variables so that we could run `sqlplus`.
+. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
+
+# Increase the number of connections.
+echo "ALTER SYSTEM SET PROCESSES=200 SCOPE=SPFILE;" | \
+sqlplus -S -L sys/admin AS SYSDBA
+
+# Set Oracle environment variables on login.
+cat <<END >>/root/.bashrc
+
+. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
+END
+

File cogs.local/data/vm/pgsql84-update.sh

+#/bin/sh
+
+# Post-installation script for the pgsql84 VM.
+set -ex
+
+# Update the hostname.
+echo pgsql84-vm >/etc/hostname
+
+# Install the PostgreSQL 8.4 server.
+apt-get -qy install postgresql-8.4
+
+# Clean APT cache.
+apt-get clean
+
+# Set the password of the user postgres to 'admin'.
+su -c "psql -c \"ALTER ROLE postgres WITH PASSWORD 'admin'\"" postgres
+
+# Configure PostgreSQL to listen on all interfaces.
+cat <<END >>/etc/postgresql/8.4/main/postgresql.conf
+
+# Listen on all available interfaces:
+listen_addresses = '*'
+END
+
+# Configure PostgreSQL to allow login from the external interface.
+cat <<END >>/etc/postgresql/8.4/main/pg_hba.conf
+
+# Allow external network connections:
+host all all 10.0.0.1/8 md5
+END
+

File cogs.local/data/vm/pgsql90-update.sh

+#/bin/sh
+
+# Post-installation script for the pgsql90 VM.
+set -ex
+
+# Update the hostname.
+echo pgsql90-vm >/etc/hostname
+
+# Install the PostgreSQL 9.0 server from backports.
+apt-get -qy -t squeeze-backports install postgresql-9.0
+
+# Clean APT cache.
+apt-get clean
+
+# Set the password of the user postgres to 'admin'.
+su -c "psql -c \"ALTER ROLE postgres WITH PASSWORD 'admin'\"" postgres
+
+# Configure PostgreSQL to listen on all interfaces.
+cat <<END >>/etc/postgresql/9.0/main/postgresql.conf
+
+# Listen on all available interfaces:
+listen_addresses = '*'
+END
+
+# Configure PostgreSQL to allow login from the external interface.
+cat <<END >>/etc/postgresql/9.0/main/pg_hba.conf
+
+# Allow external network connections:
+host all all 10.0.0.1/8 md5
+END
+

File cogs.local/data/vm/pgsql91-update.sh

+#/bin/sh
+
+# Post-installation script for the pgsql91 VM.
+set -ex
+
+# Update the hostname.
+echo pgsql91-vm >/etc/hostname
+
+# Install the PostgreSQL 9.1 server from backports.
+apt-get -qy -t squeeze-backports install postgresql-9.1
+
+# Clean APT cache.
+apt-get clean
+
+# Set the password of the user postgres to 'admin'.
+su -c "psql -c \"ALTER ROLE postgres WITH PASSWORD 'admin'\"" postgres
+
+# Configure PostgreSQL to listen on all interfaces.
+cat <<END >>/etc/postgresql/9.1/main/postgresql.conf
+
+# Listen on all available interfaces:
+listen_addresses = '*'
+END
+
+# Configure PostgreSQL to allow login from the external interface.
+cat <<END >>/etc/postgresql/9.1/main/pg_hba.conf
+
+# Allow external network connections:
+host all all 10.0.0.1/8 md5
+END
+

File cogs.local/data/vm/py26-update.sh

+#/bin/sh
+
+# Post-installation script for the py26 VM.
+set -ex
+
+# Update the hostname.
+echo py26-vm >/etc/hostname
+
+# Enable HTTPS for APT repositories.
+apt-get -q update
+apt-get -qy install apt-transport-https
+
+# Register the Oracle repository.
+echo "deb https://oss.oracle.com/debian/ unstable main non-free" >/etc/apt/sources.list.d/oracle.list
+wget -q https://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
+apt-get -q update
+
+# Install Mercurial.
+apt-get -qy install mercurial
+
+# Install Python 2.6 and required Python packages.
+apt-get -qy install python2.6
+apt-get -qy install python-setuptools
+apt-get -qy install python-yaml
<