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

acct: FTBFS on GNU/kFreeBSD. Patch included.



Package: acct
Version: 6.5.4-2.1
Severity: important

Dear Acct maintainer, and Debian-BSD list.

The package Acct does not even manage to be configured due
to unmet dependencies in a test case built by "configure.ac".

I supply a patch together with this report that improves the
detection of GNU/kFreeBSD for the autotools and the source itself.
The resulting package has been quickly installed on kfreebsd-i386
and seems to be working correctly. The new source package has
also been built with success on i386 and amd64, and is working
on the latter architecture.

Hopefully the experts in "debian-bsd" will correct or decline
my patch suggestion based on their superior experience.

By the way, the packaging of Acct is in error at the moment.
It was recently migrated to use the format "3.0 (quilt)",
yet the build-dependency on Quilt is left in the control file,
and furthermore, the rules file itself makes active use of
Quilt in spite of Dpkg taking care of all necassary patch work.
This should be improved at the first opportunity.


Best regards,

Mats Erik Andersson
Description: FTBFS on GNU/kFreeBSD.
 Incomplete detection of __FreeBSD_kernel__ as well
 as unsatisfied dependency on <stdint.h> prevented
 even configuration to succeed for GNU/kFreeBSD.
 .
 Manipulations of the macros 'acct' and 'ac_flag'
 completes the road to a functional software.
 .
 The test "__FreeBSD_kernel_version__ >= 801000"
 can certainly be relaxed to a version closer to 7.0.

Author: Mats Erik Andersson <debian@gisladisker.se>
Forwarded: no
Last-Update: 2010-10-15

diff -Naurp acct-6.5.4.orig/accton.c acct-6.5.4/accton.c
--- acct-6.5.4.orig/accton.c
+++ acct-6.5.4/accton.c
@@ -37,6 +37,13 @@ extern int errno;
 
 #include "common.h"
 #include "files.h"
+#if defined __FreeBSD__ || defined __FreeBSD_kernel__
+/* The present day structure is 'struct acctv2' and a
+ * macro for 'acct' attained the transition in "files.h".
+ * In this file "accton.c" only the call acct(2) is relevant.
+ */
+# undef acct
+#endif /* __FreeBSD__ || __FreeBSD_kernel__ */
 #ifdef HAVE_GETOPT_LONG_ONLY
 #include <getopt.h>
 #else
diff -Naurp acct-6.5.4.orig/configure.ac acct-6.5.4/configure.ac
--- acct-6.5.4.orig/configure.ac
+++ acct-6.5.4/configure.ac
@@ -165,12 +165,13 @@ dnl
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>	/* uint8_t */
 #include <sys/types.h>
 #include <sys/acct.h>
 #include <utmp.h>
 
 #ifndef WTMP_FILE
-#  if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__)
+#  if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__) || defined(__GLIBC__)
 #    define WTMP_FILE "/var/log/wtmp"
 #  else
 #    if defined(sun) || defined(AMIX)
@@ -186,7 +187,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #endif
 
 #ifndef ACCT_FILE
-#  if defined(__FreeBSD__) || defined(__linux__)
+#  if defined(__FreeBSD__) || defined(__linux__) || defined(__GLIBC__)
 #    define ACCT_FILE "/var/log/account/pacct"
 #  else
 #    if defined(__NetBSD__)
@@ -206,7 +207,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #endif
 
 #ifndef SAVACCT_FILE
-#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
+#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) || defined(__GLIBC__)
 #    define SAVACCT_FILE "/var/log/account/savacct"
 #  else
 #    if defined(sun) || defined(AMIX)
@@ -222,7 +223,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #endif
 
 #ifndef USRACCT_FILE
-#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
+#  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) || defined(__GLIBC__)
 #    define USRACCT_FILE "/var/log/account/usracct"
 #  else
 #    if defined(sun) || defined(AMIX)
diff -Naurp acct-6.5.4.orig/files.h.in acct-6.5.4/files.h.in
--- acct-6.5.4.orig/files.h.in
+++ acct-6.5.4/files.h.in
@@ -14,10 +14,15 @@
 #ifdef LINUX_MULTIFORMAT
 # include "linux-acct.h"
 #else
+# include <stdint.h>	/* uint8_h */
 # include <sys/acct.h>
-	#ifdef __FreeBSD__
-	# if __FreeBSD_version >= 700100 /* FreeBSD 7.0-STABLE */
+	#ifdef __FreeBSD_kernel__
+	# include <osreldate.h>
+	#endif
+	#if defined __FreeBSD__ || defined __FreeBSD_kernel__
+	# if __FreeBSD_version >= 700100 || __FreeBSD_kernel_version >= 801000
 	# define acct acctv2
+	# define ac_flag ac_flagx
 	# endif
 	#endif
 #endif

Attachment: signature.asc
Description: Digital signature


Reply to: