--- ../cracklib,2.7.orig/Makefile	Wed Dec 31 02:33:53 1997
+++ Makefile	Wed Apr 21 11:28:15 2004
@@ -6,26 +6,36 @@
 # and upwards.
 ###
 
+VERSION=	2.7
+DESTDIR=
+PREFIX=		/usr/local
+INSTALL=	install
+
 ###
 # set this to the absolute path (less extn) of compressed dict.
 
-DICTPATH="/usr/local/lib/pw_dict"
+DICTPATH=	$(PREFIX)/lib/cracklib/pw_dict
 
 ###
 # Set this to the path of one or more files continaing wordlists.
 
-SRCDICTS=/usr/dict/words
+SRCDICTS=	/usr/share/dict/words
 
 ###
 # If you have installed the cracklib-dicts directory, use this
 #SRCDICTS=/usr/dict/words cracklib-dicts/*
 
+MAKEARGS=	VERSION=$(VERSION) \
+			DESTDIR=$(DESTDIR) \
+			PREFIX=$(PREFIX) \
+			DICTPATH=$(DICTPATH)
+
 default:
 	@echo "you evidently don't know what you're doing. go read the README"
 
 all:
-	( cd cracklib && make && exit $$? )
-	( cd util && make DICTPATH=$(DICTPATH) && exit $$? )
+	( cd cracklib && make $(MAKEARGS) $@ && exit $$? )
+	( cd util && make $(MAKEARGS) $@ && exit $$? )
 ###	( cd passwd && make DICTPATH=$(DICTPATH) passwd && exit $$? )
 ###	touch all
 
@@ -36,7 +46,10 @@
 	-rm -f all installed Part* *.BAK *.bak *~
 
 install: all
+	( cd cracklib && make $(MAKEARGS) $@ && exit $$? )
+	( cd util && make $(MAKEARGS) $@ && exit $$? )
+	$(INSTALL) -d -m 0755 $(DESTDIR)$(dir $(DICTPATH))
 	@echo 'if "sort" dies from lack of space, see "util/mkdict"'
-	util/mkdict $(SRCDICTS) | util/packer $(DICTPATH)
+	util/mkdict $(SRCDICTS) | DYLD_LIBRARY_PATH=./cracklib util/packer $(DESTDIR)$(DICTPATH)
 	touch installed
 ###	@echo 'now go install passwd/passwd where you want it'
