%define name colab %define version 1.9 %define unmangled_version 1.9 %define default_release 1 %{!?release: %define release %{default_release}} %define buildvenv /var/tmp/%{name}-%{version} Summary: Collaboration platform for communities Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{unmangled_version}.tar.gz License: GPLv2 Group: Development/Tools BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} Vendor: Sergio Oliveira Url: https://github.com/colab-community/colab BuildArch: noarch BuildRequires: colab-deps, python-virtualenv Requires: colab-deps, solr, mailman-api %description Integrated software development platform. %prep %setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} %build # 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 --no-index . virtualenv --relocatable %{buildvenv} # cleanup virtualenv rpm -ql colab-deps | sed '/^\/usr\/lib\/colab\// !d; s#/usr/lib/colab/##' > cleanup.list while read f; do if [ -f "%{buildvenv}/$f" ]; then rm -f "%{buildvenv}/$f" fi done < cleanup.list rm -f cleanup.list find %{buildvenv} -type d -empty -delete %install mkdir -p %{buildroot}/etc/colab mkdir -p %{buildroot}/usr/lib # install virtualenv rm -rf %{buildroot}/usr/lib/colab cp -r %{buildvenv} %{buildroot}/usr/lib/colab mkdir -p %{buildroot}/%{_bindir} cat > %{buildroot}/%{_bindir}/colab-admin < /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 <