--- ../cracklib,2.7.orig/cracklib/Makefile	Sun Dec 14 14:49:21 1997
+++ cracklib/Makefile	Wed Apr 21 13:06:12 2004
@@ -6,13 +6,47 @@
 # and upwards.
 ###
 
-LIB=	libcrack.a
+PREFIX=		/usr/local
+DESTDIR=
+VERSION=	2.7
+MAJOR=		$(word 1,$(subst ., ,$(VERSION)))
+LIB=		crack
+STATICLIB=	lib$(LIB).a
+SHLIB_NAME=	lib$(LIB).$(VERSION).dylib
+SHLIB_MAJOR=lib$(LIB).$(MAJOR).dylib
+SHLIB_LINK=	lib$(LIB).dylib
 OBJ=	fascist.o packlib.o rules.o stringlib.o
-CFLAGS= -O -I../cracklib -DIN_CRACKLIB
+CFLAGS= -O2 -g -I../cracklib -DIN_CRACKLIB
+LDFLAGS=	-dynamiclib \
+			-install_name $(PREFIX)/lib/$(SHLIB_MAJOR) \
+			-compatibility_version $(MAJOR) \
+			-current_version $(VERSION)
+CC=		gcc
+LN=		ln
+INSTALL=install
 
-$(LIB):	$(OBJ)
-	ar rv $(LIB) $?
-	-ranlib $(LIB)
+all: $(STATICLIB) $(SHLIB_NAME)
+
+install: all
+	$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include
+	$(INSTALL) -c -m 0644 packer.h $(DESTDIR)$(PREFIX)/include
+	$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/lib
+	$(INSTALL) -c -m 0755 $(SHLIB_NAME) $(DESTDIR)$(PREFIX)/lib
+	$(INSTALL) -c -m 0644 $(STATICLIB) $(DESTDIR)$(PREFIX)/lib
+	$(LN) -fs $(SHLIB_NAME) $(DESTDIR)$(PREFIX)/lib/$(SHLIB_MAJOR)
+	$(LN) -fs $(SHLIB_NAME) $(DESTDIR)$(PREFIX)/lib/$(SHLIB_LINK)
+	$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3
+	$(INSTALL) -c -m 0644 cracklib.3 $(DESTDIR)$(PREFIX)/share/man/man3
+	$(LN) -fs cracklib.3 $(DESTDIR)$(PREFIX)/share/man/man3/FascistCheck.3
+
+$(STATICLIB):	$(OBJ)
+	ar rv $(STATICLIB) $?
+	-ranlib $(STATICLIB)
+
+$(SHLIB_NAME): $(OBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ)
+	$(LN) -fs $(SHLIB_NAME) $(SHLIB_MAJOR)
+	$(LN) -fs $(SHLIB_NAME) $(SHLIB_LINK)
 
 clean:
-	-rm -f $(OBJ) $(LIB) *~
+	-rm -f $(OBJ) $(STATICLIB) $(SHLIB_NAME) $(SHLIB_LINK) *~
