Subject: Re: CVS commit: pkgsrc/sysutils/koncd
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Nick Hudson <skrll@netbsd.org>
List: tech-pkg
Date: 06/12/2001 19:39:14
This is a multi-part message in MIME format.
--------------EBD3FDB257B175F590444C5B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Manuel Bouyer wrote:
> 
> On Tue, Jun 12, 2001 at 07:47:43PM +1000, matthew green wrote:
> >
> >       Its more than just i386 - you should probably be including
> >       sys/disklabel.h and testing the value of RAW_PART
> >
> > no, one should use getrawpartition() from libutils.  (the data comes
> > from a sysctl.)  this ensures that same-MACHINE_ARCH machines can
> > share binaries correctly.
> 
> This means that I have to change configure.in (the build process reruns
> autoconf/automake) to look for util.h and libutil, and eventually add a
> #define in the generated config.h
> I suspect this is easy to do, but I'm not familiar enouth with autoconf to
> do this.

> Can someone provide me the entries to add to configure.in and Makefile.am
> (Makefile.in is generated from a Makefile.am) to detect util.h and -lutil ?


How about the following patch?

Nick
--------------EBD3FDB257B175F590444C5B
Content-Type: text/plain; charset=us-ascii;
 name="koncd.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="koncd.diff"

? koncd.diff
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/koncd/distinfo,v
retrieving revision 1.3
diff -c -r1.3 distinfo
*** distinfo	2001/06/11 17:57:59	1.3
--- distinfo	2001/06/12 18:39:01
***************
*** 2,5 ****
  
  SHA1 (koncd-0.7.1.tar.gz) = db387b3cd83c3a50d96175ef2a5b5ed98eec05b2
  Size (koncd-0.7.1.tar.gz) = 1286825 bytes
! SHA1 (patch-aa) = ee91923a4e1a0dd5770f71541cd1a02b8a4883d3
--- 2,7 ----
  
  SHA1 (koncd-0.7.1.tar.gz) = db387b3cd83c3a50d96175ef2a5b5ed98eec05b2
  Size (koncd-0.7.1.tar.gz) = 1286825 bytes
! SHA1 (patch-aa) = 568efd20dc86b841665d411b28c0aa03902c7fd3
! SHA1 (patch-ab) = d63c278ee45f49f64fcb4edb9bc133ce54cde5ec
! SHA1 (patch-ac) = a216dfc85f7e274263544f76c0e98f323dad0153
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/koncd/patches/patch-aa,v
retrieving revision 1.2
diff -c -r1.2 patch-aa
*** patches/patch-aa	2001/06/11 17:58:00	1.2
--- patches/patch-aa	2001/06/12 18:39:01
***************
*** 1,13 ****
! $NetBSD: patch-aa,v 1.2 2001/06/11 17:58:00 bouyer Exp $
  
! --- koncd/cddata.cpp.orig	Sun Mar 11 12:35:36 2001
! +++ koncd/cddata.cpp	Mon Jun 11 19:50:12 2001
! @@ -17,14 +17,22 @@
   struct DEVICES *CurDev;
   
   CDdata::CDdata( QObject * , const char * ) {
  +	int i;
  +	char prog2[128];
   	Devices = NULL;
  -	strncpy( prog, "cdrecord", sizeof( prog ) - 1);	
  -	proc << prog << "-scanbus";
--- 1,24 ----
! $NetBSD$
  
! --- koncd/cddata.cpp.orig	Sun Mar 11 11:35:36 2001
! +++ koncd/cddata.cpp
! @@ -13,18 +13,35 @@
!  #include <unistd.h>
!  #include "cddata.h"
!  
! +#include "config.h"
! +
! +#ifdef HAVE_GETRAWPARTITION
! +#  include <util.h>
! +#endif
! +
!  static	int CurBus;
   struct DEVICES *CurDev;
   
   CDdata::CDdata( QObject * , const char * ) {
  +	int i;
  +	char prog2[128];
+ +	int raw;
   	Devices = NULL;
  -	strncpy( prog, "cdrecord", sizeof( prog ) - 1);	
  -	proc << prog << "-scanbus";
***************
*** 18,37 ****
  +	connect( &proc, SIGNAL(receivedStdout (KProcess *, char *, int) ),
    		this, SLOT(slotOutput (KProcess *, char *, int) ));		
  -	proc.start( KProcess::Block, KProcess::AllOutput );
! +	for (i = 0; i < 8; i++) {
! +  		proc.clearArguments();
! +#ifdef __i386__
! +		snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%dd",i);	
  +#else
! +		snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%dc",i);	
  +#endif
  +		proc << prog << prog2 << "identify";
  +		proc.start( KProcess::Block, KProcess::AllOutput );
  +	}
     sprintf( dummystr,"dev=unknown" );
   		
   	struct DEVICES *d;
! @@ -105,40 +113,39 @@
   		return;
   	}
   	bzero( buf, sizeof( buf ) );
--- 29,50 ----
  +	connect( &proc, SIGNAL(receivedStdout (KProcess *, char *, int) ),
    		this, SLOT(slotOutput (KProcess *, char *, int) ));		
  -	proc.start( KProcess::Block, KProcess::AllOutput );
! +
! +#ifdef HAVE_GETRAWPARTITION
! +	raw = getrawpartition();
  +#else
! +	raw = 'c' - 'a';
  +#endif
+ +	for (i = 0; i < 8; i++) {
+ +  		proc.clearArguments();
+ +		snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%d%c",i, 'a' + raw);	
  +		proc << prog << prog2 << "identify";
  +		proc.start( KProcess::Block, KProcess::AllOutput );
  +	}
     sprintf( dummystr,"dev=unknown" );
   		
   	struct DEVICES *d;
! @@ -105,40 +122,39 @@
   		return;
   	}
   	bzero( buf, sizeof( buf ) );
Index: patches/patch-ab
===================================================================
RCS file: patch-ab
diff -N patch-ab
*** /dev/null	Tue Jun 12 03:15:07 2001
--- patch-ab	Tue Jun 12 21:39:01 2001
***************
*** 0 ****
--- 1,15 ----
+ $NetBSD$
+ 
+ --- configure.in.in.orig	Sat Mar 31 14:57:18 2001
+ +++ configure.in.in
+ @@ -2,3 +2,10 @@
+  
+  AM_INIT_AUTOMAKE(koncd,0.7.1)
+  
+ +AC_CHECK_HEADER(util.h,
+ +  AC_CHECK_LIB(util, getrawpartition, [
+ +    AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition exists])
+ +    LIBUTIL="-lutil"]
+ +  )
+ +)
+ +AC_SUBST(LIBUTIL)
Index: patches/patch-ac
===================================================================
RCS file: patch-ac
diff -N patch-ac
*** /dev/null	Tue Jun 12 03:15:07 2001
--- patch-ac	Tue Jun 12 21:39:01 2001
***************
*** 0 ****
--- 1,13 ----
+ $NetBSD$
+ 
+ --- koncd/Makefile.am.orig	Tue Jun 12 19:29:02 2001
+ +++ koncd/Makefile.am
+ @@ -45,7 +45,7 @@
+  METASOURCES = AUTO
+  
+  # the library search path. 
+ -koncd_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+ +koncd_LDFLAGS = $(all_libraries) $(KDE_RPATH) @LIBUTIL@
+  
+  # Uncomment the following two lines if you add a ui.rc file for your application to make use of
+  # KDE´s XML GUI builing


--------------EBD3FDB257B175F590444C5B--