Author Topic: qgis and gdal  (Read 1911 times)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
qgis and gdal
« on: November 09, 2009, 11:02:27 AM »
I'm trying to upate qgis and gdal.

qgis:
Code: [Select]
+ export CPPFLAGS
+ %setup_compile_flags
/home/neal/src/tmp/rpm-tmp.86563: line 34: fg: no job control

qgis spec:
Code: [Select]
%define __libtoolize /bin/true
%define libmsexport %mklibname msexport 1
%define libnamegrass %mklibname %{name}grass 0
%define libqgis %mklibname qgis 0
%{!?grass:%global grass grass64}

#ciftsio temp fix - explicit requires on dev pacakge
%define _requires_exceptions .*libgrass_.*\\|devel(libcfitsio)

Name: qgis
Version: 1.0.2
Release: %mkrel 4
Summary: Geographic Information System for Linux/Unix
Summary(de): Geografisches Information System für Linux/Unix.
Group: Sciences/Geosciences
URL: http://www.qgis.org/
Source: http://download.osgeo.org/qgis/src/qgis_%{version}.tar.gz
Patch1: qgis_1.0.0-manpage-name.patch
Patch2: qgis_1.0.0-linkage.patch
License: GPLv2+
Obsoletes: %{libqgis}
Obsoletes: %{libmsexport}
Requires: python-BioSQL
Requires: postgis
BuildRequires: cmake
BuildRequires: grass
BuildRequires: gdal-devel
BuildRequires: geos-devel
BuildRequires: proj-devel
BuildRequires: expat-devel
BuildRequires: gsl-devel
BuildRequires: cfitsio-devel
BuildRequires: ImageMagick
BuildRequires: flex
BuildRequires: bison
BuildRequires: mlocate
BuildRequires: postgresql-devel
BuildRequires: postgis-devel
BuildRequires: netcdf-devel
BuildRequires: qt4-devel
BuildRequires: qt4-linguist
BuildRequires: python-sip
BuildRequires: python-qt4
BuildRequires: python-BioSQL
%py_requires -d
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
Quantum GIS (QGIS) is designed to be a Geographic Information System (GIS)
built for Linux/Unix. QGIS will offer support for vector and raster formats.
Currently QGIS supports shapefiles and PostgreSQL/PostGIS layers. 

Planned features include:

    * Read and edit shapefiles
    * Display georeferenced rasters (tiff, png, geotiff)
    * Plugins to dynamically add new functionality to the application
    * Support for database tables
    * Support for spatially enabled tables in PostgreSQL using PostGIS
    * Map output
    * Script engine
    * Metadata support

%description -l de
Quantum GIS (QGIS) wurde als geografisches Informationssystem (GIS)
für Linux/Unix entwickelt.QGIS bietet Unterstützung für Vektor- und Raster Formate.
Derzeit unterstützt QGIS, Shapefiles (ein Geodatenformat) und PostgreSQL/PostGIS Ebenen.

Die geplanten enthaltenen Funktionen:

    * Lesen und bearbeiten von Shapefiles
    * Anzeigen von Georeferenzierten Rastern (Tiff, Png, geotiff)
    * Erweiterungen, um der Anwendung dynamisch neue Funktionen hinzufügen zu können.
    * Unterstützung von Datenbanktabellen
    * Unterstützung, um räumliche Tabellen in PostgreSQL unter Verwendung von PostGIS zu ermöglichen
    * Ausgeben von Karten
    * Skript Engine
    * Unterstützung von Metadaten

%post
%update_menus
/sbin/ldconfig

