Blob Blame History Raw
Name:      grass
Version:   6.3.0
Release:   0.2.RC6%{?dist}
Summary:   GRASS - Geographic Resources Analysis Support System
Group:     Applications/Engineering
License:   GPLv2
Source1:   grass.desktop
Patch0:    grass-pkgconf.patch
Patch1:    grass-shlib-soname.patch
Patch2:    grass-gdilib.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:  proj-nad proj-epsg

BuildRequires:  gettext
BuildRequires:  python-devel
BuildRequires:  bison flex pkgconfig
BuildRequires:  proj-devel proj-nad proj-epsg
BuildRequires:  desktop-file-utils libjpeg-devel
BuildRequires:  libtiff-devel libpng-devel freetype-devel
BuildRequires:  zlib-devel readline-devel ncurses-devel tk-devel 
BuildRequires:  unixODBC-devel mysql-devel postgresql-devel sqlite-devel
BuildRequires:  geos-devel blas-devel lapack-devel fftw2-devel gdal-devel
BuildRequires:  mesa-libGLU-devel mesa-libGLw-devel libXmu-devel lesstif-devel wxPython-devel

GRASS (Geographic Resources Analysis Support System) 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.

%package libs
Summary: GRASS (Geographic Resources Analysis Support System) runtime libraries
Group: Applications/Engineering

%description libs
GRASS (Geographic Resources Analysis Support System) runtime libraries.

%package devel
Summary: GRASS (Geographic Resources Analysis Support System) development headers
Group: Applications/Engineering
Requires: %{name}-libs = %{version}-%{release}
Requires: pkgconfig
Requires: grass-devel lesstif-devel wxPython-devel
Requires: mesa-libGL-devel libX11-devel libXt-devel
Requires: gdal-devel proj-devel xorg-x11-proto-devel

%description devel
GRASS (Geographic Resources Analysis Support System) development headers.

%setup  -n %{name}-%{version}RC6 -q
%patch0 -p0 -b .pkgconf~
%patch1 -p0 -b .shlibver~
%patch2 -p0 -b .gdilib~

# readline requires ncurses, so workaround
# correct mysql_config query
sed -i 's|-lreadline|-lreadline -lcurses|g' configure
sed -i 's|--libmysqld-libs|--libs|g' configure

# preserve timestamp during install process
sed -i 's|^cp |cp -p |' tools/
sed -i 's|-cp |-cp -p |' Makefile

# fix spurious exec flag on source code
chmod -x raster/r.out.gdal/main.c
chmod -x general/g.message/main.c

# convert some offendig file UTF-8
for file in {translators.csv,doc/infrastructure.txt} ; do
   if file $file | grep -q ISO-8859 ; then
      iconv -f ISO-8859-1 -t UTF-8 $file > ${file}.tmp && \
      mv -f ${file}.tmp $file


# code may contain sensible buffer overflows triggered by gcc ssp flag (mustfixupstream).
CFLAGS=`echo %{optflags}|sed -e 's/-Wp,-D_FORTIFY_SOURCE=2 //g'`
# keep timestamp over install section
export INSTALL="%{__install} -c -p"
# correct linkage against
export LDFLAGS="-lm"
export CFLAGS

%configure \
   --enable-shared \
   --with-nls \
   --with-blas \
   --with-lapack \
   --with-fftw \
   --with-gdal \
   --with-proj \
   --with-proj-includes=%{_includedir} \
   --with-proj-libs=%{_libdir} \
   --with-proj-share=%{_datadir}/proj \
   --with-readline \
   --with-readline-includes=%{_includedir}/readline \
   --with-readline-libs=%{_libdir} \
   --with-sqlite \
   --with-odbc \
   --with-odbc-libs=%{_libdir} \
   --with-odbc-includes=%{_includedir} \
   --with-mysql \
   --with-mysql-includes=%{_includedir}/mysql \
   --with-mysql-libs=%{_libdir}/mysql \
   --with-postgres  \
   --with-postgres-includes=%{_includedir}/pgsql \
   --with-postgres-libs=%{_libdir} \
   --with-freetype=yes \
   --with-freetype-includes=%{_includedir}/freetype2 \
   --with-glw \
   --with-glw-libs=%{_libdir} \
   --with-motif \
   --with-opengl \
   --with-x \
   --with-wxwidgets=wx-config \
%ifarch x86_64 ia64 ppc64 s390x sparc64 alpha
   --enable-64bit \
%ifarch sparcv9 sparc64
   --enable-64bit-vis \
   --enable-largefile \
   --with-cxx \

make %{?_smp_mflags}

rm -rf %{buildroot}

# make install
make prefix=%{buildroot}%{_prefix} BINDIR=%{buildroot}%{_bindir} \
     PREFIX=%{buildroot}%{_prefix} install

