#!/usr/bin/make -f

# Copyright 2008, 2009, 2010 Kevin Ryde

# This file is part of miscbits-el.
#
# miscbits-el 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.
#
# miscbits-el 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
include /usr/share/cdbs/1/class/makefile.mk

MY_CONFIGS = \
  prefix=/usr \
  lispdir=/usr/share/emacs/site-lisp/miscbits-el \
  DESTDIR=$(DEB_DESTDIR)

DEB_MAKE_BUILD_TARGET   = all     $(MY_CONFIGS)
DEB_MAKE_INSTALL_TARGET = install $(MY_CONFIGS)

install/miscbits-el::
	dh_install \
	  tools/miscbits-byte-compile.el \
	  tools/miscbits-generate-loaddefs.el \
	  /usr/share/miscbits-el/
        # remove built stuff for the particular emacs present at build time
	rm -f \
	  debian/miscbits-el/usr/share/emacs/site-lisp/miscbits-el/miscbits-el-loaddefs.el \
	  debian/miscbits-el/usr/share/emacs/site-lisp/miscbits-el/*.elc
