Commit fd7abf94a2d1af12b83c1fa046959951cc6cb347
Exists in
master
and in
39 other branches
Merge branch 'fix_spec'
Showing
2 changed files
with
48 additions
and
48 deletions
Show diff stats
colab.spec
1 | %define name colab | 1 | %define name colab |
2 | -%define version 2.0a2 | ||
3 | -%define unmangled_version 2.0a2 | ||
4 | -%define release 2 | 2 | +%define version 2.0a3 |
3 | +%define unmangled_version 2.0a3 | ||
4 | +%define release 3 | ||
5 | %define buildvenv /var/tmp/%{name}-%{version} | 5 | %define buildvenv /var/tmp/%{name}-%{version} |
6 | 6 | ||
7 | Summary: Collaboration platform for communities | 7 | Summary: Collaboration platform for communities |
@@ -91,41 +91,23 @@ fi | @@ -91,41 +91,23 @@ fi | ||
91 | 91 | ||
92 | usermod --append --groups mailman colab | 92 | usermod --append --groups mailman colab |
93 | 93 | ||
94 | -# only applies if there is a local PostgreSQL server | ||
95 | -if [ -x /usr/bin/postgres ]; then | ||
96 | - | ||
97 | - # start/enable the service | ||
98 | - postgresql-setup initdb || true | ||
99 | - systemctl start postgresql | ||
100 | - systemctl enable postgresql | ||
101 | - | ||
102 | - if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'colab';")" -eq 0 ]; then | ||
103 | - # create user | ||
104 | - sudo -u postgres -i createuser colab | ||
105 | - fi | ||
106 | - | ||
107 | - if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'colab';")" -eq 0 ]; then | ||
108 | - # create database | ||
109 | - sudo -u postgres -i createdb --owner=colab colab | ||
110 | - fi | ||
111 | - | ||
112 | - mkdir -p /etc/colab | 94 | +mkdir -p /etc/colab |
113 | 95 | ||
114 | - if [ ! -f /etc/colab/settings.yaml ]; then | ||
115 | - SECRET_KEY=$(openssl rand -hex 32) | ||
116 | - cat > /etc/colab/settings.yaml <<EOF | 96 | +if [ ! -f /etc/colab/settings.yaml ]; then |
97 | + SECRET_KEY=$(openssl rand -hex 32) | ||
98 | + cat > /etc/colab/settings.yaml <<EOF | ||
117 | ## Set to false in production | 99 | ## Set to false in production |
118 | DEBUG: true | 100 | DEBUG: true |
119 | TEMPLATE_DEBUG: true | 101 | TEMPLATE_DEBUG: true |
120 | 102 | ||
121 | ## System admins | 103 | ## System admins |
122 | ADMINS: &admin | 104 | ADMINS: &admin |
123 | - - | ||
124 | - - John Foo | ||
125 | - - john@example.com | ||
126 | - - | ||
127 | - - Mary Bar | ||
128 | - - mary@example.com | 105 | +- |
106 | + - John Foo | ||
107 | + - john@example.com | ||
108 | +- | ||
109 | + - Mary Bar | ||
110 | + - mary@example.com | ||
129 | 111 | ||
130 | MANAGERS: *admin | 112 | MANAGERS: *admin |
131 | 113 | ||
@@ -140,13 +122,13 @@ SECRET_KEY: '$SECRET_KEY' | @@ -140,13 +122,13 @@ SECRET_KEY: '$SECRET_KEY' | ||
140 | 122 | ||
141 | SITE_URL: 'http://localhost:8000' | 123 | SITE_URL: 'http://localhost:8000' |
142 | BROWSERID_AUDIENCES: | 124 | BROWSERID_AUDIENCES: |
143 | - - http://localhost:8000 | 125 | +- http://localhost:8000 |
144 | # - http://example.com | 126 | # - http://example.com |
145 | # - https://example.org | 127 | # - https://example.org |
146 | # - http://example.net | 128 | # - http://example.net |
147 | 129 | ||
148 | ALLOWED_HOSTS: | 130 | ALLOWED_HOSTS: |
149 | - - localhost | 131 | +- localhost |
150 | # - example.com | 132 | # - example.com |
151 | # - example.org | 133 | # - example.org |
152 | # - example.net | 134 | # - example.net |
@@ -161,27 +143,45 @@ ROBOTS_NOINDEX: false | @@ -161,27 +143,45 @@ ROBOTS_NOINDEX: false | ||
161 | ## Enabled BROWSER_ID protocol | 143 | ## Enabled BROWSER_ID protocol |
162 | # BROWSERID_ENABLED: True | 144 | # BROWSERID_ENABLED: True |
163 | EOF | 145 | EOF |
164 | - chown root:colab /etc/colab/settings.yaml | ||
165 | - chmod 0640 /etc/colab/settings.yaml | ||
166 | - fi | 146 | + chown root:colab /etc/colab/settings.yaml |
147 | + chmod 0640 /etc/colab/settings.yaml | ||
148 | +fi | ||
167 | 149 | ||
168 | - mkdir -p /etc/colab/settings.d | 150 | +mkdir -p /etc/colab/settings.d |
169 | 151 | ||
170 | - if [ ! -f /etc/colab/settings.d/00-database.yaml ]; then | ||
171 | - cat > /etc/colab/settings.d/00-database.yaml <<EOF | 152 | +if [ ! -f /etc/colab/settings.d/00-database.yaml ]; then |
153 | + cat > /etc/colab/settings.d/00-database.yaml <<EOF | ||
172 | DATABASES: | 154 | DATABASES: |
173 | - default: | ||
174 | - ENGINE: django.db.backends.postgresql_psycopg2 | ||
175 | - NAME: colab | ||
176 | - USER: colab | 155 | +default: |
156 | + ENGINE: django.db.backends.postgresql_psycopg2 | ||
157 | + NAME: colab | ||
158 | + USER: colab | ||
159 | + HOST: localhost | ||
160 | + PORT: 5432 | ||
177 | EOF | 161 | EOF |
178 | - chown root:colab /etc/colab/settings.d/00-database.yaml | ||
179 | - chmod 0640 /etc/colab/settings.d/00-database.yaml | 162 | + chown root:colab /etc/colab/settings.d/00-database.yaml |
163 | + chmod 0640 /etc/colab/settings.d/00-database.yaml | ||
164 | +fi | ||
165 | + | ||
166 | + | ||
167 | +# only applies if there is a local PostgreSQL server | ||
168 | +if [ -x /usr/bin/postgres ]; then | ||
169 | + | ||
170 | + # start/enable the service | ||
171 | + postgresql-setup initdb || true | ||
172 | + systemctl start postgresql | ||
173 | + systemctl enable postgresql | ||
174 | + | ||
175 | + if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'colab';")" -eq 0 ]; then | ||
176 | + # create user | ||
177 | + sudo -u postgres -i createuser colab | ||
180 | fi | 178 | fi |
181 | 179 | ||
182 | -fi | 180 | + if [ "$(sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'colab';")" -eq 0 ]; then |
181 | + # create database | ||
182 | + sudo -u postgres -i createdb --owner=colab colab | ||
183 | + fi | ||
183 | 184 | ||
184 | -if [ -f /etc/colab/settings.yaml ]; then | ||
185 | colab-admin migrate | 185 | colab-admin migrate |
186 | fi | 186 | fi |
187 | 187 |
setup.py
@@ -69,7 +69,7 @@ EXCLUDE_FROM_PACKAGES = [] | @@ -69,7 +69,7 @@ EXCLUDE_FROM_PACKAGES = [] | ||
69 | 69 | ||
70 | setup( | 70 | setup( |
71 | name='colab', | 71 | name='colab', |
72 | - version='2.0a2', | 72 | + version='2.0a3', |
73 | url='https://github.com/colab-community/colab', | 73 | url='https://github.com/colab-community/colab', |
74 | author='Sergio Oliveira', | 74 | author='Sergio Oliveira', |
75 | author_email='sergio@tracy.com.br', | 75 | author_email='sergio@tracy.com.br', |