File grass.spec of Package grass
#
# spec file for package grass
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the GRASS GIS package itself (unless the
# license for the GRASS GIS package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define shortver 64
Name: grass
Version: 6.4.4
Release: 1
License: GPL-2.0
Summary: GRASS - Geographic Resources Analysis Support System
Url: http://grass.osgeo.org/
Group: Productivity/Scientific/Other
Source: grass-%{version}.tar.gz
Source1: grass.rpmlintrc
Requires: unixODBC
Requires: xterm
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: python >= 2.4
Requires: python-numpy
Requires: python-opengl
Requires: python-wxWidgets
Requires: python-xml
Requires: readline
Requires: proj
Requires: grass-docs
%if 0%{?suse_version} <= 1030
BuildRequires: python-elementtree
%endif
BuildRequires: bison
BuildRequires: flex
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: libgdal-devel >= 1.6.0
BuildRequires: libgeos-devel >= 3
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: man
BuildRequires: proj
BuildRequires: readline-devel
BuildRequires: netcdf-devel
BuildRequires: libproj-devel
BuildRequires: libtiff-devel
BuildRequires: mysql-devel
BuildRequires: ncurses-devel >= 5.5
BuildRequires: postgresql-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
BuildRequires: tk-devel
BuildRequires: blas-devel
BuildRequires: unixODBC-devel
BuildRequires: xorg-x11-Mesa-devel
BuildRequires: xorg-x11-libXmu-devel
BuildRequires: zlib-devel
%if 0%{?suse_version} >= 1010 && 0%{?suse_version} < 1130
BuildRequires: fftw-devel
%else
BuildRequires: fftw3-devel
%endif
BuildRequires: -post-build-checks
BuildRequires: fdupes
BuildRequires: python-devel >= 2.4
BuildRequires: python-opengl
BuildRequires: python-wxWidgets
BuildRequires: python-xml
BuildRequires: wxWidgets-devel
%if 0%{?suse_version} >= 1140
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
%endif
Obsoletes: grass7
%if 0%{?suse_version} >= 1210
%define _use_internal_dependency_generator 0
%define our_find_requires %{_builddir}/%{name}-%{version}/find_requires
%endif
%package docs
Summary: Documentation for grass
Group: Productivity/Scientific/Other
Requires: grass = %{version}
%package devel
Summary: Development files for grass
Group: Productivity/Scientific/Other
Requires: grass = %{version}
%description
GRASS (Geographic Resources Analysis Support System), commonly
referred to as GRASS, is a Geographic Information System
(GIS) used for geospatial data management and analysis, image
processing, graphics/maps production, spatial modeling, and
visualization. GRASS is currently used in academic and commercial
settings around the world, as well as by many governmental agencies
and environmental consulting companies.
%description devel
This package contains the development files for grass
%description docs
This package contains the HTML documentation files for grass
%prep
%setup -q -n grass-%{version}
%define grasver -@GRASS_VERSION_MAJOR@.@GRASS_VERSION_MINOR@.@GRASS_VERSION_RELEASE@
%define grasver2 '-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}'
sed -i s/%{grasver}//g include/Make/Platform.make.in
sed -i s/%{grasver}//g grass.pc.in
sed -i s/%{grasver2}//g configure
sed -i s/%{grasver2}//g Makefile
%define _prefix /opt
%define grassdir %{_prefix}/grass
%define grasslib %{_prefix}/grass/lib
#configure with shared libs:
CFLAGS="-O2" ./configure \
--prefix=%{_prefix} \
--enable-shared \
--enable-largefile \
--with-proj-share=/usr/share/proj \
--with-cxx \
--with-blas \
--with-gdal=/usr/bin/gdal-config \
--with-postgres --with-postgres-includes=/usr/include/pgsql \
--with-mysql --with-mysql-includes=/usr/include/mysql \
--with-fftw \
--with-readline \
--with-netcdf \
--with-curses \
--with-geos \
--with-nls \
--with-sqlite \
--with-freetype \
--with-freetype-includes=/usr/include/freetype2 \
--with-wxwidgets \
--with-odbc \
--with-python
%if 0%{?suse_version} >= 1210
cat <<EOF >%{our_find_requires}
#!/bin/sh
exec %{__find_requires} | /bin/egrep -v '^nviz$'
exit 0
EOF
chmod +x %{our_find_requires}
%define __find_requires %{our_find_requires}
%endif
%build
make prefix=%{_prefix} BINDIR=%{_bindir} PREFIX=%{_prefix} %{?_smp_mflags}
%install
make prefix=%{buildroot}%{_prefix} BINDIR=%{buildroot}%{_bindir} \
PREFIX=%{buildroot}%{_prefix} install
# changing GISBASE in startup script (deleting %{buildroot} from path)
sed -i s:%{buildroot}::g %{buildroot}%{_bindir}/grass%{shortver}
ln -sf grass%{shortver} %{buildroot}%{_bindir}/grass
# make grass libraries available on the system
install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo %{grasslib} >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/grass-%{version}.conf
pushd %{buildroot}%{grassdir}/man
gzip */*
popd
pushd %{buildroot}%{grassdir}/etc/gem/skeleton/
chmod +x uninstall
chmod +x post
popd
%fdupes -s %{buildroot}
%files devel
%defattr(-,root,root)
%{grassdir}/include
%{grasslib}/*.a
%files docs
%defattr(-,root,root)
%{grassdir}/docs
%{grassdir}/man
%files
%defattr(-,root,root)
%{_sysconfdir}/ld.so.conf.d/grass-%{version}.conf
%{grassdir}/bin/*
%{grassdir}/etc/*
%{grassdir}/scripts/*
%{grassdir}/bwidget/*
%{grassdir}/locale/*
%{grassdir}/tools/mkhtml.sh
%{grassdir}/tools/g.echo
%exclude %{grassdir}/tools/g.html2man
%{grassdir}/tools/g.html2man
%{grassdir}/driver/*
%{grassdir}/fonts/*
%{grasslib}/*.so
%{_bindir}/grass*
#%exclude %{grasslib}/*[a-zA-Z].so
%{grassdir}/AUTHORS
%{grassdir}/CHANGES
%{grassdir}/COPYING
%{grassdir}/GPL.TXT
%{grassdir}/REQUIREMENTS.html
%{grassdir}/contributor*.csv
%{grassdir}/translators.csv
%defattr(755,root,root)
%{_bindir}/*
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog