# Edit this file to configure debian/rules to build a package.
# No modification of debian/rules should be neccessary. (Famous last words!)
#
# File by Joey Hess <joeyh@master.debian.org>

# What is the name of this package?
package=pdmenu

# Files that go in directories under /doc.
docs=README doc/TODO doc/BUGS

# What file must exist in the current directory if the package is
# properly unpacked here?
test_file=src/$(package).c

# Does this package build from an Imakefile?
# If so, uncomment the line below.
#use_imakefile=y

# Does this package build from a Configure script?
# If so, uncomment the line below and enter the command to run to run the 
# Configure script (ie: "./Configure")
use_configure=./configure --prefix=/usr --sysconfdir=/etc

# What commands to run to build the package?
define build_command
	$(MAKE)
endef

# What commands to run to clean up after a build?
define clean_command
	-$(MAKE) -i distclean
endef

# List here any files that must be removed during "debian/rules clean"
# that clean_command doesn't take care of.
clean_files=

# List here any files that should be preserved during a build, and restored
# to their original state during a clean. For example, if the package comes
# with both an Imakefile and a Makefile, and xmkmf is run, list the original
# Makefile here so it will be backed up before it is overwritten my xmkmf.
preserve_files=

# What command to run to install the package into debian/tmp?
# You might want to edit the package's Makefile and add $(PREFIX) 
# to all the paths it installs files to. or, you can just write 
# your own install commands here instead.
#
# Note that debian/* and the files in /usr/doc will be installed 
# properly for you, you don't need to do that here.
#
define install_command
	$(MAKE) INSTALL_PREFIX=debian/tmp install
	install -m 0644 debian/pdmenurc.debian debian/tmp/etc/pdmenurc
	install -d debian/tmp/etc/menu-methods debian/tmp/var/lib/pdmenu \
		debian/tmp/usr/sbin
	install debian/pdmenu-genmenu.conf debian/tmp/etc/menu-methods/pdmenu
	install debian/pdmenu-genmenu debian/tmp/usr/sbin
	touch debian/tmp/var/lib/pdmenu/pdmenurc_auto
	install -d debian/tmp/usr/lib/menu
	install -m 0644 debian/menufile debian/tmp/usr/lib/menu/pdmenu
endef

# After being installed in debian/tmp, everything is chowned to root.root,
# and chmod g-ws is run on everything. Enter below any chmod commands you
# need to run to set files to the proper permissions. This is where you
# can make programs be suid, etc.
# (Note that these commands will be run as root.)
define ch_commands
endef
