[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

update: cdrchive



Here are some patches to let misc/cdrchive compile with qt3 and
properly process the output of the new cdrecord.

I also made cdrchive use absolute pathnames when calling cdrecord,
cdda2wav, and smkisofs.

Please test, comment, yada, yada

--
<jakemsr_(_at_)_jakemsr_(_dot_)_com>

diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/Makefile cdrchive/Makefile
--- /usr/ports/misc/cdrchive/Makefile	Tue May 14 09:52:59 2002
+++ cdrchive/Makefile	Wed May 15 21:04:58 2002
@@ -5,7 +5,7 @@
 PKGNAME=		${DISTNAME:S/-OpenBSD//}
 DISTNAME=		cdrchive-1.0.1-OpenBSD
 CATEGORIES=		misc x11
-NEED_VERSION=		1.483
+NEED_VERSION=		1.522
 
 HOMEPAGE=		http://www.drahthaar.clara.net/cdr.htm
 
@@ -20,7 +20,7 @@
 MASTER_SITES=		http://www.drahthaar.clara.net/ \
 			http://www.jakemsr.com/openbsd/ports/
 
-MODULES=		qt2
+MODULES=		qt3
 
 RUN_DEPENDS=		::sysutils/cdrtools
 
@@ -32,10 +32,15 @@
 			--x-libraries=${X11BASE}/lib \
 			--with-extra-includes=${LOCALBASE}/include \
 			--with-extra-libs=${LOCALBASE}/lib \
-			${MODQT_CONFIGURE_ARGS}
+			${MODQT_CONFIGURE_ARGS} \
+			--with-mkisofs=${LOCALBASE}/bin/smkisofs \
+			--with-cdrecord=${LOCALBASE}/bin/cdrecord \
+			--with-cdda2wav=${LOCALBASE}/bin/cdda2wav
 MAKE_FLAGS=		CFLAGS="${CXXFLAGS} -c" CLFLAGS=""
 
 WRKDIST=		${WRKDIR}/cdr-bsd
+
+NO_REGRESS=		Yes
 
 post-install:
 		${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cdrchive
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-Makefile_in cdrchive/patches/patch-Makefile_in
--- /usr/ports/misc/cdrchive/patches/patch-Makefile_in	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-Makefile_in	Wed May 15 20:58:19 2002
@@ -0,0 +1,60 @@
+$OpenBSD$
+--- Makefile.in.orig	Mon Jul 23 06:32:20 2001
++++ Makefile.in	Tue May 14 01:47:34 2002
+@@ -65,11 +65,18 @@ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ 
++MKISOFS = @MKISOFS@
++CDRECORD = @CDRECORD@
++CDDA2WAV = @CDDA2WAV@
++
+ INCLUDES = -I. -I.. $(ALL_INCLUDES)
+ LIBS = -lqt -lX11 -lXext $(ALL_LIBRARIES)
+ 
+ DATA_DIR_DEF = -DDATADIR=\"$(datadir)\" 
+ CONF_DIR_DEF = -DSYSCONFDIR=\"$(sysconfdir)\"
++MKISOFS_DEF = -DMKISOFS=\"$(MKISOFS)\"
++CDRECORD_DEF = -DCDRECORD=\"$(CDRECORD)\"
++CDDA2WAV_DEF = -DCDDA2WAV=\"$(CDDA2WAV)\"
+ 
+ CFLAGS = -O2 -Wall -c
+ CLFLAGS = -O2 -Wall 
+@@ -130,16 +137,16 @@ $(OBJDIR)/mgrun.moc.o : $(MOCDIR)/mgrun.
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(MOCDIR)/mgrun.moc.cpp -o $(OBJDIR)/mgrun.moc.o
+ 
+ $(OBJDIR)/page0.o : $(srcdir)/page0.cpp
+-	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page0.cpp -o $(OBJDIR)/page0.o
++	$(CXX) $(INCLUDES) $(CDDA2WAV_DEF) $(CDRECORD_DEF) $(CFLAGS) $(srcdir)/page0.cpp -o $(OBJDIR)/page0.o
+ 
+ $(OBJDIR)/page1.o : $(srcdir)/page1.cpp
+-	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page1.cpp -o $(OBJDIR)/page1.o
++	$(CXX) $(INCLUDES) $(CDRECORD_DEF) $(CFLAGS) $(srcdir)/page1.cpp -o $(OBJDIR)/page1.o
+ 
+ $(OBJDIR)/page1a.o : $(srcdir)/page1a.cpp
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page1a.cpp -o $(OBJDIR)/page1a.o
+ 
+ $(OBJDIR)/page2.o : $(srcdir)/page2.cpp
+-	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page2.cpp -o $(OBJDIR)/page2.o
++	$(CXX) $(INCLUDES) $(MKISOFS_DEF) $(CFLAGS) $(srcdir)/page2.cpp -o $(OBJDIR)/page2.o
+ 
+ $(OBJDIR)/page2a.o : $(srcdir)/page2a.cpp
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page2a.cpp -o $(OBJDIR)/page2a.o
+@@ -151,7 +158,7 @@ $(OBJDIR)/page3a.o : $(srcdir)/page3a.cp
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page3a.cpp -o $(OBJDIR)/page3a.o
+ 
+ $(OBJDIR)/page4.o : $(srcdir)/page4.cpp
+-	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page4.cpp -o $(OBJDIR)/page4.o
++	$(CXX) $(INCLUDES) $(CDDA2WAV_DEF) $(CFLAGS) $(srcdir)/page4.cpp -o $(OBJDIR)/page4.o
+ 
+ $(OBJDIR)/page5.o : $(srcdir)/page5.cpp
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(srcdir)/page5.cpp -o $(OBJDIR)/page5.o
+@@ -163,7 +170,7 @@ $(OBJDIR)/tabconfg.o : $(srcdir)/tabconf
+ 	$(CXX) $(INCLUDES) $(CONF_DIR_DEF) $(CFLAGS) $(srcdir)/tabconfg.cpp -o $(OBJDIR)/tabconfg.o
+ 
+ $(OBJDIR)/tabdlg.o : $(srcdir)/tabdlg.cpp
+-	$(CXX) $(INCLUDES) $(DATA_DIR_DEF) $(CFLAGS) $(srcdir)/tabdlg.cpp -o $(OBJDIR)/tabdlg.o
++	$(CXX) $(INCLUDES) $(DATA_DIR_DEF) $(MKISOFS_DEF) $(CDRECORD_DEF) $(CFLAGS) $(srcdir)/tabdlg.cpp -o $(OBJDIR)/tabdlg.o
+ 
+ $(OBJDIR)/tabdlg.moc.o : $(MOCDIR)/tabdlg.moc.cpp
+ 	$(CXX) $(INCLUDES) $(CFLAGS) $(MOCDIR)/tabdlg.moc.cpp -o $(OBJDIR)/tabdlg.moc.o
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-aclocal_m4 cdrchive/patches/patch-aclocal_m4
--- /usr/ports/misc/cdrchive/patches/patch-aclocal_m4	Fri Mar 29 17:03:35 2002
+++ cdrchive/patches/patch-aclocal_m4	Wed May 15 20:58:19 2002
@@ -1,6 +1,6 @@
 $OpenBSD: patch-aclocal_m4,v 1.1 2002/03/30 01:03:35 naddy Exp $
---- aclocal.m4.orig	Fri Mar 29 00:40:21 2002
-+++ aclocal.m4	Fri Mar 29 00:42:17 2002
+--- aclocal.m4.orig	Tue Jul 17 00:37:16 2001
++++ aclocal.m4	Thu Apr 25 01:28:53 2002
 @@ -486,8 +486,8 @@ if test -z "$ac_x_libraries" || test "x$
    x_libraries=$ac_x_libraries
    X_LDFLAGS="-L$x_libraries"
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-configure_in cdrchive/patches/patch-configure_in
--- /usr/ports/misc/cdrchive/patches/patch-configure_in	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-configure_in	Wed May 15 20:58:19 2002
@@ -0,0 +1,85 @@
+$OpenBSD$
+--- configure.in.orig	Mon Jul 23 06:26:21 2001
++++ configure.in	Tue May 14 01:19:26 2002
+@@ -35,7 +35,7 @@ dnl this is for usage of QT 2.0.2
+ dnl  if you want to check for QT 2.1 beta 2
+ dnl  simply do a KDE_USE_QT(2)
+ dnl
+-KDE_USE_QT(2)
++KDE_USE_QT(3)
+ 
+ dnl Checks for programs.
+ AC_CHECK_COMPILERS
+@@ -61,6 +61,72 @@ AC_SUBST(AUTODIRS)
+ dnl in this space add everything you want to check for
+ dnl examples are specific headers, libraries, etc.
+ dnl everything to compile and run a KDE program is already checked
++
++AC_MSG_CHECKING([for mkisofs])
++ac_mkisofs=""
++mkisofs="mkisofs"
++have_mkisofs="using default '$mkisofs'"
++AC_ARG_WITH(mkisofs,
++  [  --with-mkisofs=PATH  path to mkisofs. ],
++  [
++   ac_mkisofs="$withval"
++  ])
++test -z $ac_mkisofs || have_mkisofs=yes
++
++if test "$have_mkisofs" != yes; then
++  AC_MSG_RESULT([$have_mkisofs]);
++else
++  AC_MSG_RESULT([$ac_mkisofs])
++  mkisofs="$ac_mkisofs"
++fi
++
++MKISOFS="$mkisofs"
++AC_SUBST(MKISOFS)
++
++
++AC_MSG_CHECKING([for cdrecord])
++ac_cdrecord=""
++cdrecord="cdrecord"
++have_cdrecord="using default '$cdrecord'"
++AC_ARG_WITH(cdrecord,
++  [  --with-cdrecord=PATH  path to cdrecord. ],
++  [
++   ac_cdrecord="$withval"
++  ])
++test -z $ac_cdrecord || have_cdrecord=yes
++
++if test "$have_cdrecord" != yes; then
++  AC_MSG_RESULT([$have_cdrecord]);
++else
++  AC_MSG_RESULT([$ac_cdrecord])
++  cdrecord="$ac_cdrecord"
++fi
++
++CDRECORD="$cdrecord"
++AC_SUBST(CDRECORD)
++
++
++AC_MSG_CHECKING([for cdda2wav])
++ac_cdda2wav=""
++cdda2wav="cdda2wav"
++have_cdda2wav="using default '$cdda2wav'"
++AC_ARG_WITH(cdda2wav,
++  [  --with-cdda2wav=PATH  path to cdda2wav. ],
++  [
++   ac_cdda2wav="$withval"
++  ])
++test -z $ac_cdda2wav || have_cdda2wav=yes
++
++if test "$have_cdda2wav" != yes; then
++  AC_MSG_RESULT([$have_cdda2wav]);
++else
++  AC_MSG_RESULT([$ac_cdda2wav])
++  cdda2wav="$ac_cdda2wav"
++fi
++
++CDDA2WAV="$cdda2wav"
++AC_SUBST(CDDA2WAV)
++ 
+ 
+ dnl Perform program name transformation
+ AC_ARG_PROGRAM
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-page0_cpp cdrchive/patches/patch-page0_cpp
--- /usr/ports/misc/cdrchive/patches/patch-page0_cpp	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-page0_cpp	Wed May 15 20:58:19 2002
@@ -0,0 +1,50 @@
+$OpenBSD$
+--- page0.cpp.orig	Sat Jul 14 20:37:51 2001
++++ page0.cpp	Tue May 14 01:54:31 2002
+@@ -374,8 +374,9 @@ QString cstr, cstr2, cstr3, str = "";
+ bool TabDialog::FillAudioGrab(QString& str, bool nobulk /* = false*/)
+ {
+ QString cstr, cstr2, cstr3;
++QString cdda2wav = CDDA2WAV;
+ 
+-	str = "cdda2wav -v 1 ";
++	str = cdda2wav + " -v 1 ";
+ 
+ 	if(rb_mono->isChecked())
+ 		str.append("-c 1 ");
+@@ -428,7 +429,7 @@ QString cstr, cstr2, cstr3;
+ 		}
+ 	else
+ 		{
+-		cstr = "-d " + le_duration->text() = " ";
++		cstr = "-d " + le_duration->text() + " ";
+ 		str.append(cstr);
+ 		}
+ 
+@@ -445,8 +446,9 @@ QString cstr, cstr2, cstr3;
+ bool TabDialog::FillAudioWrite(QString& str)
+ {
+ QString cstr2, cstr3;
++QString cdrecord = CDRECORD;
+ 
+-	str += "cdrecord -v ";
++	str += cdrecord + " -v ";
+ 
+ 	if(cb_dummy->isChecked())
+ 		str.append("-dummy ");
+@@ -483,13 +485,14 @@ QString cstr2, cstr3;
+ void TabDialog::OnClickedCancelOp()
+ {
+ QString cstr, cstr2;
++QString cdrecord = CDRECORD;
+ 	
+ 	// enable killing of process if it sticks
+ 	// eg ask for audio info when no disc in drive
+ 	if(m_Proc.isRunning())
+ 		m_Proc.kill(SIGKILL);
+ 
+-	cstr = "cdrecord ";
++	cstr = cdrecord + " ";
+ 	cstr2 = (comb_devicename->currentText());
+ // BSD - different output from cdrecord requires different parsing
+ 	if(cstr2.find(QString("choose")) != 0)
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-page1_cpp cdrchive/patches/patch-page1_cpp
--- /usr/ports/misc/cdrchive/patches/patch-page1_cpp	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-page1_cpp	Wed May 15 20:58:19 2002
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- page1.cpp.orig	Thu Jul 19 03:44:50 2001
++++ page1.cpp	Tue May 14 01:58:53 2002
+@@ -164,6 +164,7 @@ void TabDialog::setupPage1()
+ void TabDialog::OnClickedFetchInfo()
+ {
+ QString cstr, cstr2, cstr3;
++QString cdrecord = CDRECORD;
+ FILE* fp;
+ QFile f;
+ int a;
+@@ -174,7 +175,7 @@ int a;
+ 		QMessageBox::information( this, "","Recording Device not set" );
+ 		return;
+ 		}
+-	cstr2 = "cdrecord -msinfo dev=" + cstr;
++	cstr2 = cdrecord + " -msinfo dev=" + cstr;
+ 
+ 	fp = popen(cstr2, "r");
+ 	f.open(IO_ReadOnly, fp);
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-page2_cpp cdrchive/patches/patch-page2_cpp
--- /usr/ports/misc/cdrchive/patches/patch-page2_cpp	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-page2_cpp	Wed May 15 20:58:19 2002
@@ -0,0 +1,28 @@
+$OpenBSD$
+--- page2.cpp.orig	Thu Jul 19 02:12:47 2001
++++ page2.cpp	Thu Apr 25 02:39:32 2002
+@@ -86,9 +86,10 @@ int a, b;
+ FILE* fp;
+ QFile f;
+ QString cstr2, cstr3;
++QString mkisofs = MKISOFS;
+ 
+ // BSD uses mkhybrid
+-	cstr = "mkhybrid";
++	cstr = mkisofs;
+ 	CollectParams(cstr);
+    // get the exclusion parameters here next
+ 	// 090601 added exclusions - missed these out originally!
+@@ -117,9 +118,9 @@ QString cstr2, cstr3;
+    f.close();
+ 	pclose(fp);
+ 
+-	a = cstr3.find('=');
+-	cstr2 = cstr3.right( cstr3.length() - (a+2));
+-	a = atoi(cstr2);
++//	a = cstr3.find('=');
++//	cstr2 = cstr3.right( cstr3.length() - (a+2));
++	a = atoi(cstr3);
+ 	cstr2.sprintf("Approximately %d KB", a * 2);
+ 
+ 	le_size->setText(cstr2);
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-page4_cpp cdrchive/patches/patch-page4_cpp
--- /usr/ports/misc/cdrchive/patches/patch-page4_cpp	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-page4_cpp	Wed May 15 20:58:19 2002
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- page4.cpp.orig	Sat Jul 14 20:44:11 2001
++++ page4.cpp	Tue May 14 01:55:58 2002
+@@ -194,8 +194,9 @@ void TabDialog::OnClickedGetInfo()
+ {
+ QStrList list;
+ QString cstr2, cstr3;
++QString cdda2wav = CDDA2WAV;
+ 
+-	list.append("cdda2wav");
++	list.append(cdda2wav);
+ 	if(rb_amp->isChecked())
+ 		list.append("-F");
+ 	else if(rb_ismono->isChecked())
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-qtinc_h cdrchive/patches/patch-qtinc_h
--- /usr/ports/misc/cdrchive/patches/patch-qtinc_h	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-qtinc_h	Wed May 15 20:58:19 2002
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- qtinc.h.orig	Tue May  7 03:27:00 2002
++++ qtinc.h	Tue May  7 03:28:04 2002
+@@ -101,6 +101,8 @@
+ //#include <qtlayout.h>
+ //#include <qtvariant.h>
+ 
++#include <qregexp.h>
++
+ // my stuff
+ 
+ typedef QArray<char*> MGStrArray;
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/patches/patch-tabdlg_cpp cdrchive/patches/patch-tabdlg_cpp
--- /usr/ports/misc/cdrchive/patches/patch-tabdlg_cpp	Wed Dec 31 16:00:00 1969
+++ cdrchive/patches/patch-tabdlg_cpp	Wed May 15 20:58:19 2002
@@ -0,0 +1,91 @@
+$OpenBSD$
+--- tabdlg.cpp.orig	Thu Jul 19 03:20:59 2001
++++ tabdlg.cpp	Tue May 14 01:46:45 2002
+@@ -97,6 +97,7 @@ QString cstr3, scname, scdev;  
+ int stop;
+ QStringList cddevs;
+ QString dmesg = "/var/run/dmesg.boot";
++QString cdrecord = CDRECORD;
+ QFile g(dmesg);
+     if (g.open(IO_ReadOnly)) 
+       {
+@@ -122,35 +123,25 @@ QFile g(dmesg);
+ 	cstr = *it;
+ 	cstr.insert(0,"/dev/r");
+ 	cstr.insert(cstr.length(), "c");
+-	cstr.insert(0, "cdrecord dev=");
++	cstr3 = cstr;
++	cstr.insert(0, cdrecord + " dev=");
+ 	cstr.insert(cstr.length(), " -scanbus");
+ 	fp = popen(cstr, "r");
+ 	f.open(IO_ReadOnly, fp);
+ 	stop = 0;
+ 	while((f.readLine(cstr2, 512) != -1) && (stop != 1))
+ 	  {
+-	    cstr2 = cstr2.left(cstr2.length() -1 ); // get rid 0x0A
+-	    if(cstr2.find("devname:") != -1)
++            if((cstr2.find("scsibus") == -1) && (cstr2.find("libscg") == -1) && (cstr2.find("devname:") == -1) && (cstr2.find(QString("cdrecord"),0,false) == -1))
+ 	      {
+-		cstr2.replace(QRegExp("^.*: "), "");
+-		cstr2.replace(QRegExp("'"), "");
+-		cstr2.replace(QRegExp(" "), "");
+-		cstr3 = cstr2;
+-	      }
+-	    else
+-	      {
+-		if((cstr2.find("scsibus") == -1) && (cstr2.find("libscg") == -1) && ( cstr2.find("scsidev:") == -1) && (cstr2.find(QString("cdrecord"),0,false) == -1))
++		if(cstr2.find("*") != 12)
+ 		  {
+-		    if(cstr2.find("*") != 12)
+-		      {
+-			cstr2 = cstr2.simplifyWhiteSpace();
+-			scname = cstr2.mid(8, 55);
+-			scdev = cstr2.left(5);
+-			cstr3.insert(cstr3.length(), ":" + scdev + "  " + scname);
+-			comb_devicename->insertItem(cstr3);
+-			comb_audiodevicename->insertItem(cstr3);
+-			stop = 1;
+-		      }
++		    cstr2 = cstr2.simplifyWhiteSpace();
++		    scname = cstr2.mid(8, 55);
++		    scdev = cstr2.left(5);
++		    cstr3.insert(cstr3.length(), ":" + scdev + "  " + scname);
++		    comb_devicename->insertItem(cstr3);
++		    comb_audiodevicename->insertItem(cstr3);
++		    stop = 1;
+ 		  }
+ 	      }
+ 	  }
+@@ -160,7 +151,7 @@ QFile g(dmesg);
+ 
+ /*
+ old code - was much simpler!
+-	cstr = "cdrecord -scanbus";
++	cstr = cdrecord + " -scanbus";
+ 	fp = popen(cstr, "r");
+ 
+ 	f.open(IO_ReadOnly, fp);
+@@ -289,11 +280,13 @@ char* pS;
+ bool TabDialog::FillCommandLine(QStrList& list, bool write, bool fly /* = false */ )
+ {
+ QString cstr, cstr2, cstr3;
++QString mkisofs = MKISOFS;
++QString cdrecord = CDRECORD;
+ int a, b;
+ 
+   	if(write)
+ 		{
+-		list.append("cdrecord");
++		list.append(cdrecord);
+ 		list.append("-v");
+ 
+ //  BSD - rb_multi should never be checked as was disabled after creation in page1.cpp
+@@ -368,7 +361,7 @@ int a, b;
+ 		}
+ 	else
+ 		{
+-		list.append("mkhybrid");
++		list.append(mkisofs);
+ 		CollectParams(cstr);
+ 		CollectParams(list);
+ 		
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/pkg/INSTALL cdrchive/pkg/INSTALL
--- /usr/ports/misc/cdrchive/pkg/INSTALL	Thu Apr 25 20:35:34 2002
+++ cdrchive/pkg/INSTALL	Wed May 15 20:58:19 2002
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $OpenBSD: INSTALL,v 1.2 2002/04/26 03:35:34 pvalchev Exp $
+# $OpenBSD: INSTALL,v 1.1.1.1 2001/08/13 11:23:03 naddy Exp $
 #
 # Pre/post-installation setup of cdrchive
 
@@ -30,7 +30,7 @@
     echo "+---------------"
     echo "| The $1 configuration file, $CONFIG_FILE,"
     echo "| has been installed.  Please view this file and change"
-    echo "| the configuration to meet your needs."
+    echo "| the configuration to meet your needs"
     echo "+---------------"
     echo
 
diff -uNr --exclude=CVS /usr/ports/misc/cdrchive/pkg/INSTALL.orig cdrchive/pkg/INSTALL.orig
--- /usr/ports/misc/cdrchive/pkg/INSTALL.orig	Wed Dec 31 16:00:00 1969
+++ cdrchive/pkg/INSTALL.orig	Wed May 15 20:58:19 2002
@@ -0,0 +1,65 @@
+#!/bin/sh
+# $OpenBSD: INSTALL,v 1.2 2002/04/26 03:35:34 pvalchev Exp $
+#
+# Pre/post-installation setup of cdrchive
+
+# exit on errors, use a sane path and install prefix
+#
+set -e
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+PREFIX=${PKG_PREFIX:-/usr/local}
+CONFIG_FILE=${SYSCONFDIR}/cdr.conf
+SAMPLE_CONFIG_FILE=$PREFIX/share/examples/cdrchive/cdr.conf.sample
+
+do_notice()
+{
+    echo
+    echo "+---------------"
+    echo "| The existing $1 configuration file, $CONFIG_FILE,"
+    echo "| has NOT been changed.  You may want to compare it to the"
+    echo "| current sample file, $SAMPLE_CONFIG_FILE,"
+    echo "| and update your configuration as needed."
+    echo "+---------------"
+    echo
+}
+
+do_install()
+{
+    install -o root -g wheel -m 644 $SAMPLE_CONFIG_FILE $CONFIG_FILE
+    echo
+    echo "+---------------"
+    echo "| The $1 configuration file, $CONFIG_FILE,"
+    echo "| has been installed.  Please view this file and change"
+    echo "| the configuration to meet your needs."
+    echo "+---------------"
+    echo
+
+}
+
+# verify proper execution
+#
+if [ $# -ne 2 ]; then
+    echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
+    exit 1
+fi
+
+# Verify/process the command
+#
+case $2 in
+    PRE-INSTALL)
+	: nothing to pre-install for this port
+	;;
+    POST-INSTALL)
+	if [ -f $CONFIG_FILE ]; then
+	    do_notice $1
+	else
+	    do_install $1
+	fi
+	;;
+    *)
+	echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
+	exit 1
+	;;
+esac
+
+exit 0