$NetBSD: patch-aa,v 1.3 2010/01/27 20:15:39 joerg Exp $

--- Makefile.orig	2004-04-16 20:59:06.000000000 -0700
+++ Makefile
@@ -8,16 +8,16 @@ CC=gcc
 #        /etc/super-users and /usr/adm/sulog that are defined
 #        separately.
 # 
-DEST=/usr/local
+DEST=${PREFIX}
 BINDIR=$(DEST)/bin
-MANDIR=$(DEST)/man
+MANDIR=$(DEST)/${PKGMANDIR}/man1
 
 # OPTIONS:
 # There are a number of DEFINES that can be used to configure su2.  Please
 # see the source to su2.c for a full listing of all of the available options.
 
 # Standard
-OPTIONS=-DFULLPATH 
+OPTIONS=-DSU2LOGFILE="\"/var/log/su2.log\"" -DSUPERUSERS="\"$(PREFIX)/etc/super-users\"" -DBROKENCUSERID
 
 # m88k
 # OPTIONS=-DFULLPATH -DNOVFORK
@@ -31,13 +31,18 @@ OPTIONS=-DFULLPATH 
 # Shadow Passwords (Solaris)
 # OPTIONS=-DFULLPATH -DUSE_SHADOW
 
-CFLAGS=-O $(OPTIONS)
+CFLAGS+= $(OPTIONS)
 
 su2:	su2.c
 
-install: su2
-	install -c -m 4711 -o root su2 $(BINDIR)/su2
-	install -c su2.man $(MANDIR)/su2.1
+su2.1:
+	sed 's,/etc/super,${PREFIX}/etc/super,g' <su2.man >su2.1
+
+all:	su2 su2.1
+
+install: su2 su2.1
+	${BSD_INSTALL_PROGRAM} su2 ${DESTDIR}$(BINDIR)/su2
+	${BSD_INSTALL_MAN} su2.1 ${DESTDIR}$(MANDIR)/su2.1
 
 clean:
 	rm -f su2 *.o *.a
