diff --git a/colab/colab.spec b/colab/colab.spec index 9a2e7b1..47bc859 100644 --- a/colab/colab.spec +++ b/colab/colab.spec @@ -1,24 +1,23 @@ %define name colab -%define version 1.11.0 -%define default_release 2 +%define version 1.10.4 +%define default_release 4 %{!?release: %define release %{default_release}} %define buildvenv /var/tmp/%{name}-%{version} Summary: Collaboration platform for communities Name: %{name} Version: %{version} -Release: 0 +Release: %{release} Source0: %{name}-%{version}.tar.gz License: GPLv2 Group: Development/Tools BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} Vendor: Sergio Oliveira -Url: https://github.com/colab/colab +Url: https://github.com/colab-community/colab BuildArch: noarch -BuildRequires: colab-deps >= 1.11, python-virtualenv -# FIXME colab should not depend on nginx! -Requires: colab-deps >= 1.11, solr, mailman-api >= 0.3, nginx +BuildRequires: colab-deps >= 1.10, python-virtualenv +Requires: colab-deps >= 1.10, solr, mailman-api %description Integrated software development platform. @@ -30,7 +29,7 @@ Integrated software development platform. # install colab into virtualenv to make sure dependencies are OK rm -rf %{buildvenv} cp -r /usr/lib/colab %{buildvenv} -PATH=%{buildvenv}/bin:$PATH pip install --use-wheel --no-index . +PATH=%{buildvenv}/bin:$PATH pip install --no-index . virtualenv --relocatable %{buildvenv} # cleanup virtualenv @@ -44,30 +43,13 @@ rm -f cleanup.list find %{buildvenv} -type d -empty -delete %install - -# install config file -install -d -m 0755 %{buildroot}/etc/colab -install -m 0644 misc/etc/colab/gunicorn.py %{buildroot}/etc/colab/gunicorn.py.example - -# Create settings dirs -install -d -m 0755 %{buildroot}/etc/colab/settings.d -install -d -m 0755 %{buildroot}/etc/colab/plugins.d - -# create log dir -install -d -m 0755 %{buildroot}/var/log/colab - -# create celery dir -install -d -m 0755 %{buildroot}/var/lib/colab/celery - -# Create assets dir (stores static files) -install -d -m 0755 %{buildroot}/var/lib/colab/assets +mkdir -p %{buildroot}/etc/colab +mkdir -p %{buildroot}/usr/lib # install virtualenv -install -d -m 0755 %{buildroot}/usr/lib rm -rf %{buildroot}/usr/lib/colab cp -r %{buildvenv} %{buildroot}/usr/lib/colab mkdir -p %{buildroot}/%{_bindir} - cat > %{buildroot}/%{_bindir}/colab-admin < /dev/null || groupadd --system colab -getent passwd colab > /dev/null || useradd --system --gid colab --home-dir /usr/lib/colab --no-create-home colab +if [ ! -f /etc/colab/settings.yaml ]; then + SECRET_KEY=$(openssl rand -hex 32) + cat > /etc/colab/settings.yaml <' +SERVER_EMAIL: '"Colab" ' + +EMAIL_HOST: localhost +EMAIL_PORT: 25 +EMAIL_SUBJECT_PREFIX: '[colab]' + +SECRET_KEY: '$SECRET_KEY' + +SITE_URL: 'http://localhost:8001/' +BROWSERID_AUDIENCES: + - http://localhost:8001 +# - http://example.com +# - https://example.org +# - http://example.net + +ALLOWED_HOSTS: + - localhost +# - example.com +# - example.org +# - example.net + +## Disable indexing +ROBOTS_NOINDEX: false + +## Disable browser id authentication +# BROWSERID_ENABLED: true +EOF + chown root:colab /etc/colab/settings.yaml + chmod 0640 /etc/colab/settings.yaml +fi +mkdir -p /etc/colab/settings.d + +if [ ! -f /etc/colab/settings.d/00-database.yaml ]; then + cat > /etc/colab/settings.d/00-database.yaml < /etc/colab/settings.py <