1
# GRASS 6.X RPM spec file for ITC
2
# This file is Free Software under GNU GPL v>=2.
3
# Derived from grass_FC4.spec
5
# Define snap to use the snapshot version, change cvssnapshot and cvsversion accordingly
14
%define with_postgres 1
15
%define with_largefiles 1
17
%define with_readline 0
20
# Turn off automatic generation of dependencies to
21
# avoid a problem with libgrass* dependency issues.
22
# Other dependencies listed below.
24
%define _use_internal_dependency_generator 0
26
# Filter out the library number on provides
27
%define __find_provides %{_tmppath}/find_provides.sh
29
# Disable the _find_requires macro.
30
%define __find_requires %{nil}
33
%if "%{snap:1}" == "0"
34
%define PACKAGE_VERSION 6.2.2
35
%define PACKAGE_RELEASE 1
38
%define cvssnapshot 2006_11_03
39
%define cvsversion 6.2.2
40
%define PACKAGE_VERSION %{cvsversion}
41
%define PACKAGE_RELEASE 1
46
#Query the RPM database to find which redhat/fedora release we are running.
47
%if %(rpmquery fedora-release | grep -cv 'not installed$')
49
%define VER1 %(rpmquery --qf '%{VERSION}' fedora-release)
51
%if %(rpmquery redhat-release | grep -v 'not installed$' | grep -c -e '-[0-9][DAEW]')
53
%define VER1 %(rpmquery --qf '%{VERSION}' redhat-release|cut -c1)
55
%if %(rpmquery sl-release | grep -v 'not installed$' | grep -c -e '-[0-9]')
57
%define VER1 %(rpmquery --qf '%{VERSION}' sl-release|cut -c1-)
61
Summary: GRASS - Geographic Resources Analysis Support System
63
Version: %PACKAGE_VERSION
64
Epoch: %PACKAGE_RELEASE
65
%{?FCL:Release: %{PACKAGE_RELEASE}.fc%{VER1}}
66
%{?ENT:Release: %{PACKAGE_RELEASE}.E%{VER1}}
67
%{?SLC:Release: %{PACKAGE_RELEASE}.SL%{VER1}}
68
%if "%{snap:1}" == "0"
69
Source: http://grass.itc.it/grass62/source/grass-%{PACKAGE_VERSION}.tar.bz2
71
Source: http://grass.itc.it/grass62/source/snapshot/grass-%{cvsversion}.cvs_src_snapshot_%{cvssnapshot}.tar.gz
73
License: GPL, Copyright by the GRASS Development Team
74
Group: Sciences/Geosciences
75
Packager: Brad Douglas <rez@touchofmadness.com>
76
URL: http://grass.itc.it/index.php
77
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)/%{name}-%{version}
81
BuildRequires: gdal-devel >= 1.3
83
BuildRequires: tcl-devel >= 8.3
85
BuildRequires: tk-devel >= 8.3
86
Requires: proj >= 4.5.0
87
BuildRequires: proj-devel >= 4.5.0
88
Requires: geos >= 2.2.3
89
BuildRequires: geos-devel >= 2.2.3
90
#Requires: freetype >= 2.3.0
91
#BuildRequires: freetype-devel >= 2.3.0
92
Requires: freetype >= 2.2.0
93
BuildRequires: freetype-devel >= 2.2.0
95
Requires: mesa-libGL >= 6.5
96
BuildRequires: mesa-libGL-devel >= 6.5
97
Requires: libX11 >= 1.0
98
BuildRequires: libX11-devel >= 1.0
99
Requires: sqlite >= 3.3
100
BuildRequires: sqlite-devel >= 3.3
101
%if "%{with_motif}" == "1"
102
Requires: lesstif >= 0.95
103
BuildRequires: lesstif-devel >= 0.95
105
#Requires: glibc >= 2.6
106
#BuildRequires: glibc-devel >= 2.6
107
Requires: glibc >= 2.5
108
BuildRequires: glibc-devel >= 2.5
109
Requires: libgcc >= 4.1.0
110
#Requires: ncurses >= 5.6
111
#BuildRequires: ncurses-devel >= 5.6
112
Requires: ncurses >= 5.5
113
BuildRequires: ncurses-devel >= 5.5
114
Requires: libpng >= 1.2.12
115
BuildRequires: libpng-devel >= 1.2.12
117
BuildRequires: libjpeg-devel
118
Requires: libstdc++ >= 4.1
119
BuildRequires: libstdc++-devel >= 4.1
120
Requires: libtiff >= 3.8
121
BuildRequires: libtiff-devel >= 3.8
122
Requires: zlib >= 1.2
123
BuildRequires: zlib-devel >= 1.2
124
%if "%{with_readline}" == "1"
125
Requires: readline >= 5.1
126
BuildRequires: readline-devel >= 5.1
128
%if "%{with_fftw3}" == "1"
129
Requires: fftw3 >= 3.1
130
BuildRequires: fftw3-devel >= 3.1
132
%if "%{with_blas}" == "1"
133
Requires: blas >= 3.1
134
BuildRequires: blas >= 3.1
135
Requires: lapack >= 3.1
136
BuildRequires: lapack >= 3.1
138
%if "%{with_ffmpeg}" == "1"
140
BuildRequires: ffmpeg-devel
142
%if "%{with_odbc}" == "1"
143
Requires: unixODBC >= 2.2
144
BuildRequires: unixODBC-devel >= 2.2
146
%if "%{with_mysql}" == "1"
148
BuildRequires: mysql-devel
150
%if "%{with_postgres}" == "1"
151
#Requires: postgresql-libs >= 8.2
152
#BuildRequires: postgresql-devel >= 8.2
153
Requires: postgresql-libs >= 8.1
154
BuildRequires: postgresql-devel >= 8.1
156
Requires: python >= 2.4
157
BuildRequires: python-devel >= 2.4
164
# clean up of provides for other packages: gdal-grass, qgis etc.
168
GRASS (Geographic Resources Analysis Support System) is a Geographic
169
Information System (GIS) used for geospatial data management and
170
analysis, image processing, graphics/maps production, spatial
171
modeling, and visualization. GRASS is currently used in academic and
172
commercial settings around the world, as well as by many governmental
173
agencies and environmental consulting companies.
177
%if "%{snap:1}" == "0"
178
%setup -n %{name}-%{version} ## name the directory
180
%setup -n %{name}-%{version}.cvs_src_snapshot_%{cvssnapshot} ## name the directory
184
# Filter out library number
186
cat > %{_tmppath}/find_provides.sh <<EOF
188
/usr/lib/rpm/redhat/find-provides | sed -e 's/%{version}\.//g' | sort -u
191
chmod ugo+x %{_tmppath}/find_provides.sh
194
# Edit configure script for libraries
196
%if "%{with_readline}" == "1"
197
sed -i 's/-lreadline/-lreadline -lcurses/g' configure
203
#configure with shared libs:
205
#%if "%{FCL}" == "1" && "%{VER1}" == "4"
206
#CFLAGS="-O2 -g -Wall"
208
#CFLAGS="-O2 -g -Wall -Werror-implicit-function-declaration -fno-common"
211
CXXFLAGS="-O2 -g -Wall"
215
--with-includes=%{_includedir} \
221
%if "%{with_postgres}" == "1"
223
--with-postgres-includes=%{_includedir}/pgsql \
224
--with-postgres-libs=%{_libdir} \
228
%if "%{with_mysql}" == "1"
230
--with-mysql-includes=%{_includedir}/mysql \
231
--with-mysql-libs=%{_libdir}/mysql \
236
%if "%{with_ffmpeg}" == "1"
238
--with-ffmpeg-includes=%{_includedir}/ffmpeg \
239
--with-ffmpeg-libs=%{_libdir} \
244
%if "%{with_odbc}" == "1"
246
--with-odbc-libs=%{_libdir} \
247
--with-odbc-includes=%{_includedir} \
251
%if "%{with_fftw3}" == "1"
256
%if "%{with_blas}" == "1"
263
%if "%{with_motif}" == "1"
269
--with-freetype-includes=%{_includedir}/freetype2 \
272
%if "%{with_readline}" == "1"
274
--with-readline-includes=%{_includedir}/readline \
275
--with-readline-libs=%{_libdir} \
282
--with-gdal=/usr/bin/gdal-config \
284
--with-proj-includes=%{_includedir} \
285
--with-proj-libs=%{_libdir} \
286
--with-proj-share=%{_datadir}/proj \
287
%if "%{with_largefiles}" == "1"
293
#configure with shared libs:
295
make prefix=%{buildroot}%{_prefix} BINDIR=%{buildroot}%{_bindir} \
296
PREFIX=%{buildroot}%{_prefix}
302
make prefix=%{buildroot}%{_prefix} BINDIR=%{buildroot}%{_bindir} \
303
PREFIX=%{buildroot}%{_prefix} install
305
# changing GISBASE in startup script (deleting %{buildroot} from path)
306
mv %{buildroot}%{_bindir}/grass%{shortver} %{buildroot}%{_bindir}/grass%{shortver}.tmp
308
cat %{buildroot}%{_bindir}/grass%{shortver}.tmp | \
309
sed -e "1,\$s&^GISBASE.*&GISBASE=%{_prefix}/grass-%{version}&" | \
310
cat - > %{buildroot}%{_bindir}/grass%{shortver}
312
rm %{buildroot}%{_bindir}/grass%{shortver}.tmp
313
chmod +x %{buildroot}%{_bindir}/grass%{shortver}
315
# Make grass libraries available on the system
316
install -d %{buildroot}/etc/ld.so.conf.d
317
echo %{_prefix}/grass-%{version}/%{_lib} >> %{buildroot}/etc/ld.so.conf.d/grass-%{version}.conf
320
if [ ! -d %{buildroot}%{_libdir}/pkgconfig ]
322
mkdir -p %{buildroot}%{_libdir}/pkgconfig
324
install -m 644 grass.pc %{buildroot}%{_libdir}/pkgconfig/
330
#rm -rf grass-%{version}
333
%defattr(-,root,root)
335
%doc AUTHORS COPYING GPL.TXT README REQUIREMENTS.html
337
%attr(0755,root,root)
339
%{_bindir}/grass%{shortver}
341
%{_prefix}/grass-%{version}
342
%{_libdir}/pkgconfig/grass.pc
343
/etc/ld.so.conf.d/grass-%{version}.conf
345
%post -p /sbin/ldconfig
347
%postun -p /sbin/ldconfig
350
* Tue Jul 24 2007 Brad Douglas <rez@touchofmadness.com>
351
- Commented out FLAGS section - use default %configure eval
352
- Reorganized configure layout and specified all options
353
* Tue Jul 17 2007 Brad Douglas <rez@touchofmadness.com>
354
- Conditionalized readline dependency
355
* Tue Dec 12 2006 Brad Douglas <rez@touchofmadness.com>
356
- Conditionalized openmotif/lesstif dependency for (>=FC5)
357
* Tue Nov 15 2006 Brad Douglas <rez@touchofmadness.com>
358
- sed configure to add ncurses dependency for readline (>=FC5)
359
* Fri Oct 20 2006 Markus Neteler <neteler@itc.it>
360
- fftw3 conditionalized (needed for FC4); less strict compiler flags
361
* Tue Oct 17 2006 Roberto Flor <flor@itc.it>
362
- Moved to 6.2.0RC3, enabled ffmpeg, added snapshot/version flag
363
* Tue Mar 17 2006 Roberto Flor <flor@itc.it>
364
- Added with/without option
365
- Added cvs snapshot option
366
- Fixed a lot of inconsistency on x86_64 lib
367
* Tue Feb 28 2006 Roberto Flor <flor@itc.it>
368
- Small changes and cleanup. Requires FC4 or RH Enterprise 4.
369
- Dirty fix for provides error
370
* Thu Oct 12 2005 Markus Neteler <neteler@itc.it>
371
- First build of RPM for Fedora Core 4.
372
* Thu Mar 30 2005 Craig Aumann <caumann@ualberta.ca>
373
- First build of RPM for Fedora Core 3.
374
* Wed Sep 01 2004 Bernhard Reiter <bernhard@intevation.de>
375
- made ready to be checked into GRASS CVS: added header, disabled Patch1
376
* Tue Aug 10 2004 Silke Reimer <silke.reimer@intevation.net>
377
- small changes to fit to Fedora naming conventions
378
* Thu Jul 01 2004 Silke Reimer <silke.reimer@intevation.net>