# Makefile - makefile for xhotkeys
PACKAGE=xhotkeys

# Destination directoy
DESTDIR= 

# Define destination directories

BINDIR=$(DESTDIR)/usr/bin
SBINDIR=$(DESTDIR)/usr/sbin
MAN1DIR=$(DESTDIR)/usr/share/man/man1
SHAREDIR=$(DESTDIR)/usr/share/$(PACKAGE)
LIBDIR=$(DESTDIR)/usr/lib/$(PACKAGE)

# Useful variables
VERSION=$(shell cat debian/changelog | head -n1 | awk '{print $$2}' | cut -d"-" -f1 | sed "s/^.//")
TARBALL=$(PACKAGE)-$(VERSION).tar.gz
FTP_SERVER=ftp://savannah.gnu.org/incoming/savannah/$(PACKAGE)/

# ------------- don't edit anything below this line --------------

FILES=xhotkeys xhotkeys.glade README TODO Makefile

all: 

xhotkeys:

xhotkeys.glade:

install: all
	# Create directories
	mkdir -p $(SHAREDIR)
	
	# Install files
	install -m 755 xhotkeys $(BINDIR)
	install -m 644 xhotkeys.glade $(SHAREDIR)
	install -m 644 xhotkeys.1 $(MAN1DIR)

dist: ../$(TARBALL)

../$(TARBALL): $(FILES)
	cp debian/changelog ChangeLog
	(cd ..; tar --exclude=CVS -czf $(TARBALL) $(PACKAGE))
	rm -f ../$(TARBALL).sig
	gpg -b --use-agent ../$(TARBALL) || true

upload: dist
	(cd ..; wput $(TARBALL)* $(FTP_SERVER))

clean:
	rm -f *.tar.gz*
