#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010-2014, 2016-2017 Jonas Smedegaard <dr@jones.dk>
# Copyright © 2011 Andrew Harvey <andrew.harvey4@gmail.com>
# Description: Main Debian packaging script for Leaflet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

include /usr/share/cdbs/1/rules/debhelper.mk

libname = leaflet
pkg = libjs-leaflet

CDBS_BUILD_DEPENDS +=, node-uglify (>= 2), node-jake, node-source-map

js-destdir = /usr/share/javascript/$(libname)

DEB_DH_INSTALL_ARGS_$(pkg) = debian/js/* dist/* $(js-destdir)

build/$(pkg)::
	jake build
	mkdir -p debian/js
	mv -f dist/leaflet.js debian/js/leaflet.min.js
	mv -f dist/leaflet-src.js debian/js/leaflet.js
	mv -f dist/leaflet-src.map debian/js/leaflet.min.map

clean::
	rm -rf debian/js
