1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
|
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
package=mapserver
version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
CURDIR := $(shell pwd)
PYVERS=$(shell pyversions -r debian/control)
RUBYVERS=1.8 1.9
PHP5API=$(shell php-config5 --phpapi)
PHP5DIR=$(shell php-config5 --extension-dir)
AGG=agg-2.4
# Configure config :
# Not using non free libpdf
# Explicit disable direct goetiff support,
# it's better to use gdal geotiff support for stability reasons
COMMON_CONFIG= --prefix=/usr \
--enable-debug \
--without-tiff \
--without-pdf \
--with-gd=/usr \
--with-freetype=/usr \
--with-zlib=/usr \
--with-png=/usr \
--with-xpm=/usr \
--with-jpeg=/usr \
--with-gdal \
--with-ogr \
--with-proj \
--with-eppl \
--with-postgis \
--with-wcs \
--with-wms \
--with-wmsclient \
--with-wfs \
--with-wfsclient \
--with-threads \
--with-geos \
--with-fastcgi \
--with-agg=$(CURDIR)/.$(AGG)
rstoptions=--stylesheet=mapscript.css --link-stylesheet
configure-agg: configure-agg-stamp
configure-agg-stamp:
uudecode -o /dev/stdout $(CURDIR)/debian/$(AGG).uu | tar xzf -
( cd $(AGG) && \
./configure --prefix=$(CURDIR)/.$(AGG) \
--disable-shared --disable-gpc --enable-freetype --disable-examples --with-pic )
touch configure-agg-stamp
build-agg: build-agg-stamp
build-agg-stamp: configure-agg-stamp
$(MAKE) -C $(AGG)
$(MAKE) -C $(AGG) install
touch build-agg-stamp
MS_CFLAGS=-g -O2
MS_CXXFLAGS=$(MS_CFLAGS)
configure-stamp: patch build-agg-stamp
dh_testdir
./configure $(COMMON_CONFIG) CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)"
touch configure-stamp
configure-php5-stamp: patch clean-first-build
dh_testdir
./configure $(COMMON_CONFIG) \
--with-php=/usr/include/php5 CFLAGS="$(MS_CFLAGS)" CXXFLAGS="$(MS_CXXFLAGS)"
touch configure-php5-stamp
# This is the correct, policy-compliant build target
#build: build-indep build-arch
# This is the incorrect, non-policy compliant build target
# it is nessecary because the auto-builders use build, but don't install Build-Depends-Indep
build: build-arch
build-indep: build-indep-stamp
build-indep-stamp:
dh_testdir
mkdir html
rst2html $(rstoptions) mapscript/doc/imagery-HOWTO.txt > html/imagery-HOWTO.html
rst2html $(rstoptions) mapscript/doc/mapfile-HOWTO.txt > html/mapfile-HOWTO.html
rst2html $(rstoptions) mapscript/doc/mapscript.txt > html/mapscript.html
rst2html $(rstoptions) mapscript/doc/python.txt > html/python.html
rst2html $(rstoptions) mapscript/doc/querying-HOWTO.txt > html/querying-HOWTO.html
for i in rfc/ms-rfc*.txt; do \
html=`echo $$i | sed -e 's/rfc/html/g'`; \
rst2html $(rstoptions) $$i > $$html; \
done
cp mapscript/doc/default.css html
cp mapscript/doc/mapscript.css html
touch build-indep-stamp
build-arch: build-arch-stamp
build-arch-stamp: configure-stamp build-agg-stamp
dh_testdir
# Build binary lib
$(MAKE) mapscriptvars || touch mapscriptvars
$(MAKE)
# Build Perl mapscript
cd $(CURDIR)/mapscript/perl && \
perl Makefile.PL INSTALLDIRS=vendor \
&& $(MAKE) LD_RUN_PATH="" OPTIMIZE="-O2 -g -W -Wall"
# Build python
# This is a dirty hack to properly link agg static libraries using setup.py
# It fixes
# 1. changes a bit mapscriptvars
sed -e 's/ -lagg/\/libagg.a/' -e 's/-L\([^ ]*\.agg-2\.4\/lib\)\/libagg\.a\ -laggfontfreetype/\1\/libagg.a \1\/libaggfontfreetype.a/' \
$(CURDIR)/mapscriptvars >$(CURDIR)/mapscript/python/mapscriptvars
# 2. now changes setup.py to use the changed copy
sed -e 's/\("\)\.\.\/\.\.\/\(mapscriptvars"\)/\1\2/' \
$(CURDIR)/mapscript/python/setup.py >$(CURDIR)/mapscript/python/setup-hack.py
cd $(CURDIR)/mapscript/python && \
set -e; for python in $(PYVERS); do $$python setup-hack.py build; done
# Build ruby
cd $(CURDIR)/mapscript/ruby && set -e ; \
for v in $(RUBYVERS) ; do \
ruby$$v extconf.rb && $(MAKE) && \
mv mapscript.so ruby$$v-mapscript.so ; \
done
touch build-arch-stamp
build-php5-stamp: configure-php5-stamp
dh_testdir
-cd mapscript/php3 && \
$(MAKE) clean
# Build php_mapscript
$(MAKE)
# This is needed to do 'make clean', but will be removed by the clean
# targets. The end result is that 'debuild clean' only can execute
# once. Hack around this problem by faking the creation when make fail.
clean-first-build:
dh_testdir
-$(RM) configure-stamp build-arch-stamp build-indep-stamp
-$(RM) tile4ms
[ ! -f $(CURDIR)/Makefile ] || $(MAKE) mapscriptvars
touch mapscriptvars
[ ! -f $(CURDIR)/mapscript/perl/Makefile ] || $(MAKE) distclean -C $(CURDIR)/mapscript/perl
-cd mapscript/python && \
for python in $(PYVERS); do $$python setup-hack.py clean; done
-$(RM) -rf mapscript/python/build
[ ! -f $(CURDIR)/mapscript/ruby/Makefile ] || $(MAKE) distclean -C $(CURDIR)/mapscript/ruby
-$(RM) -rf $(CURDIR)/mapscript/ruby/mapscript_wrap.c
-$(RM) mapscriptvars
# Clean private python-mapscript hacks
-$(RM) mapscript/python/mapscriptvars
-$(RM) mapscript/python/setup-hack.py
-$(RM) mapscript/perl/mapscript.i \
mapscript/tcl/mapscript.i \
mapscript/python/mapscript.i
[ ! -f $(CURDIR)/Makefile ] || $(MAKE) distclean
# Remove some generated files until 50_clean.dpatch is applied upstream.
-$(RM) Makefile mapscript/java/Makefile
-$(RM) mapscript/csharp/Makefile mapscript/php3/Makefile
-$(RM) config.log config.status
-$(RM) -rf html/
-$(RM) debian/.#* .#*
clean-agg:
-$(RM) -rf $(CURDIR)/$(AGG)
-$(RM) -rf $(CURDIR)/.$(AGG)
-$(RM) -f build-agg-stamp configure-agg-stamp
clean: unpatch clean-first-build clean-agg
dh_testdir
dh_clean
-$(RM) configure-php5-stamp build-php5-stamp install-arch-stamp install-indep-stamp install-php5-stamp
-$(MAKE) distclean
install-indep: install-indep-stamp
install-indep-stamp: build-indep
dh_testdir -i
dh_testroot -i
dh_installdirs -i
dh_install -i
touch install-indep-stamp
install-arch: install-arch-stamp install-php5-stamp
install-arch-stamp: build-arch
dh_testdir -a
dh_testroot -a
dh_installdirs -a
-mkdir -p debian/tmp/usr/lib/ debian/tmp/usr/include/ \
debian/tmp/usr/lib/cgi-bin/ \
debian/tmp/usr/bin
# CGI mapserver
install -m755 mapserv debian/tmp/usr/lib/cgi-bin/mapserv
# Perl mapscript
cd $(CURDIR)/mapscript/perl && \
$(MAKE) install PREFIX=$(CURDIR)/debian/perl-mapscript/usr/ \
SITEPREFIX=$(CURDIR)/debian/perl-mapscript/usr/
# Python mapscript
cd $(CURDIR)/mapscript/python && set -e ; \
for python in $(PYVERS); do \
$$python setup-hack.py install --root=$(CURDIR)/debian/python-mapscript ; \
done
# Ruby mapscript
cd $(CURDIR)/mapscript/ruby && set -e ; \
for v in $(RUBYVERS) ; do \
ruby$$v extconf.rb ; \
$(MAKE) install sitedir=$(CURDIR)/debian/libmapscript-ruby$$v/usr/lib/ruby ; \
$(MAKE) distclean ; \
done
# Mapserver Binary
install -m755 legend scalebar shp2img shptree \
shptreetst shptreevis sortshp tile4ms \
debian/tmp/usr/bin
install -m755 shp2mysql.pl debian/tmp/usr/bin/shp2mysql
touch install-arch-stamp
install-php5-stamp: build-php5-stamp
dh_testdir
dh_testroot
-mkdir -p debian/tmp$(PHP5DIR)
# php5-mapscript
install -m644 mapscript/php3/php_mapscript.so \
debian/tmp$(PHP5DIR)
echo 'misc:Depends=phpapi-'$(PHP5API) >> debian/php5-mapscript.substvars
touch install-php5-stamp
binary-indep: install-indep
dh_testdir -i
dh_testroot -i
dh_installchangelogs -i HISTORY.TXT
dh_installdocs -i
dh_installexamples -i
dh_installdebconf -i
dh_compress -i
dh_link -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: install-arch
dh_testdir -a
dh_testroot -a
dh_movefiles -a
dh_installchangelogs -a HISTORY.TXT
dh_installdocs -a
dh_installexamples -a
chmod a-x debian/php*-mapscript/usr/share/doc/php*-mapscript/examples/*.phtml
dh_installdebconf -a
dh_pycentral -ppython-mapscript
dh_compress -a
dh_link -a
dh_strip -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_shlibdeps -a
dh_perl -pperl-mapscript
dh_perl -pmapserver-bin
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install install-indep install-arch
include /usr/share/dpatch/dpatch.make
|