pkubat / rpms / postgis

Forked from rpms/postgis 5 years ago
Clone
d1783c8
%{!?javabuild:%define	javabuild 0}
a628dc6
%{!?utils:%define	utils 1}
d1783c8
%{!?gcj_support:%define	gcj_support 0}
a628dc6
0442a43
%global majorversion 2.1
7759806
%global prevmajorversion 2.0
d4eb645
%global prevversion %{prevmajorversion}.7
4f6415f
27801b1
%global pg_version_minimum 9.2
7e5b6b7
%global pg_version_built  %(if [ -x %{_bindir}/pg_config ]; then %{_bindir}/pg_config --version | /bin/sed 's,^PostgreSQL *,,gi'; else echo %{pg_version_minimum}; fi)
7e5b6b7
a628dc6
Summary:	Geographic Information Systems Extensions to PostgreSQL
a628dc6
Name:		postgis
d4eb645
Version:	2.1.7
bf15439
Release:	1%{?dist}
dfb512a
License:	GPLv2+
a628dc6
Group:		Applications/Databases
56cf4b7
Source0:	http://download.osgeo.org/%{name}/source/%{name}-%{version}.tar.gz
56cf4b7
Source2:	http://download.osgeo.org/%{name}/docs/%{name}-%{version}.pdf
7759806
Source3:        http://download.osgeo.org/%{name}/source/%{name}-%{prevversion}.tar.gz
a628dc6
Source4:	filter-requires-perl-Pg.sh
ddb0dc4
Patch0:		postgis-1.5.1-pgsql9.patch
8af4640
# CFLAGS are reset before AC_CHECK_LIBRARY, but -fPIC is necessary to link against gdal
8af4640
Patch1:		postgis-configureac21.patch
56cf4b7
URL:		http://www.postgis.org
a628dc6
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
a628dc6
Jozef Mlich 909504d
BuildRequires:	postgresql-devel >= %{pg_version_minimum}, proj-devel, geos-devel >= 3.4.2 byacc, proj-devel, flex, java, java-devel, ant
Jozef Mlich 2329a3e
BuildRequires:	gtk2-devel, libxml2-devel, gdal-devel >= 1.10.0
8af4640
BuildRequires:	autoconf, automake, libtool
Jozef Mlich afc4720
Requires:	postgresql >= %{pg_version_built}, geos >= 3.4.2, proj, gdal >= 1.10.0, json-c
a628dc6
a628dc6
%description
a628dc6
PostGIS adds support for geographic objects to the PostgreSQL object-relational
a628dc6
database. In effect, PostGIS "spatially enables" the PostgreSQL server,
a628dc6
allowing it to be used as a backend spatial database for geographic information
8af4640
systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS
8af4640
follows the OpenGIS "Simple Features Specification for SQL" and has been
a628dc6
certified as compliant with the "Types and Functions" profile.
a628dc6
8efcdc5
%package docs
8efcdc5
Summary:	Extra documentation for PostGIS
8efcdc5
Group:		Applications/Databases
8efcdc5
%description docs
8efcdc5
The postgis-docs package includes PDF documentation of PostGIS.
8efcdc5
a628dc6
%if %javabuild
a628dc6
%package jdbc
a628dc6
Summary:	The JDBC driver for PostGIS
a628dc6
Group:		Applications/Databases
dfb512a
License:	LGPLv2+
5a1b740
Requires:	%{name} = %{version}-%{release}, postgresql-jdbc
ec19fb7
BuildRequires:	ant >= 0:1.6.2, junit >= 0:3.7, postgresql-jdbc
a628dc6
a628dc6
%if %{gcj_support}
a628dc6
BuildRequires:		gcc-java
3a86df9
BuildRequires:		java-1.5.0-gcj-devel
df472e4
Requires(post):		%{_bindir}/rebuild-gcj-db
df472e4
Requires(postun):	%{_bindir}/rebuild-gcj-db
a628dc6
%endif
a628dc6
a628dc6
%description jdbc
a628dc6
The postgis-jdbc package provides the essential jdbc driver for PostGIS.
a628dc6
%endif
a628dc6
a628dc6
%if %utils
a628dc6
%package utils
a628dc6
Summary:	The utils for PostGIS
a628dc6
Group:		Applications/Databases
5a1b740
Requires:	%{name} = %{version}-%{release}, perl-DBD-Pg
a628dc6
a628dc6
%description utils
a628dc6
The postgis-utils package provides the utilities for PostGIS.
a628dc6
%endif
a628dc6
a628dc6
%define __perl_requires %{SOURCE4}
a628dc6
a628dc6
%prep
c1c7694
%setup -q -n %{name}-%{version}
ddb0dc4
%patch0 -p1 -b .pgsql9
8af4640
%patch1 -p0 -b .configureac21
8efcdc5
# Copy .pdf file to top directory before installing.
8efcdc5
cp -p %{SOURCE2} .
a628dc6
a628dc6
%build
8af4640
./autogen.sh
8af4640
%configure --with-gui --enable-raster
ce592dd
make %{?_smp_mflags} LPATH=`pg_config --pkglibdir` shlib="%{name}.so"
a628dc6
a628dc6
%if %javabuild
c1c7694
export BUILDXML_DIR=%{_builddir}/%{name}-%{version}/java/jdbc
ecf93b6
JDBC_VERSION_RPM=`rpm -ql postgresql-jdbc| grep 'jdbc2.jar$'|awk -F '/' '{print $5}'`
df472e4
sed 's/postgresql.jar/'${JDBC_VERSION_RPM}'/g' $BUILDXML_DIR/build.xml > $BUILDXML_DIR/build.xml.new
df472e4
mv -f $BUILDXML_DIR/build.xml.new $BUILDXML_DIR/build.xml
df472e4
pushd java/jdbc
df472e4
ant
df472e4
popd
a628dc6
%endif
a628dc6
a628dc6
%if %utils
Jozef Mlich 43e4315
 make %{?_smp_mflags}  -C utils
