--- /dev/null
+--- cdp-0.33/misc.c.orig Wed Apr 24 22:34:55 1996
++++ cdp-0.33/misc.c Wed Apr 24 22:34:59 1996
+@@ -54,12 +54,12 @@
+
+ void exit_ncurses( void )
+ {
+- curs_set( 1 );
+- resetty();
+- resetterm();
+-
+- if ( fNCursesActive )
++ if ( fNCursesActive ) {
++ curs_set( 1 );
++ resetty();
++ resetterm();
+ endwin();
++ }
+
+ fNCursesActive = FALSE;
+ }
+--- cdp-0.33/cdp.c.ewt Fri Aug 9 15:44:20 1996
++++ cdp-0.33/cdp.c Fri Aug 9 15:44:29 1996
+@@ -20,6 +20,7 @@
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ \*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
+
++#include <errno.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+--- cdp-0.33/volume.c.ewt Fri Aug 9 15:44:54 1996
++++ cdp-0.33/volume.c Fri Aug 9 15:45:07 1996
+@@ -22,7 +22,8 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+-#include <sys/soundcard.h>
++#include <linux/soundcard.h>
++#include <sys/ioctl.h>
+
+ #include "volume.h"
+
--- /dev/null
+--- cdp-0.33/Makefile.orig Mon Jan 8 12:05:20 1996
++++ cdp-0.33/Makefile Mon Jan 8 12:07:21 1996
+@@ -10,7 +10,7 @@
+ COMP_OPT = -Wall -O2
+ LINK_OPT =
+ LIBPATH=/usr/lib
+-LIBS = -ltermcap -L$(LIBPATH) -lncurses
++LIBS = -L$(LIBPATH) -lncurses
+ OBJS = cdp.o color.o display.o misc.o volume.o hardware.o database.o getline.o
+
+
+@@ -22,10 +22,7 @@
+ #
+ # If you compile under SystemV, set the NCURSES variable to `.'
+ #
+-NCURSES=/usr/local/include
+-ifeq ($(wildcard /usr/include/ncurses), /usr/include/ncurses)
+ NCURSES=/usr/include/ncurses
+-endif
+
+ DBG = -I$(NCURSES)
+
+@@ -59,9 +56,9 @@
+ install: cdp cdp.1.Z
+ chmod 755 cdp
+ chmod 644 cdp.1.Z
+- cp cdp /usr/local/bin
+- ln -s /usr/local/bin/cdp /usr/local/bin/cdplay
+- cp cdp.1.Z /usr/man/cat1
++ install -m 755 -s cdp $(DESTDIR)/usr/bin
++ ln -sf cdp $(DESTDIR)/usr/bin/cdplay
++ install -m 644 cdp.1 $(DESTDIR)/usr/man/man1
+
+ clean:
+ rm -f cdp cdp.1.Z *.o core *~
--- /dev/null
+--- cdp-0.33/hardware.c.ewt Thu Jul 10 14:35:41 1997
++++ cdp-0.33/hardware.c Thu Jul 10 14:35:49 1997
+@@ -15,6 +15,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
++#include <sys/ustat.h>
+ #ifdef linux
+ # include <linux/cdrom.h>
+ #else
--- /dev/null
+--- cdp-0.33/hardware.c.orig Fri Nov 10 01:10:42 1995
++++ cdp-0.33/hardware.c Wed Dec 11 22:04:57 1996
+@@ -177,10 +177,8 @@
+ if ((pStatus->cd_fd = open (cd_device, O_RDONLY )) < 0) {
+ if (errno == EACCES) {
+ if (!warned) {
+- displayClearScreen( NULL );
++ exit_ncurses();
+ strcpy (realname, cd_device);
+- resetty();
+- resetterm();
+ fprintf (stderr,
+ "As root, please run\n\nchmod 666 %s\n\n%s\n", realname,
+ "to give yourself permission to access the CD-ROM device.");