# This package is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This package 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this package; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#
module := virtual-mobile-builder
version := 1.0
prefix ?= /usr/local
bindir ?= $(prefix)/bin
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)/$(module)

DESTDIR ?=

INSTALL ?= install -D -p

default:

install:
	$(INSTALL) simple-mobile-builder $(DESTDIR)$(bindir)/simple-mobile-builder
	sed -i 's#^\(DATADIR=\).*#\1"$(datadir)"#' $(DESTDIR)$(bindir)/simple-mobile-builder
	$(INSTALL) data/mobile-fixup.sh $(DESTDIR)$(datadir)/mobile-fixup.sh
	$(INSTALL) -m 0644 data/upstart-session $(DESTDIR)$(datadir)/upstart-session
	$(INSTALL) -m 0644 data/xorg.conf $(DESTDIR)$(datadir)/xorg.conf
	$(INSTALL) -m 0644 data/hardy-full.list $(DESTDIR)$(datadir)/hardy-full.list

ChangeLog:
	bzr log --long >$@

dist: ChangeLog
	bzr export $(module)-$(version).tar.gz

release: dist
	bzr tag $(version)

.PHONY: default install ChangeLog
