--- cracklib,2.7/cracklib/Makefile	Sun Dec 14 17:49:21 1997
+++ cracklib,2.7/cracklib/Makefile	Fri Aug  3 18:09:36 2001
@@ -6,13 +6,23 @@
 # and upwards.
 ###
 
-LIB=	libcrack.a
-OBJ=	fascist.o packlib.o rules.o stringlib.o
-CFLAGS= -O -I../cracklib -DIN_CRACKLIB
+LIB	= libcrack.so
+OBJ	= fascist.o packlib.o rules.o stringlib.o
+CFLAGS	= $(RPM_OPT_FLAGS) -g -I../cracklib -DIN_CRACKLIB -fPIC
+LD	= ld
+includedir  = /usr/include
+libdir      = /usr/lib
 
-$(LIB):	$(OBJ)
-	ar rv $(LIB) $?
-	-ranlib $(LIB)
+$(LIB):	$(OBJ) Makefile
+	$(LD) -shared -soname $(LIB).$(MAJOR) -o $(LIB).$(VERSION) $(OBJ) -lc
+	rm -f $(LIB).$(MAJOR) $(LIB)
+	ln -s $(LIB).$(VERSION) $(LIB).$(MAJOR)
+	ln -s $(LIB).$(MAJOR) $(LIB)
 
 clean:
-	-rm -f $(OBJ) $(LIB) *~
+	-rm -f $(OBJ) $(LIB) $(LIB).$(VERSION) *~
+
+install: $(LIB) crack.h
+	install -m 755 $(LIB).$(VERSION) $(ROOT)$(libdir)
+	ln -sf $(LIB).$(VERSION) $(ROOT)$(libdir)/$(LIB)
+	install -m 644 crack.h $(ROOT)$(includedir)
--- cracklib,2.7/cracklib/fascist.c	Wed Dec 31 05:26:46 1997
+++ cracklib,2.7/cracklib/fascist.c	Fri Aug  3 18:09:36 2001
@@ -11,6 +11,8 @@
 #include "packer.h"
 #include <sys/types.h>
 #include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define ISSKIP(x) (isspace(x) || ispunct(x))
 
@@ -659,7 +661,7 @@
 	return ("it does not contain enough DIFFERENT characters");
     }
 
-    strcpy(password, Lowercase(password));
+    strcpy(password, (char *)Lowercase(password));
 
     Trim(password);
 
@@ -722,7 +724,7 @@
 	}
     }
 
-    strcpy(password, Reverse(password));
+    strcpy(password, (char *)Reverse(password));
 
     for (i = 0; r_destructors[i]; i++)
     {
--- cracklib,2.7/cracklib/stringlib.c	Fri Jul  9 16:23:02 1993
+++ cracklib,2.7/cracklib/stringlib.c	Fri Aug  3 18:09:36 2001
@@ -7,6 +7,7 @@
  */
 
 #include "packer.h"
+#include <string.h>
 
 static char vers_id[] = "stringlib.c : v2.3p2 Alec Muffett 18 May 1993";
 
--- cracklib,2.7/cracklib/packlib.c	Fri Jul  9 16:22:58 1993
+++ cracklib,2.7/cracklib/packlib.c	Fri Aug  3 18:09:36 2001
@@ -6,6 +6,7 @@
  * and upwards.
  */
 
+#include <string.h>
 #include "packer.h"
 
 static char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
--- cracklib,2.7/cracklib/rules.c	Fri Jul  9 16:22:59 1993
+++ cracklib,2.7/cracklib/rules.c	Fri Aug  3 18:09:36 2001
@@ -8,6 +8,8 @@
 
 static char vers_id[] = "rules.c : v5.0p3 Alec Muffett 20 May 1993";
 
+#include <string.h>
+
 #ifndef IN_CRACKLIB
 
 #include "crack.h"
--- cracklib,2.7/util/Makefile	Sun Dec 14 17:49:34 1997
+++ cracklib,2.7/util/Makefile	Fri Aug  3 18:09:36 2001
@@ -14,27 +14,32 @@
 #SunOS users (and others?) should consider static linking of their passwd binary
 #CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"' -Bstatic
 
-CFLAGS= -O -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
-LIBS=	../cracklib/libcrack.a
+CFLAGS	= $(RPM_OPT_FLAGS) -I../cracklib '-DCRACKLIB_DICTPATH="$(DICTPATH)"'
+LDFLAGS	= -L../cracklib -lcrack
+LIBS	= ../cracklib/libcrack.so
+sbindir = /usr/sbin
 
 all:	packer unpacker testnum teststr testlib
 	touch all
 
 packer: packer.o $(LIBS)
-	cc $(CFLAGS) -o $@ $@.o $(LIBS)
+	cc $(CFLAGS) -o $@ $@.o $(LDFLAGS)
 
 unpacker: unpacker.o $(LIBS)
-	cc $(CFLAGS) -o $@ $@.o $(LIBS)
+	cc $(CFLAGS) -o $@ $@.o $(LDFLAGS)
 
 testnum: testnum.o $(LIBS)
-	cc $(CFLAGS) -o $@ $@.o $(LIBS)
+	cc $(CFLAGS) -o $@ $@.o $(LDFLAGS)
 
 teststr: teststr.o $(LIBS)
-	cc $(CFLAGS) -o $@ $@.o $(LIBS)
+	cc $(CFLAGS) -o $@ $@.o $(LDFLAGS)
 
 testlib: testlib.o $(LIBS)
-	cc $(CFLAGS) -o $@ $@.o $(LIBS)
+	cc $(CFLAGS) -o $@ $@.o $(LDFLAGS)
 
 clean:
 	-rm *.o *~ all
 	-rm teststr testnum testlib packer unpacker
+
+install: all
+	install -m 755 mkdict packer $(ROOT)$(sbindir)
--- cracklib,2.7/Makefile	Wed Dec 31 05:33:53 1997
+++ cracklib,2.7/Makefile	Fri Aug  3 18:09:36 2001
@@ -7,14 +7,21 @@
 ###
 
 ###
+# cracklib version
+MAJOR=2
+MINOR=7
+VERSION=$(MAJOR).$(MINOR)
+export MAJOR MINOR VERSION
+
+###
 # set this to the absolute path (less extn) of compressed dict.
 
-DICTPATH="/usr/local/lib/pw_dict"
+DICTPATH="/usr/lib/cracklib_dict"
 
 ###
 # Set this to the path of one or more files continaing wordlists.
 
-SRCDICTS=/usr/dict/words
+SRCDICTS=/usr/dict/* /usr/share/dict/* cracklib-dicts/*
 
 ###
 # If you have installed the cracklib-dicts directory, use this
@@ -36,7 +43,9 @@
 	-rm -f all installed Part* *.BAK *.bak *~
 
 install: all
+	( cd cracklib && make install && exit $$? )
+	( cd util && make install && exit $$? )
 	@echo 'if "sort" dies from lack of space, see "util/mkdict"'
-	util/mkdict $(SRCDICTS) | util/packer $(DICTPATH)
+	util/mkdict $(SRCDICTS) | LD_LIBRARY_PATH=cracklib util/packer $(ROOT)$(DICTPATH)
 	touch installed
 ###	@echo 'now go install passwd/passwd where you want it'
