%define name colab %define version 1.11.3 %define default_release 0 %{!?release: %define release %{default_release}} %define buildvenv /var/tmp/%{name}-%{version} Summary: Collaboration platform for communities Name: %{name} Version: %{version} Release: 0 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 BuildArch: noarch BuildRequires: colab-deps >= 1.11.3, python-virtualenv # FIXME colab should not depend on nginx! Requires: colab-deps >= 1.11.3, solr, mailman-api >= 0.3, nginx %description Integrated software development platform. %prep %setup -n %{name}-%{version} -n %{name}-%{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 --use-wheel --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 # 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 # 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 %post mv /etc/colab/gunicorn.py.example /etc/colab/gunicorn.py if [ ! -f /etc/colab/settings.py ]; then SECRET_KEY=$(openssl rand -hex 32) cat > /etc/colab/settings.py <