a628dc6
%endif
a628dc6
7759806
# PostGIS 2.1 breaks compatibility with 2.0, and we need to ship
7759806
# postgis-2.0.so file along with 2.1 package, so that we can upgrade:
7759806
tar zxf %{SOURCE3}
7759806
cd %{name}-%{prevversion}
Jozef Mlich afc4720
%configure --without-raster --disable-rpath --without-json
7759806
7759806
make %{?_smp_mflags} LPATH=`%[_bindir}/pg_config --pkglibdir` shlib="%{name}-%{prevmajorversion}.so"
7759806
a628dc6
%install
a628dc6
rm -rf %{buildroot}
a628dc6
make install DESTDIR=%{buildroot}
Jozef Mlich 43e4315
make %{?_smp_mflags}  -C utils install DESTDIR=%{buildroot}
Jozef Mlich 43e4315
make %{?_smp_mflags}  -C extensions install DESTDIR=%{buildroot}
Jozef Mlich 43e4315
Jozef Mlich 3514f04
rm -f  %{buildroot}%{_libdir}/liblwgeom.{a,la}
Jozef Mlich 3514f04
8af4640
# (moved into install section:
8af4640
# Install postgis-2.0.so file manually:
Jozef Mlich 43e4315
%{__mkdir} -p %{buildroot}/%{_libdir}/pgsql
Jozef Mlich 43e4315
%{__install} -m 644 %{name}-%{prevversion}/postgis/postgis-%{prevmajorversion}.so %{buildroot}/%{_libdir}/pgsql/postgis-%{prevmajorversion}.so
Jozef Mlich 43e4315
a628dc6
rm -f  %{buildroot}%{_datadir}/*.sql
a628dc6
ce592dd
#if [ "%{_lib}" = "lib64" ] ; then
ce592dd
#	mv %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis.sql %{buildroot}%{_datadir}/pgsql/contrib/postgis-64.sql
ce592dd
#fi
e5c9330
a628dc6
%if %javabuild
a628dc6
install -d %{buildroot}%{_javadir}
b785f3e
install -m 755 java/jdbc/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
a628dc6
%if %{gcj_support}
a628dc6
aot-compile-rpm
a628dc6
%endif
a628dc6
strip %{buildroot}/%{_libdir}/gcj/%{name}/*.jar.so
7c4834e
%endif
a628dc6
a628dc6
%if %utils
a628dc6
install -d %{buildroot}%{_datadir}/%{name}
ec19fb7
install -m 755 utils/*.pl %{buildroot}%{_datadir}/%{name}
a628dc6
%endif
a628dc6
a628dc6
%clean
a628dc6
rm -rf %{buildroot}
a628dc6
7c4834e
%if %javabuild
7c4834e
%if %gcj_support
a628dc6
%post -p %{_bindir}/rebuild-gcj-db
a628dc6
%postun -p %{_bindir}/rebuild-gcj-db
7c4834e
%endif
7c4834e
%endif
a628dc6
a628dc6
%files
a628dc6
%defattr(-,root,root)
54ac7f1
%doc COPYING CREDITS NEWS TODO README.%{name} doc/html loader/README.* doc/%{name}.xml doc/ZMSgeoms.txt 
a628dc6
%attr(755,root,root) %{_bindir}/*
b9490cf
%attr(755,root,root) %{_libdir}/pgsql/%{name}-%{prevmajorversion}.so
b9490cf
%attr(755,root,root) %{_libdir}/pgsql/%{name}-%{majorversion}.so
33f15c3
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/*.sql
Jozef Mlich 43e4315
#if {_lib} == lib64
Jozef Mlich 43e4315
#{_datadir}/pgsql/contrib/postgis*.sql
Jozef Mlich 43e4315
#endif
d18018f
%{_datadir}/pgsql/extension/postgis-*.sql
d18018f
%{_datadir}/pgsql/extension/postgis_topology*.sql
d18018f
%{_datadir}/pgsql/extension/postgis.control
82c3ccd
%{_datadir}/pgsql/extension/postgis_topology.control
1b51352
%{_datadir}/pgsql/extension/postgis_tiger_geocoder*.sql
8810de5
%{_datadir}/pgsql/extension/postgis_tiger_geocoder.control
d18018f
%{_datadir}/postgis/svn_repo_revision.pl
d18018f
%{_includedir}/liblwgeom.h
d18018f
%{_libdir}/liblwgeom*
d18018f
%{_libdir}/pgsql/rtpostgis-%{majorversion}.so
a628dc6
a628dc6
%if %javabuild
a628dc6
%files jdbc
a628dc6
%defattr(-,root,root)
a628dc6
%doc java/jdbc/COPYING_LGPL java/jdbc/README
b785f3e
%attr(755,root,root) %{_javadir}/%{name}.jar
a628dc6
%if %{gcj_support}
a628dc6
%dir %{_libdir}/gcj/%{name}
a628dc6
%{_libdir}/gcj/%{name}/*.jar.so
a628dc6
%{_libdir}/gcj/%{name}/*.jar.db
a628dc6
%endif
a628dc6
%endif
a628dc6
a628dc6
%if %utils
a628dc6
%files utils
ec19fb7
%defattr(755,root,root)
a628dc6
%doc utils/README
8efcdc5
%dir %{_datadir}/%{name}/
ec19fb7
%{_datadir}/%{name}/test_estimation.pl
ec19fb7
%{_datadir}/%{name}/profile_intersects.pl
ec19fb7
%{_datadir}/%{name}/test_joinestimation.pl
ec19fb7
%{_datadir}/%{name}/create_undef.pl
ec19fb7
%{_datadir}/%{name}/%{name}_proc_upgrade.pl
ec19fb7
%{_datadir}/%{name}/%{name}_restore.pl
33f15c3
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/postgis_restore.pl
ec19fb7
%{_datadir}/%{name}/read_scripts_version.pl
ec19fb7
%{_datadir}/%{name}/test_geography_estimation.pl
ec19fb7
%{_datadir}/%{name}/test_geography_joinestimation.pl
a628dc6
%endif
a628dc6
8efcdc5
%files docs
8efcdc5
%defattr(-,root,root)
8efcdc5
%doc postgis*.pdf
8efcdc5
a628dc6
%changelog
d4eb645
* Wed Apr 1 2015 Devrim Gündüz <devrim@gunduz.org> - 2.1.7-1
d4eb645
- Update to 2.1.7, per changes described at:
d4eb645
  http://svn.osgeo.org/postgis/tags/2.1.7/NEWS
d4eb645
bf15439
* Fri Mar 27 2015 Devrim Gündüz <devrim@gunduz.org> - 2.1.6-1
bf15439
- Update to 2.1.6, per changes described at:
bf15439
  http://postgis.net/2015/03/20/postgis-2.1.6
bf15439
866f52a
* Wed Mar 11 2015 Devrim Gündüz <devrim@gunduz.org> - 2.1.5-3
866f52a
- Rebuild for Proj 4.9.1
8af4640
- Add patch to fix FTBFS -- patch by Sandro Mani <manisandro@gmail.com>
866f52a
Jozef Mlich afc4720
* Thu Jan 08 2015 Jozef Mlich <jmlich@redhat.com> - 2.1.5-2
Jozef Mlich afc4720
- disable json-c/geojson just for upgrade part of postgis
Jozef Mlich afc4720
4b662dc
* Mon Dec 22 2014 Devrim Gündüz <devrim@gunduz.org> - 2.1.5-1
4b662dc
- Update to 2.1.5, per changes described at:
4b662dc
  http://postgis.net/2014/12/18/postgis-2.1.5 and
4b662dc
  http://postgis.net/2014/09/10/postgis-2.1.4
4b662dc
Jozef Mlich 2329a3e
* Mon Aug 18 2014 Jozef Mlich <jmlich@redhat.com> - 2.1.3-5
Jozef Mlich 2329a3e
- Dropped json-c because it is not building anymore
Jozef Mlich 2329a3e
  Resolves: #1129292
Jozef Mlich 2329a3e
4bd8e23
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.3-4
4bd8e23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
4bd8e23
Jozef Mlich 3514f04
* Thu Jun 26 2014 Jozef Mlich <jmlich@redhat.com> - 2.1.3-3
866f52a
- Removing static libraries
Jozef Mlich 3514f04
  Resolves: #979179
Jozef Mlich 3514f04
Jozef Mlich 3514f04
* Mon Jun 09 2014 Jozef Mlich <jmlich@redhat.com> - 2.1.3-2
Jozef Mlich 909504d
- removing sinjdoc from BuildRequires as it is not available
Jozef Mlich 909504d
  in rawhide anymore
Jozef Mlich 909504d
Jozef Mlich 909504d
* Mon Jun 09 2014 Jozef Mlich <jmlich@redhat.com> - 2.1.3-1
Jozef Mlich 43e4315
- Rebase to 2.1.3 and 2.0.6 (security bugfixes, feature bugfixes)
Jozef Mlich 43e4315
  see http://svn.osgeo.org/postgis/tags/2.1.3/NEWS
Jozef Mlich 43e4315
- json_c turned on
Jozef Mlich 43e4315
- installation of .so file of previous version moved into install section
Jozef Mlich 43e4315
98c3a75
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-3
98c3a75
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
98c3a75
7759806
* Thu Jan 23 2014 Devrim Gündüz <devrim@gunduz.org> - 2.1.1-2
7759806
- Install postgis-2.0.so file, by compiling it from 2.0 sources
7759806
  Fixes bz #1055293.
7759806
88331e2
* Thu Dec 12 2013 Devrim Gündüz <devrim@gunduz.org> - 2.1.1-1
88331e2
- Update to 2.1.1
88331e2
e6e904c
* Fri Oct 25 2013 Dan Horák <dan[at]danny.cz> - 2.1.0-2
e6e904c
- fix build on non-x86 64-bit arches
e6e904c
0442a43
* Thu Sep 12 2013 Devrim Gündüz <devrim@gunduz.org> - 2.1.0-1
0442a43
- Update to 2.1.0, per changes described at:
0442a43
  http://svn.osgeo.org/postgis/tags/2.1.0/NEWS
0442a43
f8d7641
* Tue Aug 27 2013 Orion Poplawski <orion@cora.nwra.com> - 2.0.3-4
f8d7641
- Rebuild for gdal 1.10.0
f8d7641
c44c2f8
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.3-3
c44c2f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c44c2f8
b80fc2c
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 2.0.3-2
b80fc2c
- Perl 5.18 rebuild
b80fc2c
56cf4b7
* Wed Mar 6 2013 Devrim GÜNDÜZ <devrim@gunduz.org> - 2.0.3-1
56cf4b7
- Update to 2.0.3, and build against GeOS 3.3.8.
56cf4b7
- Update all URLs.
56cf4b7
ffe3267
* Fri Jan 25 2013 Devrim GÜNDÜZ <devrim@gunduz.org> - 2.0.2-2
ffe3267
- Rebuilt against geos 3.3.7.
d18018f
- Apply changes for PostgreSQL 9.2 and extensions.
ffe3267
fca354d
* Wed Jan 16 2013 Devrim GÜNDÜZ <devrim@gunduz.org> - 2.0.2-1
507f241
- Update to 2.0.2, for various changes described at:
507f241
  http://www.postgis.org/news/20121203/
507f241
27801b1
* Tue Nov 13 2012 Devrim GÜNDÜZ <devrim@gunduz.org> - 2.0.1-1
27801b1
- Update to 2.0.1, so it works against PostgreSQL 9.2,
27801b1
  which also fixes #872710.
27801b1
- Add deps for gdal.
d1783c8
- Don't build JDBC portions. I have already disabled it in
d1783c8
  upstream packaging 8 months ago.
27801b1
b821c41
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-4
b821c41
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b821c41
e13b78d
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-3
e13b78d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e13b78d
b785f3e
* Tue Oct 4 2011 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.5.3-2
b785f3e
- Provide postgis.jar instead of provide postgis-1.5.2.jar,
b785f3e
  per #714856
b785f3e
7f55ee3
* Tue Oct 4 2011 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.5.3-1
7f55ee3
- Update to 1.5.3
7f55ee3
4541500
* Tue Apr 19 2011 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.5.2-1
4541500
- Update to 1.5.2
4541500
ddb0dc4
* Sun Apr 03 2011 Nils Philippsen <nils@redhat.com> - 1.5.1-3
ddb0dc4
- cope with PostgreSQL 9.0 build environment
7e5b6b7
- require pgsql version used for building
ddb0dc4
d545ea6
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-2
d545ea6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
d545ea6
b64b0de
* Thu Mar 11 2010 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.5.1-1
b64b0de
- Update to 1.5.1
b64b0de
c1c7694
* Tue Jan 12 2010 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.5.0-1
c1c7694
- Update to 1.5.0
c1c7694
- Trim changelog a bit.
ec19fb7
e143cfd
* Wed Jan 6 2010 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.4.1-2
e143cfd
- Add shp2pgsql-{cli-gui} among installed files.
e143cfd
968aa2e
* Sun Dec 20 2009 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.4.1-1
968aa2e
- Update to 1.4.1
968aa2e
5a1b740
* Thu Dec 03 2009 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.4.1-rc2_1.2
5a1b740
- Fix spec per rawhide report.
5a1b740
be29958
* Tue Dec 01 2009 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.4.1-rc2_1.1
be29958
- Update spec for rc2 changes.
be29958
728fb5c
* Mon Nov 30 2009 Devrim GUNDUZ <devrim@gunduz.org> - 1.4.1rc2-1
728fb5c
- Update to 1.4.1rc2
728fb5c
469d214
* Mon Nov 23 2009 Devrim GUNDUZ <devrim@gunduz.org> - 1.4.1rc1-1
469d214
- Update to 1.4.1rc1
469d214
b1c9de9
* Sun Nov 22 2009 Devrim GÜNDÜZ <devrim@gunduz.org> - 1.4.0-2
b1c9de9
- Fix spec, per bz #536860
b1c9de9
a6bbec9
* Mon Jul 27 2009 Devrim GUNDUZ <devrim@gunduz.org> - 1.4.0-1
a6bbec9
- Update to 1.4.0
a6bbec9
494f794
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0rc1-2
494f794
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
494f794
54ac7f1
* Mon Jul 6 2009 Devrim GUNDUZ <devrim@gunduz.org> - 1.4.0rc1-1
54ac7f1
- Update to 1.4.0rc1
54ac7f1
- Fix spec for 1.4