Sophie

Sophie

distrib > Mageia > 2 > i586 > media > core-release-src > by-pkgid > b3dc04db3d1df20ad413218bc9afd006 > files > 2

mapserver-6.0.1-7.mga2.src.rpm

Name:           mapserver
Version:        6.0.1
Release:        %mkrel 7
Summary:        Web-based Map Server
License:        BSD
Group:          Sciences/Geosciences
URL:            http://mapserver.org/

Source0:         http://download.osgeo.org/mapserver/mapserver-%{version}.tar.gz

BuildRequires:  xpm-devel
BuildRequires:  readline-devel
BuildRequires:  apache-devel
BuildRequires:  php-devel
BuildRequires:  libxslt-devel
BuildRequires:  pam-devel
BuildRequires:  libfcgi-devel
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl-devel
BuildRequires:  postgresql-devel
BuildRequires:  mysql-devel
BuildRequires:  java-devel
BuildRequires:  swig > 1.3.24 
BuildRequires:  java
BuildRequires:  java-1.5.0-gcj-devel
BuildRequires:  geos-devel
BuildRequires:  proj-devel
BuildRequires:  gdal-devel
BuildRequires:  agg-devel
BuildRequires:  cairo-devel
BuildRequires:  php-devel
BuildRequires:  freetype-devel
BuildRequires:  gd-devel >= 2.0.16
BuildRequires:  python-devel
BuildRequires:  curl-devel
BuildRequires:  zlib-devel
BuildRequires:  libxml2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  fribidi-devel
BuildRequires:  giflib-devel

Requires:       webserver
Requires:       fonts-ttf-bitstream-vera

%description
MapServer is an  OpenSource development environment for building spatially
enabled Internet applications. The software builds upon other popular
OpenSource or freeware systems like Shapelib, FreeType, Proj.4, libTIFF,
Perl and others.

The MapServer CGI application provides a significant number of
"out-of-the-box" features. Here's a sampling:

* vector formats supported: ESRI shapefiles, simple embedded features,
  ESRI ArcSDE (alpha release)
* raster formats supported (8-bit only): TIFF/GeoTIFF, GIF, PNG, ERDAS,
  JPEG and EPPL7
* quadtree spatial indexing for shapefiles
* fully customizable, template driven output
* feature selection by item/value, point, area or another feature
* TrueType font support
* support for tiled raster and vector data (display only)
* automatic legend and scalebar building
* scale dependent feature drawing and application execution
* thematic map building using logical or regular expression based classes
* feature labeling including label collision mediation
* on-the-fly configuration via URLs
* on-the-fly projection

MapServer is not a full-featured GIS system, nor does it aspire to be.
It does, however, provide enough core functionality to support a wide
variety of web applications. Beyond browsing GIS data, MapServer allows
you create "geographic image maps", that is, maps that can direct users
to content.

%package php
Summary:        PHP/Mapscript map making extensions to PHP
Group:          Development/PHP
Requires:       webserver php-gd
Provides:       php-mapscript
Obsoletes:      php-mapscript < %{version}-%{release}

%description php
The PHP/Mapscript extension provides full map customization capabilities within
the PHP scripting language.


%package perl
Summary:        Perl/Mapscript map making extensions to Perl
Group:          Development/Perl
Requires:       %{name} = %{version}-%{release}
#Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description perl
The Perl/Mapscript extension provides full map customization capabilities
within the Perl programming language.

%package python
Summary:        Python/Mapscript map making extensions to Python
Group:          Development/Python
Requires:       %{name} = %{version}-%{release}

%description python
The Python/Mapscript extension provides full map customization capabilities
within the Python programming language.

%package java
Summary:        Java/Mapscript map making extensions to Java
Group:          Development/Java
Requires:       %{name} = %{version}-%{release}
Requires:       java-gcj-compat 

%description java
The Java/Mapscript extension provides full map customization capabilities
within the Java programming language.

