mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 17:09:10 -07:00
sci-geosciences/mapserver: security bump to 7.6.0
Changes: * Bump to 7.6.0 * Add PHP 7.x support, new module w/ multiple builds * Add Python 3.x, multiple builds * Drop old Proj compatibility workaround * Tidy up plenty of dependencies * Use sub-slot operator where appropriate * Use php-ext-source-r3's functions to simplify ebuild * Modernise as much as possible, bar EAPI 7 because of depend.apache. Bug: https://bugs.gentoo.org/688290 Closes: https://bugs.gentoo.org/649772 Closes: https://bugs.gentoo.org/659260 Closes: https://bugs.gentoo.org/666054 Closes: https://bugs.gentoo.org/729100 Package-Manager: Portage-2.3.103, Repoman-2.3.22 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -1 +1,2 @@
|
||||
DIST mapserver-7.2.2.tar.gz 2677800 BLAKE2B 3f26517f634098fd7f005aa5a1f71fc8ba9b831b9bd0385a64272db6705ad3bd7563848bea1532c08f28177c51b104b1185fe6aa319de8c4ed95ec649a1bf7f4 SHA512 8c66a52ec04741495e0cf2bf5ec28f8e3cafac9834ab314ef998d6cf8d50b893dcc66a05d4b30f29694c357cd175a1cb28712c94bf15da4c8bcb9bfd98f0d2af
|
||||
DIST mapserver-7.6.0.tar.gz 2713965 BLAKE2B 35e81b470afba58b1cf8cc63f70e6cc230a338c4066d38e8aa57d34a55e7414e9e3eeb6cc9c6d54ac8f60d076b90d25e23354f33f35c235d3d1d85d4f19979e7 SHA512 6e8a4639a025d3bdeaa74599ea10b58fbd20fc87367d39ccc9c29586a599d47ee4c45f6fe16dc76d593b3d7c51e26f8ca9d8656c5c3a3636181824d3aa26db36
|
||||
|
||||
289
sci-geosciences/mapserver/mapserver-7.6.0.ebuild
Normal file
289
sci-geosciences/mapserver/mapserver-7.6.0.ebuild
Normal file
@@ -0,0 +1,289 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# NOTE: We have to stick with EAPI 6 for now because of the
|
||||
# depend.apache eclass.
|
||||
EAPI=6
|
||||
|
||||
# Variables for the miscellaneous bindings we provide
|
||||
PHP_EXT_OPTIONAL_USE="php"
|
||||
PHP_EXT_NAME="php_mapscriptng"
|
||||
PHP_EXT_SKIP_PHPIZE="yes"
|
||||
|
||||
USE_PHP="php7-2 php7-3 php7-4"
|
||||
PYTHON_COMPAT=( python3_{6,7,8} )
|
||||
|
||||
WEBAPP_MANUAL_SLOT=yes
|
||||
WEBAPP_OPTIONAL=yes
|
||||
|
||||
# NOTE: Similarly, we cannot go cmake-utils -> cmake until we're on EAPI 7
|
||||
inherit cmake-utils depend.apache eapi7-ver perl-functions php-ext-source-r3 python-r1 webapp
|
||||
|
||||
DESCRIPTION="Development environment for building spatially enabled webapps"
|
||||
HOMEPAGE="https://mapserver.org/"
|
||||
SRC_URI="https://download.osgeo.org/mapserver/${P}.tar.gz"
|
||||
|
||||
LICENSE="Boost-1.0 BSD BSD-2 ISC MIT tcltk"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
SLOT="0"
|
||||
|
||||
# NOTE: opengl removed for now as no support for it in upstream CMake
|
||||
IUSE="apache bidi cairo geos mysql oracle perl php postgis python"
|
||||
|
||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||
|
||||
# Tests:
|
||||
# Included tests (tests/*) are seriously outdated
|
||||
# Upstream's main test suite (msautotest/*) is not in the release tarball,
|
||||
# and upstream sets 'export-ignore' for that directory.
|
||||
#
|
||||
# The eclasses used normally try to run test suites themselves,
|
||||
# or skip if nothing was found.
|
||||
# However, because of the php-ext-* eclass usage, this fails and would
|
||||
# cause errors running non-existent tests, so we have to restrict here.
|
||||
RESTRICT="test"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-libs/expat-2.2.8
|
||||
dev-libs/libxml2:2=
|
||||
dev-libs/libxslt[crypt]
|
||||
>=dev-libs/protobuf-c-1.3.2:=
|
||||
>=media-libs/freetype-2.9.1-r3
|
||||
>=media-libs/gd-2.0.12:=[truetype,jpeg,png,zlib]
|
||||
>=media-libs/giflib-5.2.1:=
|
||||
>=media-libs/libpng-1.6.37:=
|
||||
>=net-misc/curl-7.69.1
|
||||
>=sci-libs/gdal-3.0.4:=[oracle?]
|
||||
>=sci-libs/proj-6.2.1:=
|
||||
virtual/jpeg
|
||||
virtual/libiconv
|
||||
>=x11-libs/agg-2.5-r3
|
||||
apache? (
|
||||
app-admin/webapp-config
|
||||
dev-libs/fcgi
|
||||
)
|
||||
bidi? (
|
||||
dev-libs/fribidi
|
||||
media-libs/harfbuzz:=
|
||||
)
|
||||
cairo? ( x11-libs/cairo )
|
||||
geos? ( sci-libs/geos )
|
||||
mysql? ( dev-db/mysql-connector-c:= )
|
||||
oracle? ( dev-db/oracle-instantclient:= )
|
||||
perl? ( dev-lang/perl:= )
|
||||
postgis? (
|
||||
dev-db/postgis
|
||||
dev-db/postgresql:=
|
||||
)
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
virtual/pkgconfig
|
||||
perl? ( >=dev-lang/swig-4.0 )
|
||||
php? ( >=dev-lang/swig-4.0 )
|
||||
python? (
|
||||
>=dev-lang/swig-4.0
|
||||
>=dev-python/setuptools-44.1.0
|
||||
)
|
||||
"
|
||||
|
||||
want_apache2 apache
|
||||
|
||||
pkg_setup() {
|
||||
use apache && webapp_pkg_setup
|
||||
use perl && perl_set_version
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake-utils_src_prepare
|
||||
|
||||
use php && php-ext-source-r3_src_prepare
|
||||
use python && python_copy_sources
|
||||
}
|
||||
|
||||
_generate_cmake_args() {
|
||||
# Provides a simple, bare config for bindings to build upon
|
||||
# Need WITH_WMS=ON or build fails
|
||||
local args=(
|
||||
"-DCMAKE_SKIP_RPATH=ON"
|
||||
"-DINSTALL_LIB_DIR=/usr/$(get_libdir)"
|
||||
"-DWITH_CAIRO=OFF"
|
||||
"-DWITH_FCGI=OFF"
|
||||
"-DWITH_FRIBIDI=OFF"
|
||||
"-DWITH_GEOS=OFF"
|
||||
"-DWITH_GIF=OFF"
|
||||
"-DWITH_HARFBUZZ=OFF"
|
||||
"-DWITH_ICONV=OFF"
|
||||
"-DWITH_PROTOBUFC=OFF"
|
||||
"-DWITH_POSTGIS=OFF"
|
||||
"-DWITH_WMS=ON"
|
||||
"-DWITH_WCS=OFF"
|
||||
"-DWITH_WFS=OFF"
|
||||
)
|
||||
|
||||
echo "${args[@]}"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# NOTE: We could make this based on _generate_cmake_args, but
|
||||
# then we wouldn't be as-explicit about what is enabled/not,
|
||||
# and reliant on defaults not changing.
|
||||
# Readability and maintainability is better this way.
|
||||
local mycmakeargs=(
|
||||
"-DCMAKE_SKIP_RPATH=ON"
|
||||
"-DINSTALL_LIB_DIR=/usr/$(get_libdir)"
|
||||
"-DWITH_CLIENT_WMS=ON"
|
||||
"-DWITH_CLIENT_WFS=ON"
|
||||
"-DWITH_CURL=ON"
|
||||
"-DWITH_GIF=ON"
|
||||
"-DWITH_ICONV=ON"
|
||||
"-DWITH_KML=ON"
|
||||
"-DWITH_LIBXML2=ON"
|
||||
"-DWITH_PHPNG=OFF"
|
||||
"-DWITH_PROTOBUFC=ON"
|
||||
"-DWITH_SOS=ON"
|
||||
"-DWITH_WMS=ON"
|
||||
"-DWITH_WFS=ON"
|
||||
"-DWITH_WCS=ON"
|
||||
"-DWITH_XMLMAPFILE=ON"
|
||||
"-DWITH_APACHE_MODULE=$(usex apache ON OFF)"
|
||||
"-DWITH_CAIRO=$(usex cairo ON OFF)"
|
||||
"-DWITH_FCGI=$(usex apache ON OFF)"
|
||||
"-DWITH_GEOS=$(usex geos ON OFF)"
|
||||
"-DWITH_ORACLESPATIAL=$(usex oracle ON OFF)"
|
||||
"-DWITH_MYSQL=$(usex mysql ON OFF)"
|
||||
"-DWITH_FRIBIDI=$(usex bidi ON OFF)"
|
||||
"-DWITH_HARFBUZZ=$(usex bidi ON OFF)"
|
||||
"-DWITH_POSTGIS=$(usex postgis ON OFF)"
|
||||
"-DWITH_PERL=$(usex perl ON OFF)"
|
||||
)
|
||||
|
||||
use perl && mycmakeargs+=( "-DCUSTOM_PERL_SITE_ARCH_DIR=$(perl_get_raw_vendorlib)" )
|
||||
|
||||
# Configure the standard build first
|
||||
cmake-utils_src_configure
|
||||
|
||||
# Minimal build for bindings
|
||||
# Note that we use _generate_cmake_args to get a clean config each time, then add
|
||||
# in options as appropriate. Otherwise we'd get contamination between bindings.
|
||||
if use python ; then
|
||||
mycmakeargs=(
|
||||
$(_generate_cmake_args)
|
||||
"-DWITH_PYTHON=ON"
|
||||
)
|
||||
|
||||
python_foreach_impl cmake-utils_src_configure
|
||||
python_foreach_impl python_optimize
|
||||
fi
|
||||
|
||||
if use php ; then
|
||||
local slot=
|
||||
for slot in $(php_get_slots) ; do
|
||||
# Switch to the slot's build dir
|
||||
php_init_slot_env "${slot}"
|
||||
|
||||
# Take a blank config each time
|
||||
# Add in only *this* slot's PHP includes dir, etc
|
||||
mycmakeargs=(
|
||||
$(_generate_cmake_args)
|
||||
"-DWITH_PHPNG=ON"
|
||||
"-DPHP_CONFIG_EXECUTABLE=${PHPCONFIG}"
|
||||
"-DPHP_INCLUDES=${PHPPREFIX}"
|
||||
)
|
||||
|
||||
BUILD_DIR="${S}/php${slot}" cmake-utils_src_configure
|
||||
|
||||
# Return to where we left off, in case we add more
|
||||
# to this phase.
|
||||
cd "${S}" || die
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-utils_src_compile
|
||||
|
||||
if use python ; then
|
||||
python_foreach_impl cmake-utils_src_compile
|
||||
fi
|
||||
|
||||
if use php ; then
|
||||
local slot=
|
||||
for slot in $(php_get_slots) ; do
|
||||
# Switch to the slot's build dir
|
||||
php_init_slot_env "${slot}"
|
||||
|
||||
# Force cmake to build in it
|
||||
BUILD_DIR="${S}/php${slot}" cmake-utils_src_compile
|
||||
|
||||
# Return to where we left off, in case we add more
|
||||
# to this phase.
|
||||
cd "${S}" || die
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# Needs to be first
|
||||
use apache && webapp_src_preinst
|
||||
|
||||
if use python ; then
|
||||
python_foreach_impl cmake-utils_src_install
|
||||
python_foreach_impl python_optimize
|
||||
fi
|
||||
|
||||
if use php ; then
|
||||
php-ext-source-r3_createinifiles
|
||||
|
||||
local slot=
|
||||
for slot in $(php_get_slots) ; do
|
||||
php_init_slot_env "${slot}"
|
||||
|
||||
BUILD_DIR="${S}/php${slot}" cmake-utils_src_install
|
||||
|
||||
cd "${S}" || die
|
||||
done
|
||||
fi
|
||||
|
||||
# Install this last because this build is the most "fully-featured"
|
||||
cmake-utils_src_install
|
||||
|
||||
if use apache ; then
|
||||
# We need a mapserver symlink available in cgi-bin
|
||||
dosym ../../../../../../../usr/bin/mapserv /usr/share/webapps/${PN}/${PV}/hostroot/cgi-bin/mapserv
|
||||
webapp_src_install
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
# We need to cache the value here of HAD_PHP because we want the
|
||||
# original package version, not the result of us installing a new one
|
||||
HAD_PHP=
|
||||
has_version 'sci-geosciences/mapserver[php]' && HAD_PHP=1
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
use apache && webapp_pkg_postinst
|
||||
|
||||
# Let upgrading (from a pre-rewrite version) users know that the PHP module changed
|
||||
local replacing_version=
|
||||
for replacing_version in ${REPLACING_VERSIONS} ; do
|
||||
if ver_test "7.6.0" -gt "${replacing_version}" ; then
|
||||
if use php && [[ ${HAD_PHP} -eq 1 ]] ; then
|
||||
elog "Note that MapServer has deprecated the old PHP extension"
|
||||
elog "You can read more at: "
|
||||
elog "URL: https://mapserver.org/MIGRATION_GUIDE.html#mapserver-7-2-to-7-4-migration"
|
||||
elog "This may involve porting some of your PHP scripts to use the new module."
|
||||
fi
|
||||
|
||||
# Only show the message once
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
pkg_prerm() {
|
||||
use apache && webapp_pkg_prerm
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="apache">Enable mapserver to run under apache</flag>
|
||||
<flag name="gdal">Enable <pkg>sci-libs/gdal</pkg> library support</flag>
|
||||
<flag name="gdal" restrict="<=sci-geosciences/mapserver-7.6.0">Enable <pkg>sci-libs/gdal</pkg> library support; deprecated</flag>
|
||||
<flag name="geos">Enable <pkg>sci-libs/geos</pkg> library support</flag>
|
||||
<flag name="postgis">Enable <pkg>dev-db/postgis</pkg> support</flag>
|
||||
<flag name="proj">Enable <pkg>sci-libs/proj</pkg> library support (geographic projections)</flag>
|
||||
<flag name="xslt">Enable xslt and exslt support xml-mapfile support</flag>
|
||||
<flag name="proj" restrict="<=sci-geosciences/mapserver-7.6.0">Enable <pkg>sci-libs/proj</pkg> library support (geographic projections); deprecated</flag>
|
||||
<flag name="xslt" restrict="<=sci-geosciences/mapserver-7.6.0">Enable xslt and exslt support xml-mapfile support; deprecated</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
|
||||
Reference in New Issue
Block a user