#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_add_destdir_to_makefile.dpatch by Tiago Bortoletto Vaz <tiago@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add DESTDIR to send the binary to the right place in Makefile

@DPATCH@
diff -urNad nasty-0.6~/Makefile nasty-0.6/Makefile
--- nasty-0.6~/Makefile	2009-09-27 19:12:55.000000000 -0300
+++ nasty-0.6/Makefile	2009-09-27 19:14:15.000000000 -0300
@@ -3,6 +3,7 @@
 DEBUG=-g # -pg
 CFLAGS+=-Wall -O2 -DVERSION=\"${VERSION}\" $(DEBUG)
 LDFLAGS=-lgpgme $(DEBUG)
+BINDIR=/usr/bin
 
 OBJS=nasty.o
 
@@ -12,7 +13,8 @@
 	$(CC) -Wall -W $(OBJS) $(LDFLAGS) -o nasty
 
 install: nasty
-	cp nasty /usr/bin
+	mkdir -p $(DESTDIR)/$(BINDIR)
+	cp nasty $(DESTDIR)/$(BINDIR)
 
 clean:
 	rm -f $(OBJS) nasty core
