Commit f98df6f15c92dc4d43c440b2ed18c1fb9a310e58
1 parent
0d6938bc
Exists in
spb-release/3.0
and in
1 other branch
remove RPM-related stuff
Showing
2 changed files
with
0 additions
and
245 deletions
Show diff stats
colab.spec
@@ -1,192 +0,0 @@ | @@ -1,192 +0,0 @@ | ||
1 | -%define name colab | ||
2 | -%define version 1.10 | ||
3 | -%define unmangled_version 1.10 | ||
4 | -%define default_release 1 | ||
5 | -%{!?release: %define release %{default_release}} | ||
6 | -%define buildvenv /var/tmp/%{name}-%{version} | ||
7 | - | ||
8 | -Summary: Collaboration platform for communities | ||
9 | -Name: %{name} | ||
10 | -Version: %{version} | ||
11 | -Release: %{release} | ||
12 | -Source0: %{name}-%{unmangled_version}.tar.gz | ||
13 | -License: GPLv2 | ||
14 | -Group: Development/Tools | ||
15 | -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot | ||
16 | -Prefix: %{_prefix} | ||
17 | -Vendor: Sergio Oliveira <sergio@tracy.com.br> | ||
18 | -Url: https://github.com/colab-community/colab | ||
19 | -BuildArch: noarch | ||
20 | -BuildRequires: colab-deps, python-virtualenv | ||
21 | -Requires: colab-deps, solr, mailman-api | ||
22 | - | ||
23 | -%description | ||
24 | -Integrated software development platform. | ||
25 | - | ||
26 | -%prep | ||
27 | -%setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} | ||
28 | - | ||
29 | -%build | ||
30 | -# install colab into virtualenv to make sure dependencies are OK | ||
31 | -rm -rf %{buildvenv} | ||
32 | -cp -r /usr/lib/colab %{buildvenv} | ||
33 | -PATH=%{buildvenv}/bin:$PATH pip install --no-index . | ||
34 | -virtualenv --relocatable %{buildvenv} | ||
35 | - | ||
36 | -# cleanup virtualenv | ||
37 | -rpm -ql colab-deps | sed '/^\/usr\/lib\/colab\// !d; s#/usr/lib/colab/##' > cleanup.list | ||
38 | -while read f; do | ||
39 | - if [ -f "%{buildvenv}/$f" ]; then | ||
40 | - rm -f "%{buildvenv}/$f" | ||
41 | - fi | ||
42 | -done < cleanup.list | ||
43 | -rm -f cleanup.list | ||
44 | -find %{buildvenv} -type d -empty -delete | ||
45 | - | ||
46 | -%install | ||
47 | -mkdir -p %{buildroot}/etc/colab | ||
48 | -mkdir -p %{buildroot}/usr/lib | ||
49 | - | ||
50 | -# install virtualenv | ||
51 | -rm -rf %{buildroot}/usr/lib/colab | ||
52 | -cp -r %{buildvenv} %{buildroot}/usr/lib/colab | ||
53 | -mkdir -p %{buildroot}/%{_bindir} | ||
54 | -cat > %{buildroot}/%{_bindir}/colab-admin <<EOF | ||
55 | -#!/bin/sh | ||
56 | -set -e | ||
57 | - | ||
58 | -if [ "\$USER" = colab ]; then | ||
59 | - exec /usr/lib/colab/bin/colab-admin "\$@" | ||
60 | -else | ||
61 | - exec sudo -u colab /usr/lib/colab/bin/colab-admin "\$@" | ||
62 | -fi | ||
63 | -EOF | ||
64 | -chmod +x %{buildroot}/%{_bindir}/colab-admin | ||
65 | - | ||
66 | -# install initscript | ||
67 | -install -d -m 0755 %{buildroot}/lib/systemd/system | ||
68 | -install -m 0644 misc/lib/systemd/system/colab.service %{buildroot}/lib/systemd/system | ||
69 | -# install crontab | ||
70 | -install -d -m 0755 %{buildroot}/etc/cron.d | ||
71 | -install -m 0644 misc/etc/cron.d/colab %{buildroot}/etc/cron.d | ||
72 | - | ||
73 | -%clean | ||
74 | -rm -rf $RPM_BUILD_ROOT | ||
75 | -rm -rf %{buildvenv} | ||
76 | - | ||
77 | -%files | ||
78 | -/usr/lib/colab | ||
79 | -%{_bindir}/* | ||
80 | -/etc/cron.d/colab | ||
81 | -/lib/systemd/system/colab.service | ||
82 | - | ||
83 | -%post | ||
84 | -groupadd colab || true | ||
85 | -if ! id colab; then | ||
86 | - useradd --system --gid colab --home-dir /usr/lib/colab --no-create-home colab | ||
87 | -fi | ||
88 | - | ||
89 | -mkdir -p /etc/colab | ||
90 | - | ||
91 | -if [ ! -f /etc/colab/settings.yaml ]; then | ||
92 | - SECRET_KEY=$(openssl rand -hex 32) | ||
93 | - cat > /etc/colab/settings.yaml <<EOF | ||
94 | -## Set to false in production | ||
95 | -DEBUG: true | ||
96 | -TEMPLATE_DEBUG: true | ||
97 | - | ||
98 | -## System admins | ||
99 | -ADMINS: &admin | ||
100 | - - | ||
101 | - - John Foo | ||
102 | - - john@example.com | ||
103 | - - | ||
104 | - - Mary Bar | ||
105 | - - mary@example.com | ||
106 | - | ||
107 | -MANAGERS: *admin | ||
108 | - | ||
109 | -COLAB_FROM_ADDRESS: '"Colab" <noreply@example.com>' | ||
110 | -SERVER_EMAIL: '"Colab" <noreply@example.com>' | ||
111 | - | ||
112 | -EMAIL_HOST: localhost | ||
113 | -EMAIL_PORT: 25 | ||
114 | -EMAIL_SUBJECT_PREFIX: '[colab]' | ||
115 | - | ||
116 | -SECRET_KEY: '$SECRET_KEY' | ||
117 | - | ||
118 | -SITE_URL: 'http://localhost:8001/' | ||
119 | -BROWSERID_AUDIENCES: | ||
120 | - - http://localhost:8001 | ||
121 | -# - http://example.com | ||
122 | -# - https://example.org | ||
123 | -# - http://example.net | ||
124 | - | ||
125 | -ALLOWED_HOSTS: | ||
126 | - - localhost | ||
127 | -# - example.com | ||
128 | -# - example.org | ||
129 | -# - example.net | ||
130 | - | ||
131 | -## Disable indexing | ||
132 | -ROBOTS_NOINDEX: false | ||
133 | - | ||
134 | -## Disable browser id authentication | ||
135 | -# BROWSERID_ENABLED: true | ||
136 | -EOF | ||
137 | - chown root:colab /etc/colab/settings.yaml | ||
138 | - chmod 0640 /etc/colab/settings.yaml | ||
139 | -fi | ||
140 | - | ||
141 | -mkdir -p /etc/colab/settings.d | ||
142 | - | ||
143 | -if [ ! -f /etc/colab/settings.d/00-database.yaml ]; then | ||
144 | - cat > /etc/colab/settings.d/00-database.yaml <<EOF | ||
145 | -DATABASES: | ||
146 | - default: | ||
147 | - ENGINE: django.db.backends.postgresql_psycopg2 | ||
148 | - NAME: colab | ||
149 | - USER: colab | ||
150 | - HOST: localhost | ||
151 | - PORT: 5432 | ||
152 | -EOF | ||
153 | - chown root:colab /etc/colab/settings.d/00-database.yaml | ||
154 | - chmod 0640 /etc/colab/settings.d/00-database.yaml | ||
155 | -fi | ||
156 | - | ||
157 | -# only applies if there is a local PostgreSQL server | ||
158 | -if [ -x /usr/bin/postgres ]; then | ||
159 | - | ||
160 | - # start/enable the service | ||
161 | - postgresql-setup initdb || true | ||
162 | - systemctl start postgresql | ||
163 | - systemctl enable postgresql | ||
164 | - | ||
165 | - if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'colab';")" -eq 0 ]; then | ||
166 | - # create user | ||
167 | - sudo -u postgres -i createuser colab | ||
168 | - fi | ||
169 | - | ||
170 | - if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'colab';")" -eq 0 ]; then | ||
171 | - # create database | ||
172 | - sudo -u postgres -i createdb --owner=colab colab | ||
173 | - fi | ||
174 | - | ||
175 | - colab-admin migrate | ||
176 | -fi | ||
177 | - | ||
178 | -mkdir -p /var/lock/colab | ||
179 | -chown colab:colab /var/lock/colab | ||
180 | - | ||
181 | -mkdir -p /var/lib/colab-assets | ||
182 | -chown colab:colab /var/lib/colab-assets | ||
183 | - | ||
184 | -mkdir -p /usr/share/nginx/ | ||
185 | - | ||
186 | -ln -s /var/lib/colab-assets /usr/share/nginx/colab | ||
187 | - | ||
188 | -yes yes | colab-admin collectstatic | ||
189 | - | ||
190 | -%preun | ||
191 | -systemctl stop colab | ||
192 | -systemctl disable colab |
update_obs.sh
@@ -1,53 +0,0 @@ | @@ -1,53 +0,0 @@ | ||
1 | -#!/bin/bash | ||
2 | - | ||
3 | -which osc || { echo "osc must be installed"; exit 1; } | ||
4 | - | ||
5 | -VERSION=`python setup.py --version` | ||
6 | -PLATFORM=`uname` | ||
7 | - | ||
8 | -pull_obs () { | ||
9 | - if [ -d .obs ] | ||
10 | - then | ||
11 | - osc update .obs/ | ||
12 | - else | ||
13 | - osc checkout isv:spb:colab/colab --output-dir=".obs/" | ||
14 | - fi | ||
15 | -} | ||
16 | - | ||
17 | -update_sdist () { | ||
18 | - rm -fR dist/ | ||
19 | - python setup.py sdist | ||
20 | -} | ||
21 | - | ||
22 | - | ||
23 | -add_to_obs () { | ||
24 | - osc revert .obs/ | ||
25 | - osc rm -f .obs/colab-*.tar.gz | ||
26 | - | ||
27 | - cp dist/colab-*.tar.gz .obs/ | ||
28 | - cp colab.spec .obs/ | ||
29 | - | ||
30 | - osc add .obs/colab-$VERSION.tar.gz | ||
31 | -} | ||
32 | - | ||
33 | - | ||
34 | -update_spec_versions () { | ||
35 | - regex="s/(\%define (unmangled_)?version).*/\1 $VERSION/;" | ||
36 | - if [[ "$PLATFORM" == 'Darwin' ]]; then | ||
37 | - sed -i '' -E "$regex" colab.spec | ||
38 | - else | ||
39 | - sed -i -E "$regex" colab.spec | ||
40 | - fi | ||
41 | -} | ||
42 | - | ||
43 | - | ||
44 | -push_to_obs () { | ||
45 | - osc checkin .obs/ -m "Updated version $VERSION" | ||
46 | -} | ||
47 | - | ||
48 | -update_sdist | ||
49 | -update_spec_versions | ||
50 | - | ||
51 | -pull_obs | ||
52 | -add_to_obs | ||
53 | -push_to_obs |