a628dc6
%{!?javabuild:%define	javabuild 1}
a628dc6
%{!?utils:%define	utils 1}
a628dc6
%{!?gcj_support:%define	gcj_support 1}
a628dc6
4f6415f
%global majorversion 1.5
4f6415f
7e5b6b7
%global pg_version_minimum 8.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
7f55ee3
Version:	1.5.3
b821c41
Release:	4%{?dist}
dfb512a
License:	GPLv2+
a628dc6
Group:		Applications/Databases
c1c7694
Source0:	http://postgis.refractions.net/download/%{name}-%{version}.tar.gz
c1c7694
Source2:	http://www.postgis.org/download/%{name}-%{version}.pdf
a628dc6
Source4:	filter-requires-perl-Pg.sh
ddb0dc4
Patch0:		postgis-1.5.1-pgsql9.patch
a628dc6
URL:		http://postgis.refractions.net/
a628dc6
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
a628dc6
7e5b6b7
BuildRequires:	postgresql-devel >= %{pg_version_minimum}, proj-devel, geos-devel >= 3.1.1, byacc, proj-devel, flex, sinjdoc, java, java-devel, ant
d127e95
BuildRequires:	gtk2-devel, libxml2-devel
7e5b6b7
Requires:	postgresql >= %{pg_version_built}, geos >= 3.1.1, proj
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
a628dc6
systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS 
a628dc6
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
8efcdc5
# Copy .pdf file to top directory before installing.
8efcdc5
cp -p %{SOURCE2} .
a628dc6
a628dc6
%build
e143cfd
%configure --with-gui
826edaf
#make %{?_smp_mflags} LPATH=`pg_config --pkglibdir` shlib="%{name}.so"
826edaf
make 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
a628dc6
 make -C utils
a628dc6
%endif
a628dc6
a628dc6
%install
a628dc6
rm -rf %{buildroot}
a628dc6
make install DESTDIR=%{buildroot}
a628dc6
install -d %{buildroot}%{_libdir}/pgsql/
b785f3e
install -d %{buildroot}%{_bindir}/
a628dc6
install -d  %{buildroot}%{_datadir}/pgsql/contrib/
a628dc6
install -m 644 *.sql %{buildroot}%{_datadir}/pgsql/contrib/
ec19fb7
install -m 755 loader/shp2pgsql loader/shp2pgsql-gui %{buildroot}%{_bindir}/
a628dc6
rm -f  %{buildroot}%{_datadir}/*.sql
a628dc6
e5c9330
if [ "%{_libdir}" = "/usr/lib64" ] ; then
4f6415f
	mv %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis.sql %{buildroot}%{_datadir}/pgsql/contrib/postgis-64.sql
4f6415f
	mv %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis_upgrade_13_to_15.sql %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis_upgrade_13_to_15-64.sql
4f6415f
	mv %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis_upgrade_14_to_15.sql %{buildroot}%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/postgis_upgrade_14_to_15-64.sql
e5c9330
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}/*
54ac7f1
%attr(755,root,root) %{_libdir}/pgsql/postgis-*.so
a628dc6
%{_datadir}/pgsql/contrib/*.sql
4f6415f
%{_datadir}/pgsql/contrib/%{name}-%{majorversion}/*.sql
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
ec19fb7
%{_datadir}/%{name}/new_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
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