%prep
%setup -q
# fix spurious perm bits
chmod -x tests/home.png
chmod -x mapscript/php/php_mapscript.c
chmod -x mappluginlayer.c
chmod -x mapscript/php/mapscript_i.c
chmod -x mapscript/php/examples/test_writeshape.phtml
chmod -x mapscript/python/examples/*.py
chmod -x mapscript/python/tests/rundoctests.dist
chmod -x mapscript/perl/examples/*.pl
chmod -x mapscript/php/README


# remove fonts
# alias as symlinks
rm -rf tests/vera/Vera.ttf
rm -rf tests/vera/VeraBd.ttf
pushd tests/vera/
ln -sf /usr/share/fonts/bitstream-vera/Vera.ttf Vera.ttf
ln -sf /usr/share/fonts/bitstream-vera/VeraBd.ttf VeraBd.ttf
popd

%build
CFLAGS="${CFLAGS} -ldl" ; export CFLAGS

# fix a UTF-8 one
iconv -f ISO-8859-1 -t UTF-8 < \
mapscript/java/examples/QueryByAttributeUnicode.java > \
mapscript/java/examples/QueryByAttributeUnicode-tmp.java
mv -f mapscript/java/examples/QueryByAttributeUnicode-tmp.java \
mapscript/java/examples/QueryByAttributeUnicode.java

# fix gdal lookup
%{__sed} -i.libs -e 's|`\$GDAL_CONFIG --dep-libs`||' configure

%define _disable_ld_no_undefined 1
%configure2_5x \
   --with-gd \
   --with-zlib \
   --with-tiff \
   --with-agg \
   --with-experimental-png \
   --with-freetype=%{_bindir}/freetype-config \
   --with-gdal=%{_bindir}/gdal-config \
   --with-ogr=%{_bindir}/gdal-config \
   --with-geos=%{_bindir}/geos-config \
   --with-cairo=yes \
   --with-proj \
   --with-wfs \
   --with-wcs \
   --with-sos \
   --with-wmsclient \
   --with-wfsclient \
   --with-xpm \
   --with-postgis=%{_bindir}/pg_config \
   --with-mygis=%{_bindir}/mysql_config \
   --with-curl-config=%{_bindir}/curl-config \
   --with-xml2-config=%{_bindir}/xml2-config \
   --with-php=`php-config --include-dir` \
   --with-fribidi-config=%{_libdir}/pkgconfig/fribidi.pc \
   --with-fastcgi=/usr \
   --without-pdf \
   --without-eppl \
   --with-threads \
   --enable-debug \
   --disable-runpath

# disable pgport library lookup.
for makefile in `find . -type f -name 'Makefile'`; do
sed -i 's|-lpgport||g' $makefile
done

# WARNING !!!
# using %{?_smp_mflags} may break build

%make

# build perl
cd mapscript/perl
perl Makefile.PL
make

# build python
cd ../python
python setup.py build

# build java
cd ../java
make interface
make

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}/%{_sbindir}
mkdir -p %{buildroot}/%{_sysconfdir}/php.d
mkdir -p %{buildroot}%{_libdir}/php/extensions
mkdir -p %{buildroot}/%{_var}/www/cgi-bin
mkdir -p %{buildroot}/%{_var}/www/html/mapserver/tmp

%makeinstall_std

install -p -m 755 mapserv %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 shp2img %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 shptree %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 sortshp %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 tile4ms %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 legend %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 shptreevis %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 shptreetst %{buildroot}/%{_var}/www/cgi-bin
install -p -m 755 scalebar %{buildroot}/%{_var}/www/cgi-bin

install -p -m 755 mapscript/php/php_mapscript.so %{buildroot}/%{_libdir}/php/extensions/

# install perl module
pushd mapscript/perl
make DESTDIR=%{buildroot} pure_vendor_install
popd

# install python module
pushd mapscript/python
python setup.py install --root %{buildroot}
popd

# install java
mkdir -p %{buildroot}%{_javadir}
install -p -m 644 mapscript/java/mapscript.jar %{buildroot}%{_javadir}/

# install php config file
mkdir -p %{buildroot}%{_sysconfdir}/php.d/
cat > %{buildroot}%{_sysconfdir}/php.d/40_%{name}.ini <<EOF
; Enable %{name} extension module
extension=php_mapscript.so
EOF

# cleanup junks
for junk in {*.pod,*.bs,.packlist} ; do
find %{buildroot} -name "$junk" -exec rm -rf '{}' \;
done

# fix some exec bits
chmod 755 %{buildroot}/%{perl_vendorarch}/auto/mapscript/mapscript.so

%clean
rm -rf %{buildroot}

%files
%doc README COMMITERS GD-COPYING HISTORY.TXT  
%doc INSTALL MIGRATION_GUIDE.txt
%doc symbols tests
%doc fonts
%{_var}/www/cgi-bin/*
%dir %{_var}/www/html/mapserver
%dir %{_var}/www/html/mapserver/tmp

%files php
%doc mapscript/php/README
%doc mapscript/php/examples
%config(noreplace) %{_sysconfdir}/php.d/40_%{name}.ini
%{_libdir}/php/extensions/php_mapscript.so

%files perl
%doc mapscript/perl/examples
%dir %{perl_vendorarch}/auto/mapscript
%{perl_vendorarch}/auto/mapscript/*
%{perl_vendorarch}/mapscript.pm

%files python
%doc mapscript/python/README
%doc mapscript/python/examples
%doc mapscript/python/tests
%{python_sitearch}/*

%files java
%doc mapscript/java/README
%doc mapscript/java/examples
%doc mapscript/java/tests
%{_javadir}/*.jar


%changelog

* Wed Apr 04 2012 luigiwalser <luigiwalser> 6.0.1-7.mga2
+ Revision: 228526
- httpd restart is handled by filetriggers now

* Tue Jan 17 2012 obgr_seneca <obgr_seneca> 6.0.1-6.mga2
+ Revision: 197274
- removed explicit java-1.6.0 br
- java-devel is already required
- rebuild for new libgeos
- fixed upstream Url

* Thu Nov 03 2011 obgr_seneca <obgr_seneca> 6.0.1-5.mga2
+ Revision: 162067
- rebuild against new geos

* Wed Oct 05 2011 obgr_seneca <obgr_seneca> 6.0.1-4.mga2
+ Revision: 151595
- fixed php_mapscript install path

* Tue Sep 27 2011 obgr_seneca <obgr_seneca> 6.0.1-3.mga2
+ Revision: 149573
- rebuild against new geos and changes in gdal

* Fri Sep 16 2011 obgr_seneca <obgr_seneca> 6.0.1-2.mga2
+ Revision: 144269
- fixed dependencies

* Fri Sep 16 2011 obgr_seneca <obgr_seneca> 6.0.1-1.mga2
+ Revision: 144241
- new version 6.0.1
- added bindings for perl and python
- renamed php-mapscript tp mapserver-php to have a unified maning schema
- thanks to Devrim Gunduz, Marcela Maslanova and others at Fedora from whom I borrowed parts of the spec file

* Wed Apr 20 2011 obgr_seneca <obgr_seneca> 5.6.6-1.mga2
+ Revision: 89062
- cleaned up new spec
- corrected upstream url
- new version 5.6.6
- imported package mapserver