%postun
%clean_menus
/sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_bindir}/%{name}_help
%{_libdir}/lib%{name}_*.so.*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/libcoordinatecaptureplugin.so
%{_libdir}/%{name}/libcopyrightlabelplugin.so
%{_libdir}/%{name}/libdelimitedtextplugin.so
%{_libdir}/%{name}/libdelimitedtextprovider.so
%{_libdir}/%{name}/libdxf2shpconverterplugin.so
%{_libdir}/%{name}/libgeorefplugin.so
%{_libdir}/%{name}/libgpsimporterplugin.so
%{_libdir}/%{name}/libgpxprovider.so
%{_libdir}/%{name}/libgridmakerplugin.so
%{_libdir}/%{name}/libinterpolationplugin.so
%{_libdir}/%{name}/libmemoryprovider.so
%{_libdir}/%{name}/libnortharrowplugin.so
%{_libdir}/%{name}/libogrconverterplugin.so
%{_libdir}/%{name}/libogrprovider.so
%{_libdir}/%{name}/libpostgresprovider.so
%{_libdir}/%{name}/libquickprintplugin.so
%{_libdir}/%{name}/libscalebarplugin.so
%{_libdir}/%{name}/libspitplugin.so
%{_libdir}/%{name}/libwfsplugin.so
%{_libdir}/%{name}/libwfsprovider.so
%{_libdir}/%{name}/libwmsprovider.so
%{_datadir}/%{name}/doc
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/i18n
%{_datadir}/%{name}/images
%{_datadir}/%{name}/resources
%{_datadir}/%{name}/svg
%{_datadir}/%{name}/themes
%{_mandir}/man1/*
%exclude %{_datadir}/%{name}/themes/default/grass
%exclude %{_datadir}/%{name}/themes/classic/grass
%exclude %{_datadir}/%{name}/themes/gis
%exclude %{_datadir}/%{name}/themes/nkids
%{_iconsdir}/hicolor/*/apps/*
%doc AUTHORS BUGS ChangeLog README TODO

#---------------------------------------------------------

%package devel
Summary: Development libraries and headers for QGIS
Summary(de): Bibliotheken zur Entwicklung und Header für QGIS
Group: Sciences/Geosciences
Requires: qgis
Obsoletes: %{_lib}qgis-devel
Conflicts: qgis < 0.11.0
Conflicts: qgiss-grass < 0.11.0
%description devel
Development headers for QGIS

%description -l de devel
Bibliotheken zur Entwicklung und Header für QGIS

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/lib%{name}_*.so
%{_libdir}/libqgisgrass.so
%{_libdir}/libqgispython.so

#---------------------------------------------------------

%package grass
Summary: QGIS plugins for accessing GRASS data
Summary(de): QGIS GRASS-Plugins für den Zugriff auf Daten
Group: Sciences/Geosciences
Obsoletes: %{libnamegrass}
Requires: grass
Conflicts: qgis < 0.11.0

%description grass
This package provides plugins for QGIS that provide access to GRASS data from
within QGIS.

%description -l de grass
Dieses Paket enthält Plugins für QGIS, die Zugriff auf Daten von GRASS
innerhalb von QGIS.

%files grass
%defattr(-,root,root)
%{_libdir}/libqgisgrass.so.*
%{_libdir}/%{name}/libgrass*.so
%{_datadir}/%{name}/grass
%{_datadir}/%{name}/themes/default/grass
%{_datadir}/%{name}/themes/classic/grass

#---------------------------------------------------------

%package python
Summary: Python integration and plugins for qgis
Summary(de): Python-Integration und Plugins für QGIS
Group: Sciences/Geosciences
Requires: %{name} = %{version}-%{release}
Requires: python-sip
Requires: python-qt4
Conflicts: qgis < 0.11.0

%description python
Python integration and plugins for qgis

%description -l de python
Python-Integration und Plugins für QGIS
%files python
%defattr(-,root,root)
%{_libdir}/libqgispython.so.*
%{_datadir}/%{name}/python

#---------------------------------------------------------

%package theme-nkids
Summary: Addtional theme for qgis - nkids
Summary(de): Zusätzliche Themes für qgis - nkids
Group: Sciences/Geosciences
Requires: %{name} = %{version}-%{release}
Conflicts: qgis < 1.0.0-3

%description theme-nkids
Addtional theme for qgis - nkids

%description -l de theme-nkids
Zusätzliche Themes für qgis - nkids

%files theme-nkids
%defattr(-, root, root, -)
%{_datadir}/%{name}/themes/nkids

#---------------------------------------------------------

%package theme-gis
Summary: Addtional theme for qgis - gis
Summary(de): Zusätzliche Themes für qgis - gis
Group: Sciences/Geosciences
Requires: %{name} = %{version}-%{release}
Conflicts: qgis < 1.0.0-3

%description theme-gis
Addtional theme for qgis - gis

%description -l de theme-gis
Zusätzliche Themes für qgis - gis

%files theme-gis
%defattr(-, root, root, -)
%{_datadir}/%{name}/themes/gis

#---------------------------------------------------------

%prep
%setup -q -n %{name}-%{version}
%patch1 -p0
%patch2 -p0 -b .link

# these translations have dup messages
rm -f i18n/qgis_mn.ts i18n/qgis_pt_BR.ts i18n/qgis_lv.ts i18n/qgis_it.ts i18n/qgis_fr.ts i18n/qgis_lo.ts i18n/qgis_sk.ts

%build
%cmake_qt4 \
-DQGIS_LIB_SUBDIR=%{_lib} \
-DQGIS_PLUGIN_SUBDIR=%{_lib}/qgis \
-DGRASS_PREFIX=%{_libdir}/%{grass}

%make

%install
rm -rf %{buildroot}
%makeinstall_std -C build

mv %{buildroot}/%{_prefix}/man %{buildroot}/%{_datadir}

mkdir -p %{buildroot}/%{_datadir}/applications
cat > %{buildroot}/%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=Quantum GIS
Comment=Quantum Geographic Information System
Comment[de]=Quantum geografisches Informationssystem
Exec=%{_bindir}/%{name}
Icon=%{name}
Terminal=false
Type=Application
Categories=X-MandrivaLinux-MoreApplications-Sciences-Geosciences;Science;
EOF

# icon
mkdir -p %{buildroot}%{_iconsdir}/hicolor/{48x48,32x32,16x16}/apps
convert -scale 48 %{buildroot}%{_datadir}/%{name}/doc/images/qgis_new_80pct.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{name}.png
convert -scale 32 %{buildroot}%{_datadir}/%{name}/doc/images/qgis_new_80pct.png %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{name}.png
convert -scale 16 %{buildroot}%{_datadir}/%{name}/doc/images/qgis_new_80pct.png %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{name}.png

%clean
rm -rf %{buildroot}

gdal:
Code: [Select]
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 829: X--mode=compile: command not found                                                                       
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 829: X--tag=CXX: command not found                                                                           
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 862: libtool: ignoring unknown tag : command not found                                                       
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 996: *** Warning: inferring the mode of operation is deprecated.: command not found                           
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 997: *** Future versions of Libtool will require --mode=MODE be specified.: command not found                 
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: Xg++: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-O2: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-g: command not found 
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-pipe: command not found                                                                               
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-Wp,-D_FORTIFY_SOURCE=2: command not found                                                             
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-fexceptions: command not found                                                                       
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-fomit-frame-pointer: command not found                                                               
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-march=i586: command not found                                                                         
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-mtune=pentiumpro: command not found                                                                   
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-fasynchronous-unwind-tables: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-Wall: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-DOGR_ENABLED: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-I/home/neal/src/rpm/BUILD/gdal-1.6.2/port: No such file or directory
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-I/usr: No such file or directory
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-I/usr/include: No such file or directory
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-I/usr: No such file or directory
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-I/usr/include: No such file or directory
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-DHAVE_CURL: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-DHAVE_LIBZ: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1140: X-c: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1193: Xcpl_conv.lo: command not found
/home/neal/src/rpm/BUILD/gdal-1.6.2/libtool: line 1198: libtool: compile: cannot determine name of library object from `': command not found
make[1]: *** [cpl_conv.lo] Error 1
make[1]: Leaving directory `/home/neal/src/rpm/BUILD/gdal-1.6.2/port'
make: *** [port-target] Error 2

gdal spec:
Code: [Select]
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define _requires_exceptions devel\(libogdi31.*\)\\|devel\(libcfitsio.*\)

%define major 1
%define libname %mklibname %{name} %{major}
%define libnamedev %mklibname %{name} -d
%define libnamedevstat %mklibname %{name} -d -s

# Build gdal against libgrass. It is better to instead compile the new plugin
# which builds against grass itself (and thus has more features than the
# libgrass5 version
# In fact, building with direct grass support will break gdal on every grass
# upgrade, see http://n2.nabble.com/qgis-%2B-grass-plugin-%3D-gdal-problem-tp2394932p2405146.html
%define build_libgrass 0
%{?with_libgrass: %define build_libgrass 1}

Name: gdal
Version: 1.6.2
Release: %mkrel 4
Summary: The Geospatial Data Abstraction Library (GDAL)
Group: Sciences/Geosciences
License: MIT
URL: http://www.gdal.org/
Source: [url]ftp://ftp.remotesensing.org/pub/gdal/%{name}-%{version}.tar.gz[/url]
Patch2: gdal-1.6.1-fix-str-fmt.patch
Patch3: gdal-1.6.0-fix-libname.patch
BuildRequires: libpng-devel
BuildRequires: zlib-devel
BuildRequires: geotiff-devel >= 1.2.4
BuildRequires: libpng-devel
BuildRequires: libungif-devel
BuildRequires: postgresql-devel
BuildRequires: libjpeg-devel
BuildRequires: libproj-devel >= 4.4.7
BuildRequires:  doxygen
%if %{build_libgrass}
BuildRequires: libgrass5-devel
%else
BuildConflicts: %mklibname -d grass 5 0
%endif
BuildRequires: libjasper-devel
BuildRequires: libgeos-devel >= 3.0.0
BuildRequires: hdf5-devel
BuildRequires: netcdf-devel >= 3.6.2
BuildRequires: ogdi-devel
BuildRequires: cfitsio-devel
BuildRequires: python-numpy-devel
BuildRequires: sqlite3-devel
#BuildRequires: mysql-devel
#BuildRequires: libdap-devel
BuildRequires: librx-devel
BuildRequires: unixODBC-devel
BuildRequires: xerces-c-devel
BuildRequires: swig
Requires: libcurl4
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%py_requires -d
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
The Geospatial Data Abstraction Library (GDAL) is a unifying
C/C++ API for accessing raster geospatial data, and currently
includes formats like GeoTIFF, Erdas Imagine, Arc/Info
Binary, CEOS, DTED, GXF, and SDTS. It is intended to provide
efficient access, suitable for use in viewer applications,
and also attempts to preserve coordinate systems and metadata.
Python, C, and C++ interfaces are available.

%package python
Summary: The Python bindings for the GDAL library
Group: Sciences/Geosciences
Requires: %{name} = %{version}
Requires: python-numpy
%description python
The Python bindings for the GDAL library

%package -n %{libname}
Summary: Libraries required for the GDAL library
Group: System/Libraries
Provides: lib%{name} = %{version}

%description -n %{libname}
Libraries required for the GDAL library

%package -n %{libnamedev}
Summary: Development files for using the GDAL library
Group: Development/C
Requires: %{libname} = %{version}-%{release}
Provides: lib%{name}-devel = %{version}
Provides: %{name}-devel = %{version}

%description -n %{libnamedev}
Development files for using the GDAL library

%package -n %{libnamedevstat}
Summary: Development files for using the GDAL library
Group: Development/C
Requires: %{libnamedev} = %{version}-%{release}

%description -n %{libnamedevstat}
Development files for using the GDAL library

%prep
%setup -q
%patch2 -p0 -b .str
%patch3 -p0 -b .libname

%build
%configure2_5x \
--datadir=%_datadir/gdal \
--includedir=%_includedir/gdal \
        --with-dods-root=no \
        --with-ogdi=%_prefix \
        --with-cfitsio=%_prefix \
        --with-geotiff=yes   \
        --with-libtiff=yes   \
        --with-libz=%_prefix      \
        --with-netcdf             \
        --with-hdf5=%_prefix      \
        --with-geos               \
        --with-jasper             \
        --with-png                \
        --with-gif                \
        --with-jpeg               \
        --with-odbc               \
        --with-sqlite             \
        --with-mysql              \
        --with-curl               \
        --with-python             \
        --with-xerces             \
        --with-xerces-lib='-lxerces-c' \
        --with-xerces-inc=%_includedir \
        --without-pcraster        \
        %if %{build_libgrass}
        --with-grass=%_libdir/grass     \
        %endif
        --with-threads
       
perl -pi -e 's/PY_HAVE_SETUPTOOLS=1/PY_HAVE_SETUPTOOLS=0/g' GDALmake.opt
make
make docs

%install
rm -Rf %buildroot
mkdir -p %{buildroot}/%python_sitelib
export PYTHONPATH="%{buildroot}/%python_sitelib"
export INST_MAN=%{_mandir}
%makeinstall_std install-man
perl -pi -e 's,%{_prefix}/lib/,%{_libdir}/,g' %{buildroot}/%{_libdir}/libgdal.la

%multiarch_binaries %{buildroot}%{_bindir}/gdal-config

mv /usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg %{buildroot}/usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg


%clean
rm -rf %buildroot

%post 
/sbin/ldconfig
%postun
/sbin/ldconfig

%files
%defattr(-,root,root)
%{_datadir}/gdal/
%{_bindir}/*
%exclude %{_bindir}/gdal-config
%{_mandir}/man1/*.1.*
%exclude %{_mandir}/man1/gdal-config.1.*
%doc NEWS VERSION

%files -n %{libnamedev}
%defattr(-,root,root)
%{_bindir}/%{name}-config
%{_mandir}/man1/gdal-config.1.*
%{_libdir}/*.so
%{_includedir}/*
%_docdir/*
%multiarch %{multiarch_bindir}/gdal-config

%files -n %{libnamedevstat}
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.la

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/*.so.%{major}
%{_libdir}/*.so.%{major}.*

%files python
%defattr(-,root,root,-)
%py_platsitedir/*

Ideas? Helpful suggestions?


Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: qgis and gdal
« Reply #1 on: November 09, 2009, 07:26:58 PM »
Don't know Neal.  Don't think I've ever tried anything that complicated.  I don't see anything obvious.   ???  Sorry.
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: qgis and gdal
« Reply #2 on: November 09, 2009, 09:18:45 PM »
Thanks anyway, Joble. I appreciate you having a look.


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: qgis and gdal
« Reply #3 on: November 11, 2009, 11:40:45 AM »
Update on gdal:

Spec:
Code: [Select]
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define _requires_exceptions devel\(libogdi31.*\)\\|devel\(libcfitsio.*\)

%define major 2
%define libname %mklibname %{name} %{major}
%define libnamedev %mklibname %{name} -d
%define libnamedevstat %mklibname %{name} -d -s
%define __libtoolize    /bin/true

# Build gdal against libgrass. It is better to instead compile the new plugin
# which builds against grass itself (and thus has more features than the
# libgrass5 version
# In fact, building with direct grass support will break gdal on every grass
# upgrade, see http://n2.nabble.com/qgis-%2B-grass-plugin-%3D-gdal-problem-tp2394932p2405146.html
%define build_libgrass 0
%{?with_libgrass: %define build_libgrass 1}

Name: gdal
Version: 1.6.2
Release: %mkrel 4
Summary: The Geospatial Data Abstraction Library (GDAL)
Group: Sciences/Geosciences
License: MIT
URL: http://www.gdal.org/
Source: [url]ftp://ftp.remotesensing.org/pub/gdal/%{name}-%{version}.tar.gz[/url]
Patch2: gdal-1.6.1-fix-str-fmt.patch
Patch3: gdal-1.6.0-fix-libname.patch
BuildRequires: libpng-devel
BuildRequires: zlib-devel
BuildRequires: geotiff-devel >= 1.2.4
BuildRequires: libungif-devel
BuildRequires: postgresql-devel
BuildRequires: libjpeg-devel
BuildRequires: libproj-devel >= 4.4.7
BuildRequires:  doxygen
%if %{build_libgrass}
BuildRequires: libgrass5-devel
%else
BuildConflicts: %mklibname -d grass 5 0
%endif
BuildRequires: libjasper-devel
BuildRequires: libgeos-devel >= 3.0.0
BuildRequires: hdf5-devel
BuildRequires: netcdf-devel >= 3.6.2
BuildRequires: ogdi-devel
BuildRequires: cfitsio-devel
BuildRequires: python-numpy-devel
BuildRequires: sqlite3-devel
#BuildRequires: mysql-devel
#BuildRequires: libdap-devel
BuildRequires: librx-devel
BuildRequires: unixODBC-devel
BuildRequires: xerces-c-devel
BuildRequires: swig
Requires: libcurl4
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%py_requires -d
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
The Geospatial Data Abstraction Library (GDAL) is a unifying
C/C++ API for accessing raster geospatial data, and currently
includes formats like GeoTIFF, Erdas Imagine, Arc/Info
Binary, CEOS, DTED, GXF, and SDTS. It is intended to provide
efficient access, suitable for use in viewer applications,
and also attempts to preserve coordinate systems and metadata.
Python, C, and C++ interfaces are available.

%package python
Summary: The Python bindings for the GDAL library
Group: Sciences/Geosciences
Requires: %{name} = %{version}
Requires: python-numpy
%description python
The Python bindings for the GDAL library

%package -n %{libname}
Summary: Libraries required for the GDAL library
Group: System/Libraries
Provides: lib%{name} = %{version}

%description -n %{libname}
Libraries required for the GDAL library

%package -n %{libnamedev}
Summary: Development files for using the GDAL library
Group: Development/C
Requires: %{libname} = %{version}-%{release}
Provides: lib%{name}-devel = %{version}
Provides: %{name}-devel = %{version}

%description -n %{libnamedev}
Development files for using the GDAL library

%package -n %{libnamedevstat}
Summary: Development files for using the GDAL library
Group: Development/C
Requires: %{libnamedev} = %{version}-%{release}

%description -n %{libnamedevstat}
Development files for using the GDAL library

%prep
%setup -q
%patch2 -p0 -b .str
%patch3 -p0 -b .libname

%build
export CPPFLAGS='-I%{_includedir}/netcdf-3'
export LDFLAGS='-L%{_libdir}/netcdf-3'
%configure2_5x \
--datadir=%_datadir/gdal \
--includedir=%_includedir/gdal \
        --with-dods-root=no \
        --with-ogdi=%_prefix \
        --with-cfitsio=%_prefix \
        --with-geotiff=yes   \
        --with-libtiff=yes   \
        --with-libz=%_prefix      \
        --with-netcdf             \
        --with-hdf5=%_prefix      \
        --with-geos               \
        --with-jasper             \
        --with-png                \
        --with-gif                \
        --with-jpeg               \
        --with-odbc               \
        --with-sqlite             \
        --with-mysql              \
        --with-curl               \
        --with-python             \
        --with-xerces             \
        --with-xerces-lib='-lxerces-c' \
        --with-xerces-inc=%_includedir \
        --with-pcraster        \
        %if %{build_libgrass}
        --with-grass=%_libdir/grass     \
        %endif
        --with-threads
 
cp GDALmake.opt GDALmake.opt.orig
sed -e "s/^CFLAGS.*$/CFLAGS=$CFLAGS/" \
 -e "s/^CXXFLAGS.*$/CXXFLAGS=$CXXFLAGS/" \
 -e "s/^FFLAGS.*$/FFLAGS=$FFLAGS/" \
 GDALmake.opt.orig > GDALmake.opt
       
perl -pi -e 's/PY_HAVE_SETUPTOOLS=1/PY_HAVE_SETUPTOOLS=0/g' GDALmake.opt
make  %{?_smp_mflags}

make docs
find html -name .cvsignore -exec rm -f {} \;
unset CPPFLAGS
unset LDFLAGS

%install
rm -Rf %buildroot
mkdir -p %{buildroot}/%python_sitelib
export PYTHONPATH="%{buildroot}/%python_sitelib"
export INST_MAN=%{_mandir}
%makeinstall_std install-man
perl -pi -e 's,%{_prefix}/lib/,%{_libdir}/,g' %{buildroot}/%{_libdir}/libgdal.la

%multiarch_binaries %{buildroot}%{_bindir}/gdal-config

mv /usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg %{buildroot}/usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg


%clean
rm -rf %buildroot

%post 
/sbin/ldconfig
%postun
/sbin/ldconfig

%files
%defattr(-,root,root)
%{_datadir}/gdal/
%{_bindir}/*
%exclude %{_bindir}/gdal-config
%{_mandir}/man1/*.1.*
%exclude %{_mandir}/man1/gdal-config.1.*
%doc NEWS VERSION

%files -n %{libnamedev}
%defattr(-,root,root)
%{_bindir}/%{name}-config
%{_mandir}/man1/gdal-config.1.*
%{_libdir}/*.so
%{_includedir}/*
%_docdir/*
%multiarch %{multiarch_bindir}/gdal-config

%files -n %{libnamedevstat}
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.la

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/*.so.%{major}
%{_libdir}/*.so.%{major}.*

%files python
%defattr(-,root,root,-)
%py_platsitedir/*

Error:
Code: [Select]
+ mv /usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg /home/neal/src/tmp/gdal-1.6.2-4pclos20102010-buildroot/usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg
mv: cannot stat `/usr/lib/python2.5/site-packages/GDAL-1.5.2-py2.5-linux-i686.egg': No such file or directory

Ideas? Thoughts? Anything?


Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: qgis and gdal
« Reply #4 on: November 15, 2009, 06:33:14 AM »
a HUGE thanks to maik3531, he has updated, and I have successfully tested, all these GIS components:
gdal (1.6.2), proj (4.7), GRASS (6.4), QGIS (1.3), geotiff (1.2.5),
all submitted to contrib.

again, maik3531, thank you very very much!
-p.