1
0
forked from pool/mapserver

- Make the package build on current Tumbleweed again

OBS-URL: https://build.opensuse.org/package/show/Application:Geo/mapserver?expand=0&rev=127
This commit is contained in:
Jan Engelhardt 2022-03-16 11:58:55 +00:00 committed by Git OBS Bridge
parent 11953a5530
commit 2371c1582a
2 changed files with 41 additions and 21 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 9 12:06:56 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
- Make the package build on current Tumbleweed again:
* Disable PHP bindings (fails to build)
* Disable PostgreSQL (fails to configure)
- Have mapserver-devel require the accompanying library
-------------------------------------------------------------------
Thu Nov 11 16:38:03 UTC 2021 - Boris Manojlovic <boris@steki.net>

View File

@ -18,16 +18,16 @@
#
%bcond_with php
%bcond_with postgres
%bcond_with ruby
#
%bcond_without python
%define libname libmapserver2
%define _cgibindir /srv/www/cgi-bin
%if 0%{?suse_version} >= 1500
%define php_name php7
%if 0%{?suse_version} >= 1550
%define php_name php8
%else
%define php_name php5
%define php_name php7
%endif
Name: mapserver
@ -69,10 +69,12 @@ BuildRequires: mysql-devel
BuildRequires: openjpeg2-devel
BuildRequires: pam
BuildRequires: pam-devel
%if 0%{?with postgres}
BuildRequires: postgresql-devel >= 9.1
%if 0%{?suse_version} >= 1500
BuildRequires: postgresql-server-devel >= 9.1
%endif
%endif
BuildRequires: libprotobuf-c-devel
BuildRequires: proj
BuildRequires: protobuf-c
@ -100,10 +102,8 @@ Group: System/Libraries
Mapserver library for mapserver or mapscript module. you need this lib to run mapserver
or any of the mapscript module (php, java, python, ruby)
# We don't require apache2_mod-php5 users could have php5 running
# with other modes (cgi, php-fpm etc)
# We don't require apache2_mod-php8 users could have php5 running
# with other modes (cgi, php-fpm, etc)
%package -n php-mapscript
Summary: PHP/Mapscript map making extensions to PHP
@ -112,7 +112,9 @@ Requires: %{libname} = %{version}-%{release}
Requires: apache2
Provides: php-mapserver = %{version}-%{release}
Obsoletes: php-mapserver < %{version}-%{release}
%if 0%{?with php}
BuildRequires: php-devel
%endif
Requires: php
Requires: php-gd
@ -175,12 +177,13 @@ Obsoletes: mapserver-java < %{version}-%{release}
The Java/Mapscript extension provides full map customization capabilities
within the Java programming language.
%if %{with ruby}
%package -n ruby-mapscript
Summary: Ruby/Mapscript map making extensions to Ruby
Group: Development/Languages/Ruby
%if %{with ruby}
BuildRequires: ruby-common
BuildRequires: ruby-devel
%endif
Requires: %{libname} = %{version}-%{release}
Requires: ruby
Provides: mapserver-ruby = %{version}-%{release}
@ -189,27 +192,28 @@ Obsoletes: mapserver-ruby < %{version}-%{release}
%description -n ruby-mapscript
The Ruby/Mapscript extension provides full map customization capabilities
within the Ruby programming language.
%endif
%package devel
Summary: Mapserver development files
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
%description devel
The Mapserver development package provides necessary files to build
against the C Mapserver library.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%autosetup -p1
%build
mkdir build
cd build
#Pre export the PREFIX ( having it on the command line doesn't expand correctly for
#dynamic postgresql location
export CMAKE_PREFIX_PATH="%{_includedir}:%{_includedir}/fastcgi:%%(pg_config --includedir):%%(pg_config --includedir-server):%%(pg_config --libdir)"
export CMAKE_PREFIX_PATH="%{_includedir}:%{_includedir}/fastcgi"
%if 0%{?with postgres}
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:%%(pg_config --includedir):%%(pg_config --includedir-server):%%(pg_config --libdir)"
%endif
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
@ -243,8 +247,12 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DWITH_MYSQL=TRUE \
-DWITH_PERL=TRUE \
-DCUSTOM_PERL_SITE_ARCH_DIR="%{perl_vendorarch}" \
%if 0%{?with php}
-DWITH_PHPNG=TRUE \
%endif
%if 0%{?with postgres}
-DWITH_POSTGIS=TRUE \
%endif
-DWITH_PROJ=TRUE \
-DUSE_PROJ=TRUE \
-DWITH_PROTOBUFC=TRUE \
@ -292,20 +300,20 @@ cp *.h %{buildroot}/%{_includedir}/%{name}/
# fix some exec bits essentially on examples to make rpmlint happy
# and avoid rpm adding require
find ./mapscript/ -type f -iname "*.p[ly]" -exec chmod -x {} \;
find ./mapscript/ -type f -iname "*.rb" -exec chmod -x {} \;
find ./mapscript/ -type f -iname "*.dist" -exec chmod -x {} \;
find mapscript/ -type f "(" -iname "*.p[ly]" -o -iname "*.rb" -o -iname "*.dist" ")" -exec chmod -x {} +
cd build
%make_install
cd ..
%if 0%{?with php}
mkdir -p %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/
cat > %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/mapscript.ini <<EOF
; Enable %{name} extension module
; For 6.4 we name the symlink here
extension=php_mapscript.so
EOF
%endif
# Install our links
#@ todo : check
@ -317,8 +325,10 @@ ln -s %{_bindir}/scalebar %{buildroot}%{_cgibindir}/scalebar
# remove vera fonts, these are provided system wide
#@todo then we should patch the fonts file example
rm -rf %{buildroot}%{_docdir}/%{name}/tests/vera
rm -rf %{buildroot}%{_docdir}/%{name}-%{version}/tests/vera
rm -rf %{buildroot}%{_docdir}/%{name}/tests/vera \
%{buildroot}%{_docdir}/%{name}-%{version}/tests/vera
chmod a+x "%{buildroot}/%{_libdir}/libjavamapscript.so"
%post -n %{libname} -p /sbin/ldconfig
@ -346,12 +356,14 @@ rm -rf %{buildroot}%{_docdir}/%{name}-%{version}/tests/vera
%files -n %{libname}
%{_libdir}/libmapserver.so.*
%if 0%{?with php}
%files -n php-mapscript
%doc mapscript/php/README
%doc mapscript/php/examples
%config(noreplace) %{_sysconfdir}/%{php_name}/conf.d/mapscript.ini
%{_libdir}/%{php_name}/extensions/mapscript.php
%{_libdir}/%{php_name}/extensions/php_mapscriptng.so*
%endif
%files -n perl-mapscript
%doc mapscript/perl/examples
@ -359,7 +371,7 @@ rm -rf %{buildroot}%{_docdir}/%{name}-%{version}/tests/vera
%{perl_vendorarch}/auto/mapscript/*
%{perl_vendorarch}/mapscript.pm
%if %{with python}
%if 0%{?with python}
%files -n python-mapscript
%doc mapscript/python/README.rst
%doc mapscript/python/examples