Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/mapserver/
Date: Wed, 13 Jul 2016 20:30:55
Message-Id: 1468441830.3265cb53d2eddc3f861cbe596366371f5357f5d1.grknight@gentoo
1 commit: 3265cb53d2eddc3f861cbe596366371f5357f5d1
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 13 20:30:30 2016 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 13 20:30:30 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3265cb53
7
8 sci-geosciences/mapserver: Revision bump for php 5.6 and library fixes
9
10 Non-maintainer commit; reviewed by Amynka on IRC
11 The main libmapserver.so was being installed to $D/$D which could not be found
12 Support php 5.6 and fix finding the correct php-config binary for the various slots
13
14 Reviewed-by: amynka <AT> gentoo.org
15
16 Package-Manager: portage-2.3.0
17
18 .../mapserver/mapserver-7.0.1-r1.ebuild | 185 +++++++++++++++++++++
19 1 file changed, 185 insertions(+)
20
21 diff --git a/sci-geosciences/mapserver/mapserver-7.0.1-r1.ebuild b/sci-geosciences/mapserver/mapserver-7.0.1-r1.ebuild
22 new file mode 100644
23 index 0000000..0392bd6
24 --- /dev/null
25 +++ b/sci-geosciences/mapserver/mapserver-7.0.1-r1.ebuild
26 @@ -0,0 +1,185 @@
27 +# Copyright 1999-2016 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +# $Id$
30 +
31 +EAPI=5
32 +
33 +MY_P="${PN}-${PV/_/-}"
34 +
35 +PHP_EXT_OPTIONAL_USE="php"
36 +PHP_EXT_NAME="php_mapscript"
37 +PHP_EXT_S="${WORKDIR}/${MY_P}/mapscript/php/"
38 +PHP_EXT_SKIP_PHPIZE="no"
39 +USE_PHP="php5-6 php5-5"
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +
43 +#USE_RUBY="ruby18 ruby19"
44 +#RUBY_OPTIONAL="yes"
45 +
46 +WEBAPP_MANUAL_SLOT=yes
47 +
48 +inherit eutils depend.apache webapp distutils-r1 flag-o-matic perl-module php-ext-source-r2 multilib cmake-utils # ruby-ng
49 +
50 +DESCRIPTION="Development environment for building spatially enabled webapps"
51 +HOMEPAGE="http://mapserver.org/"
52 +SRC_URI="http://download.osgeo.org/mapserver/${MY_P}.tar.gz"
53 +
54 +LICENSE="MIT"
55 +KEYWORDS="~amd64 ~x86"
56 +SLOT="0"
57 +IUSE="bidi cairo gdal geos mysql opengl perl php postgis proj python threads tiff xml xslt" # ruby php tcl
58 +
59 +REQUIRED_USE="php? ( ^^ ( php_targets_php5-6 php_targets_php5-5 ) )
60 + xslt? ( xml )"
61 +
62 +RDEPEND="
63 + dev-libs/expat
64 + dev-libs/fcgi
65 + >=media-libs/gd-2.0.12[truetype,jpeg,png,zlib]
66 + media-libs/giflib
67 + net-misc/curl
68 + virtual/jpeg:=
69 + virtual/libiconv
70 + x11-libs/agg
71 + bidi? ( dev-libs/fribidi
72 + media-libs/harfbuzz )
73 + cairo? ( x11-libs/cairo )
74 + gdal? ( >=sci-libs/gdal-1.8.0 )
75 + geos? ( sci-libs/geos )
76 + mysql? ( virtual/mysql )
77 + opengl? (
78 + media-libs/ftgl
79 + media-libs/mesa
80 + )
81 + perl? ( dev-lang/perl:= )
82 + postgis? ( dev-db/postgis )
83 + proj? ( sci-libs/proj net-misc/curl )
84 + tiff? (
85 + media-libs/tiff:=
86 + sci-libs/libgeotiff
87 + )
88 + xml? ( dev-libs/libxml2:2 )
89 + xslt? ( dev-libs/libxslt[crypt] )
90 +"
91 +DEPEND="${RDEPEND}
92 + perl? ( >=dev-lang/swig-2.0 )
93 + python? ( >=dev-lang/swig-2.0 )"
94 +
95 +need_apache2
96 +
97 +PATCHES=(
98 + "${FILESDIR}/${PN}-7.0.0-sec-format.patch" # see https://github.com/mapserver/mapserver/pull/5248
99 + "${FILESDIR}/${PN}-7.0.0-no-applicable-code.patch"
100 +)
101 +
102 +S=${WORKDIR}/${MY_P}
103 +
104 +pkg_setup() {
105 + webapp_pkg_setup
106 + use perl && perl_set_version
107 + #use ruby && ruby-ng_pkg_setup
108 +}
109 +
110 +src_unpack() {
111 + # unpack A and then copy the php thingies into workdir/php-slot
112 + php-ext-source-r2_src_unpack
113 + # HACK: and then remove it and replace by symlink
114 + local slot
115 + for slot in $(php_get_slots); do
116 + rm -rf "${WORKDIR}/${slot}" || die
117 + ln -s "${PHP_EXT_S}" "${WORKDIR}/${slot}" || die
118 + done
119 +}
120 +
121 +src_prepare() {
122 + local glibdir="${EPREFIX}/usr/include/glib-2.0"
123 + local usrglibdir="${EPREFIX}/usr/$(get_libdir)/glib-2.0/include"
124 +
125 + sed -e "s:^include_directories(:&${glibdir})\ninclude_directories(:" \
126 + -i "${S}/CMakeLists.txt" || die
127 + sed -e "s:include_directories(:&${usrglibdir})\ninclude_directories(:" \
128 + -i "${S}/CMakeLists.txt" || die
129 +
130 + cmake-utils_src_prepare
131 +}
132 +
133 +src_configure() {
134 + local mycmakeargs=(
135 + "-DCMAKE_SKIP_RPATH=ON"
136 + "-DWITH_ORACLESPATIAL=OFF"
137 + "-DWITH_SDE=OFF"
138 + "-DWITH_APACHE_MODULE=ON"
139 + "-DWITH_ICONV=ON"
140 + "-DWITH_GD=ON"
141 + "-DWITH_GIF=ON"
142 + "-DWITH_CURL=ON"
143 + "-DWITH_FCGI=ON"
144 + "-DINSTALL_LIB_DIR=${ROOT}usr/$(get_libdir)"
145 + "-DWITH_PROJ=$(usex proj ON OFF)"
146 + "-DWITH_WMS=$(usex proj ON OFF)"
147 + "-DWITH_KML=$(usex xml ON OFF)"
148 + "-DWITH_GEOS=$(usex geos ON OFF)"
149 + "-DWITH_GDAL=$(usex gdal ON OFF)"
150 + "-DWITH_OGR=$(usex gdal ON OFF)"
151 + "-DWITH_POSTGIS=$(usex postgis ON OFF)"
152 + "-DWITH_MYSQL=$(usex mysql ON OFF)"
153 + "-DWITH_LIBXML2=$(usex xml ON OFF)"
154 + "-DWITH_XMLMAPFILE=$(usex xslt ON OFF)"
155 + "-DWITH_FRIBIDI=$(usex bidi ON OFF)"
156 + "-DWITH_HARFBUZZ=$(usex bidi ON OFF)"
157 + "-DWITH_CAIRO=$(usex cairo ON OFF)"
158 + "-DWITH_PHP=$(usex php ON OFF)"
159 + "-DWITH_PYTHON=$(usex python ON OFF)"
160 + "-DWITH_PERL=$(usex perl ON OFF)"
161 + )
162 +
163 + if use gdal && use proj ; then
164 + mycmakeargs+=( "-DWITH_WFS=ON"
165 + "-DWITH_WCS=ON"
166 + "-DWITH_CLIENT_WMS=ON"
167 + "-DWITH_CLIENT_WFS=ON"
168 + "-DWITH_SOS=$(usex xml ON OFF)"
169 + )
170 + else
171 + mycmakeargs+=( "-DWITH_WFS=OFF"
172 + "-DWITH_WCS=OFF"
173 + "-DWITH_CLIENT_WMS=OFF"
174 + "-DWITH_CLIENT_WFS=OFF"
175 + "-DWITH_SOS=OFF"
176 + )
177 + fi
178 +
179 + if use php ; then
180 + local slot
181 + for slot in $(php_get_slots); do
182 + mycmakeargs+=( -DPHP5_CONFIG_EXECUTABLE="${EPREFIX}/usr/$(get_libdir)/${slot}/bin/php-config" )
183 + done
184 + fi
185 +
186 + cmake-utils_src_configure
187 +}
188 +
189 +src_compile() {
190 + cmake-utils_src_compile
191 +}
192 +
193 +src_install() {
194 + cmake-utils_src_install
195 +
196 + if use php ; then
197 + php-ext-source-r2_createinifiles
198 + fi
199 + webapp_src_preinst
200 + exeinto "${MY_CGIBINDIR}"
201 + doexe "${S}_build/mapserv"
202 + webapp_src_install
203 +}
204 +
205 +pkg_postinst() {
206 + webapp_pkg_postinst
207 +}
208 +
209 +pkg_prerm() {
210 + webapp_pkg_prerm
211 +}