# changing GISBASE in startup script to point to systems %{_libdir}%{name}-%{version}
mv  %{buildroot}%{_bindir}/grass63 %{buildroot}%{_bindir}/grass63.tmp
cat %{buildroot}%{_bindir}/grass63.tmp | \
    sed -e "1,\$s&^GISBASE.*&GISBASE=%{_libdir}/%{name}-%{version}RC6&" | \
    cat - > %{buildroot}%{_bindir}/grass63
rm  %{buildroot}%{_bindir}/grass63.tmp
chmod +x %{buildroot}%{_bindir}/grass63

# change to wxWidgets by default
cat %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/ | \
sed -e '/ange to wxpython as/,/fi/ {:ack N; /fi/! b ack  s/tcltk/wxpython/}' \
    > %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/
mv -f %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/ \
chmod 744 %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/

# fix docs lookup path
sed -i -e 's/$env(GISBASE)\/docs\//\/usr\/share\/doc\/%{name}-%{version}RC6\/docs\//' \
sed -i -e 's/$env(GISBASE)\/docs\//\/usr\/share\/doc\/%{name}-%{version}RC6\/docs\//' \
sed -i -e 's/$env(GISBASE)\/docs\//\/usr\/share\/doc\/%{name}-%{version}RC6\/docs\//' \
sed -i -e 's|C_BASE="$GISBASE"|C_BASE=\"\/usr\/share\/doc\/%{name}-%{version}RC6\/docs"|g' \
sed -i -e 's|%{name}-%{version}RC6\/docs|%{name}-%{version}RC6|g' \

# make grass libraries available on the system
mv %{buildroot}%{_prefix}/grass-%{version}RC6/lib/ %{buildroot}%{_libdir}

# make grass headers available on the system
mv %{buildroot}%{_prefix}/grass-%{version}RC6/include %{buildroot}%{_prefix}/
rm -rf %{buildroot}%{_includedir}/Make

# make man pages aviable in system, convert some in utf8.
for manpage in `find %{buildroot}%{_prefix}/grass-%{version}RC6/man/man1 -type f` ; do
   if file $manpage | grep -q ISO-8859 ; then
      iconv -f ISO-8859-1 -t UTF-8 $manpage > ${manpage}.tmp && \
      mv -f ${manpage}.tmp $manpage

mkdir -p %{buildroot}%{_datadir}/man/
mv  %{buildroot}%{_prefix}/grass-%{version}RC6/man/* %{buildroot}%{_mandir}
rm -rf %{buildroot}%{_prefix}/grass-%{version}RC6/man
cat ChangeLog_%{version}RC6.gz | gzip -d > ChangeLog_%{version}RC6

# make locales aviable in system, fix issue for pt_BR.
mkdir -p %{buildroot}%{_datadir}/locale/
mv %{buildroot}%{_prefix}/grass-%{version}RC6/locale %{buildroot}%{_datadir}/
mv %{buildroot}%{_datadir}/locale/pt_br %{buildroot}%{_datadir}/locale/pt_BR

# pack lang sets
%find_lang grassmods
%find_lang grasslibs
%find_lang grasswxpy
cat grassmods.lang > %{name}.lang
cat grasslibs.lang >> %{name}.lang
cat grasswxpy.lang >> %{name}.lang

# install pkg-config file
mkdir -p %{buildroot}%{_libdir}/pkgconfig
install -p -m 644 grass.pc %{buildroot}%{_libdir}/pkgconfig/

# install desktop icon
mkdir  %{buildroot}%{_datadir}/pixmaps/
install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/grass.png
desktop-file-install --vendor="fedora" \
        --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}

# fixup spurious exec flags here
find %{buildroot} -name "*.tcl" -exec chmod +r-x '{}' \;
chmod -x dist.*/docs/html/gis.m.html
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/wxpython/gui_modules/
chmod -x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/configIndex
chmod -x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/nviz_params
chmod -x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/tclIndex
chmod -x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/panelIndex
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/gem/skeleton/post
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/gem/skeleton/uninstall
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/g.mapsets.tcl
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/dm/tksys.tcl
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/gm/tksys.tcl
chmod +x %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/gm/animate.tcl
# strip down a python
strip %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}//wxpython/vdigit/

# fixup few nviz script header, it will anyway allways executed by nviz
for nviz in {script_play,nviz2.2_script,script_tools,script_file_tools,script_get_line}; do
 cat %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/$nviz \
  | grep -v '#!nviz' > %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/$nviz.tmp 
 mv  %{buildroot}%{_prefix}/grass-%{version}RC6%{_sysconfdir}/nviz2.2/scripts/$nviz.tmp \

# switch to the system wide docs to be FHS compliant
rm -rf %{buildroot}%{_prefix}/%{name}-%{version}RC6/docs

