@@ -83,6 +83,7 @@ def setup_latex():
83
83
fabtools .deb .update_index (quiet = True )
84
84
fabtools .require .deb .package ('texlive-latex-extra' )
85
85
fabtools .require .deb .package ('texinfo' )
86
+ fabtools .require .deb .package ('texlive-fonts-recommended' )
86
87
87
88
88
89
@task
@@ -152,31 +153,6 @@ def clone_qgis(branch='master'):
152
153
run ('git pull' )
153
154
154
155
155
- @task
156
- def install_qgis1_8 ():
157
- """Install QGIS 1.8 under /usr/local/qgis-1.8."""
158
- setup_env ()
159
- add_ubuntugis_ppa ()
160
- setup_ccache ()
161
- sudo ('apt-get build-dep -y qgis' )
162
- fabtools .require .deb .package ('cmake-curses-gui' )
163
- fabtools .require .deb .package ('git' )
164
- fabtools .require .deb .package ('python-gdal' )
165
- clone_qgis (branch = 'release-1_8' )
166
- workspace = '%s/cpp' % env .fg .workspace
167
- code_path = '%s/Quantum-GIS' % workspace
168
- build_path = '%s/build-qgis18' % code_path
169
- build_prefix = '/usr/local/qgis-1.8'
170
- fabtools .require .directory (build_path )
171
- with cd (build_path ):
172
- fabtools .require .directory (
173
- build_prefix ,
174
- use_sudo = True ,
175
- owner = env .fg .user )
176
- run ('cmake .. -DCMAKE_INSTALL_PREFIX=%s' % build_prefix )
177
- run ('make install' )
178
-
179
-
180
156
@task
181
157
def setup_ccache ():
182
158
"""Setup ccache."""
@@ -195,30 +171,10 @@ def setup_inasafe():
195
171
fabtools .require .deb .package ('python-nosexcover' )
196
172
197
173
198
- @task
199
- def install_qgis2 ():
200
- """Install QGIS 2 under /usr/local/qgis-master.
201
-
202
- TODO: create one function from this and the 1.8 function above for DRY.
203
-
204
- """
205
- setup_env ()
206
- setup_ccache ()
207
- add_ubuntugis_ppa ()
208
-
209
- sudo ('apt-get build-dep -y qgis' )
210
-
174
+ def compile_qgis (build_path , build_prefix ):
175
+ fabtools .require .deb .package ('python-gdal' )
211
176
fabtools .require .deb .package ('cmake-curses-gui' )
212
177
fabtools .require .deb .package ('git' )
213
- fabtools .require .deb .package ('python-qscintilla2' )
214
- fabtools .require .deb .package ('libqscintilla2-dev' )
215
- fabtools .require .deb .package ('libspatialindex-dev' )
216
- fabtools .require .deb .package ('python-gdal' )
217
- clone_qgis (branch = 'master' )
218
- workspace = '%s/cpp' % env .fg .workspace
219
- code_path = '%s/Quantum-GIS' % workspace
220
- build_path = '%s/build-master' % code_path
221
- build_prefix = '/usr/local/qgis-master'
222
178
fabtools .require .directory (build_path )
223
179
with cd (build_path ):
224
180
fabtools .require .directory (
@@ -239,9 +195,56 @@ def install_qgis2():
239
195
'-DWITH_INTERNAL_SPATIALITE=ON '
240
196
'%s'
241
197
% (build_prefix , extra ))
242
- run ('cmake .. -DCMAKE_INSTALL_PREFIX=%s' % build_prefix )
198
+ run ('cmake .. %s' % cmake )
199
+ processor_count = run ('cat /proc/cpuinfo | grep processor | wc -l' )
200
+ run ('time make -j %s install' % processor_count )
201
+
243
202
244
- run ('make install' )
203
+ @task
204
+ def install_qgis1_8 ():
205
+ """Install QGIS 1.8 under /usr/local/qgis-1.8."""
206
+ setup_env ()
207
+ add_ubuntugis_ppa ()
208
+ setup_ccache ()
209
+ sudo ('apt-get build-dep -y qgis' )
210
+ clone_qgis (branch = 'release-1_8' )
211
+ workspace = '%s/cpp' % env .fg .workspace
212
+ code_path = '%s/Quantum-GIS' % workspace
213
+ build_path = '%s/build-qgis18' % code_path
214
+ build_prefix = '/usr/local/qgis-1.8'
215
+ compile_qgis (build_path , build_prefix )
216
+
217
+
218
+ @task
219
+ def install_qgis2 ():
220
+ """Install QGIS 2 under /usr/local/qgis-master.
221
+
222
+ TODO: create one function from this and the 1.8 function above for DRY.
223
+
224
+ """
225
+ setup_env ()
226
+ setup_ccache ()
227
+ add_ubuntugis_ppa ()
228
+ sudo ('apt-get build-dep -y qgis' )
229
+
230
+ fabtools .require .deb .package ('python-pyspatialite' )
231
+ fabtools .require .deb .package ('python-psycopg2' )
232
+ fabtools .require .deb .package ('python-qscintilla2' )
233
+ fabtools .require .deb .package ('libqscintilla2-dev' )
234
+ fabtools .require .deb .package ('libspatialindex-dev' )
235
+
236
+ clone_qgis (branch = 'master' )
237
+ workspace = '%s/cpp' % env .fg .workspace
238
+ code_path = '%s/Quantum-GIS' % workspace
239
+ build_path = '%s/build-master' % code_path
240
+ build_prefix = '/usr/local/qgis-master'
241
+ compile_qgis (build_path , build_prefix )
242
+
243
+
244
+ @task
245
+ def setup_qgis2_and_postgis ():
246
+ create_postgis_1_5_db ('gis' , env .user )
247
+ install_qgis2 ()
245
248
246
249
247
250
@task
@@ -269,7 +272,7 @@ def setup_postgres_superuser(user, password=''):
269
272
270
273
271
274
@task
272
- def setup_postgis ():
275
+ def setup_postgis_1_5 ():
273
276
"""Set up postgis.
274
277
275
278
You can call this multiple times without it actually installing all over
@@ -336,14 +339,14 @@ def create_postgis_1_5_template():
336
339
@task
337
340
def create_postgis_1_5_db (dbname , user ):
338
341
"""Create a postgis database."""
339
- setup_postgis ()
340
- require_postgres_user (user )
342
+ setup_postgis_1_5 ()
341
343
setup_postgres_superuser (env .user )
344
+ require_postgres_user (user )
342
345
create_user ()
343
346
fabtools .require .postgres .database (
344
347
'%s' % dbname , owner = '%s' % user , template = 'template_postgis' )
345
348
346
- grant_sql = 'grant all on schema public to %s;' % user
349
+ grant_sql = 'GRANT ALL ON schema public to %s;' % user
347
350
# assumption is env.repo_alias is also database name
348
351
run ('psql %s -c "%s"' % (dbname , grant_sql ))
349
352
grant_sql = (
0 commit comments