# hide GISBASE into systems %{_libdir} insted, to be FHS compliant
mv %{buildroot}%{_prefix}/%{name}-%{version}RC6 %{buildroot}%{_libdir}/

# fix fontpath
sed -i -e 's|%{buildroot}%{_prefix}/%{name}-%{version}RC6|%{_libdir}/%{name}-%{version}RC6|' \

rm -rf %{buildroot}

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%files -f %{name}.lang
%doc REQUIREMENTS.html CHANGES translators.csv
%doc doc dist.*/docs
%dir %{_libdir}/%{name}-%{version}RC6

%files libs

%files devel
%doc ChangeLog_%{version}RC6 doc/raster doc/vector
%exclude %{_libdir}/libgrass_*.a
%exclude %{_libdir}/libiostream.a
%dir %{_includedir}/%{name}
%dir %{_includedir}/%{name}/dgl
%dir %{_includedir}/%{name}/rtree
%dir %{_includedir}/%{name}/vect

* Thu Mar 27 2008 Balint Cristian <> 6.3.0-0.2.RC6
- BuildRequire: python-devel

* Thu Mar 27 2008 Balint Cristian <> 6.3.0-0.1.RC6
- new branch release
- enable new wxWidgets support
- set wxpython as default instead of tcltk
- fix missing GDI unaviable on unices
- smp build is safe now
- r.terraflow license problem fixed
- no fedora custom packs anymore, all license clear

* Tue Feb 19 2008 Fedora Release Engineering <> - 6.2.3-2
- Autorebuild for GCC 4.3

* Sat Jan 5 2008 Devrim GUNDUZ <> 6.2.3-1
- Update to 6.2.3

* Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 6.2.2-3
- Rebuild for deps

* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 6.2.2-2
- Rebuild for selinux ppc32 issue.

* Wed Jul 25 2007 Balint Cristian <> 6.2.2-1
- new upstream stable version

* Thu Jun 07 2007 Balint Cristian <> 6.2.2-0.2.RC1
- fix version string in desktop file
- add RO lang to desktop file
- dropped one patch, seems fixed upstream.

* Fri Jun 01 2007 Balint Cristian <> 6.2.2-0.1.RC1
- 6.2.2 rc1 bugfix release
- fix docbase lookup path for g.manual

* Sat May 12 2007 Balint Cristian <> 6.2.1-16
- fix koji build for ppc ppc64, dont use _host macro anymore.

* Sat May 12 2007 Balint Cristian <> 6.2.1-15
- rebuild against new gdal

* Mon Apr 02 2007 Balint Cristian <> 6.2.1-14
- remove bogus requirement in grass-libs
- rename gem loader to gem62

* Tue Mar 20 2007 Balint Cristian <> 6.2.1-13
- see README-fedora for license fix in redistributed tarball
- r.terraflow plugin removal from -fedora tarball

* Fri Mar 13 2007 Balint Cristian <> 6.2.1-12
- more spec review

* Fri Mar 13 2007 Balint Cristian <> 6.2.1-11
- more spec review

* Fri Mar 13 2007 Balint Cristian <> 6.2.1-10
- more spec review

* Fri Mar 2 2007 Balint Cristian <> 6.2.1-9
- require missing libjpeg-devel

* Tue Feb 27 2007 Balint Cristian <> 6.2.1-8
- more buildfixes, should build now in mock for any arches
- estetic changes in spec file

* Sat Feb 25 2007 Balint Cristian <> 6.2.1-7
- fix mock build on any arch.

* Sat Feb 23 2007 Balint Cristian <> 6.2.1-6
- fix mock build, more spec cleanup.
- fix docs lookup from g.manual
- disable fedora c flags, ssp break functionality for now.

* Sat Feb 23 2007 Balint Cristian <> 6.2.1-5
- use macros if posible.

* Sat Feb 10 2007 Balint Cristian <> 6.2.1-4
- fix more nits in specs
- fix require list.

* Fri Feb 09 2007 Balint Cristian <> 6.2.1-3
- fix more nits in specs

* Wed Feb 07 2007 Balint Cristian <> 6.2.1-2
- fix nits in specs
- disable static libs pack
- use macros in file lists if possible.

* Wed Feb 07 2007 Balint Cristian <> 6.2.1-1
- first build for fedora-extras
- enable all options for packages aviable in fedora
- fix buffer overflow problem during compile with ssp
- fix paths in pkconfig file
- add desktop icon
- relocate lang and man page folders in the right places
- sanitize shared library names, fix -soname versioning in libs.
- fix some non utf8 manpage
- fix pt_BR locale path
- fix some nviz script headers
- fix exec rights across some scripts, remove exec from tcl scripts
- move out GISBASE in lib and fixup script enviroment for this
- switch help-doc to datadir/doc/grass and fixit up in grass paths