Import of pkgsrc-2014Q1

This commit is contained in:
2014-04-17 16:38:45 +02:00
parent 785076ae39
commit 9a8c06dafb
19365 changed files with 828089 additions and 278039 deletions

View File

@@ -1,17 +1,22 @@
# $NetBSD: Makefile,v 1.5 2013/05/31 12:42:00 wiz Exp $
#
# $NetBSD: Makefile,v 1.8 2014/02/21 01:13:00 prlw1 Exp $
DISTNAME= scrub-2.0
DISTNAME= scrub-2.5.2
PKGREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=diskscrub/}
MASTER_SITES= http://diskscrub.googlecode.com/files/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= agc@NetBSD.org
HOMEPAGE= http://sourceforge.net/projects/diskscrub
HOMEPAGE= http://code.google.com/p/diskscrub/
COMMENT= Utility to overwrite disks and scrub the data on them
LICENSE= gnu-gpl-v2
GNU_CONFIGURE= yes
USE_TOOLS+= perl # this is purely for GNU configure
USE_LIBTOOL= yes
USE_TOOLS+= autoconf automake
USE_TOOLS+= perl # this is purely for GNU configure (X_AC_META macro)
pre-configure:
cd ${WRKSRC} && sh autogen.sh
.include "../../mk/bsd.pkg.mk"

View File

@@ -1,5 +1,10 @@
$NetBSD: distinfo,v 1.1.1.1 2008/07/21 22:25:03 agc Exp $
$NetBSD: distinfo,v 1.4 2014/02/21 01:13:00 prlw1 Exp $
SHA1 (scrub-2.0.tar.bz2) = 9a4edf70d4b3dc08a1c34c9579af573c872327fd
RMD160 (scrub-2.0.tar.bz2) = dd91066127bdf3cc059aa9832bd00d15af04ad80
Size (scrub-2.0.tar.bz2) = 145625 bytes
SHA1 (scrub-2.5.2.tar.bz2) = 863e5894e6acb3f922cb25f58e260f9c59b55c14
RMD160 (scrub-2.5.2.tar.bz2) = 852698810f401226608f6b1882191dc7bd2b47e4
Size (scrub-2.5.2.tar.bz2) = 161468 bytes
SHA1 (patch-configure.ac) = 929828e5c8ad340bfc4d6141aad45697d20fef20
SHA1 (patch-src_Makefile.am) = 4bdd6a41a6fcdc72120d5a1ebd8a17f9d90881d6
SHA1 (patch-src_genrand.c) = 1440cce8bce8b7c9eba4fde44284f6a9f6277a41
SHA1 (patch-src_getsize.c) = 221d201423b38a38486e4c91f4b9e28f6a1d0b52
SHA1 (patch-test_Makefile.am) = ada26d5b518eb630ac7e6ba0d6a61ae5e3280157

View File

@@ -0,0 +1,37 @@
$NetBSD: patch-configure.ac,v 1.1 2013/12/11 19:07:47 prlw1 Exp $
- Make unimplemented getsize() function match prototype in getsize.h.
- Use ioctl names (feature tests) rather than OS names.
XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY.
- Implement getsize() based on DIOCGDISKINFO ioctl.
--- configure.ac.orig 2013-12-11 17:23:58.000000000 +0000
+++ configure.ac
@@ -43,7 +43,14 @@ AC_HEADER_STDC
AC_CHECK_HEADERS( \
getopt.h \
stdbool.h \
+ stdint.h \
pthread.h \
+ linux/fs.h \
+ sys/devinfo.h \
+ sys/disk.h \
+ sys/dkio.h \
+ sys/ioctl.h \
+ sys/scsi.h \
)
AC_PROG_LIBTOOL
@@ -56,6 +63,12 @@ AC_C_BIGENDIAN
AC_C_CONST
##
+# Checks for libraries
+##
+AC_CHECK_LIB(prop, prop_dictionary_recv_ioctl, LIBPROP=-lprop)
+AC_SUBST(LIBPROP)
+
+##
# Checks for library functions
##
AC_CHECK_FUNCS( \

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_Makefile.am,v 1.1 2013/12/11 19:07:47 prlw1 Exp $
- Make unimplemented getsize() function match prototype in getsize.h.
- Use ioctl names (feature tests) rather than OS names.
XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY.
- Implement getsize() based on DIOCGDISKINFO ioctl.
--- src/Makefile.am.orig 2013-12-11 17:24:13.000000000 +0000
+++ src/Makefile.am
@@ -23,4 +23,4 @@ scrub_SOURCES = \
util.c \
util.h
-scrub_LDADD = $(LIBPTHREAD)
+scrub_LDADD = $(LIBPTHREAD) $(LIBPROP)

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_genrand.c,v 1.2 2014/02/21 01:13:00 prlw1 Exp $
Fix missing return value.
--- src/genrand.c.orig 2013-12-15 13:03:04.000000000 +0000
+++ src/genrand.c
@@ -106,7 +106,7 @@ genrandraw(unsigned char *buf, int bufle
buf[n] = result;
}
#endif
- return;
+ return 0;
}
}

View File

@@ -0,0 +1,159 @@
$NetBSD: patch-src_getsize.c,v 1.1 2013/12/11 19:07:47 prlw1 Exp $
- Make unimplemented getsize() function match prototype in getsize.h.
- Use ioctl names (feature tests) rather than OS names.
XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY.
- Implement getsize() based on DIOCGDISKINFO ioctl.
--- src/getsize.c.orig 2013-12-11 17:24:25.000000000 +0000
+++ src/getsize.c
@@ -36,16 +36,35 @@
#include <stdlib.h>
#include <libgen.h>
#include <string.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
+#if HAVE_SYS_DEVINFO_H
+#include <sys/devinfo.h>
+#endif
+#if HAVE_SYS_DISK_H
+#include <sys/disk.h>
+#endif
+#if HAVE_SYS_DKIO_H
+#include <sys/dkio.h>
+#endif
+#if HAVE_SYS_SCSI_H
+#include <sys/scsi.h>
+#endif
#include "getsize.h"
extern char *prog;
-#if defined(linux)
+#if defined (BLKGETSIZE) && defined(BLKGETSIZE64)
/* scrub-1.7 tested linux 2.6.11-1.1369_FC4 */
/* scrub-1.8 tested Fedora Core 5 */
-#include <sys/ioctl.h>
-#include <linux/fs.h>
#include <sys/utsname.h>
typedef unsigned long long u64; /* for BLKGETSIZE64 (slackware) */
@@ -86,11 +105,8 @@ error:
return -1;
}
-#elif defined(__FreeBSD__)
+#elif defined(DIOCGMEDIASIZE)
/* scrub-1.7 tested freebsd 5.3-RELEASE-p5 */
-#include <sys/ioctl.h>
-#include <sys/disk.h>
-
int
getsize(char *path, off_t *sizep)
{
@@ -111,10 +127,8 @@ error:
return -1;
}
-#elif defined(sun)
+#elif defined(DKIOCGMEDIAINFO)
/* scrub-1.7 tested solaris 5.9 */
-#include <sys/ioctl.h>
-#include <sys/dkio.h>
#include <sys/vtoc.h>
int
@@ -137,11 +151,8 @@ error:
return -1;
}
-#elif defined(__APPLE__)
+#elif defined(DKIOCGETBLOCKSIZE) && defined(DKIOCGETBLOCKCOUNT)
/* scrub-1.7 tested OS X 7.9.0 */
-#include <stdint.h>
-#include <sys/ioctl.h>
-#include <sys/disk.h>
int
getsize(char *path, off_t *sizep)
@@ -165,11 +176,10 @@ error:
(void)close(fd);
return -1;
}
-#elif defined(_AIX)
+
+#elif defined(IOCINFO)
/* scrub-1.7 tested AIX 5.1 and 5.3 */
/* scrub-1.8 tested AIX 5.2 */
-#include <sys/ioctl.h>
-#include <sys/devinfo.h>
int
getsize(char *path, off_t *sizep)
@@ -202,10 +212,10 @@ error:
(void)close(fd);
return -1;
}
-#elif defined (__hpux)
+
+#elif defined (SIOC_CAPACITY)
#include <stropts.h>
-#include <sys/scsi.h>
int
getsize(char *path, off_t *sizep)
@@ -227,11 +237,43 @@ error:
return -1;
}
+#elif defined(DIOCGDISKINFO)
+
+int
+getsize(char *path, off_t *sizep)
+{
+ int fd;
+ prop_dictionary_t disk_dict, geom_dict;
+ uint64_t secperunit;
+ uint32_t secsize;
+
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ return -1;
+
+ if (prop_dictionary_recv_ioctl(fd, DIOCGDISKINFO, &disk_dict) != 0)
+ return -1;
+ if (close(fd) == -1)
+ return -1;
+
+ geom_dict = prop_dictionary_get(disk_dict, "geometry");
+ if (geom_dict == NULL)
+ return -1;
+
+ if (!prop_dictionary_get_uint64(geom_dict, "sectors-per-unit", &secperunit))
+ return -1;
+ if (!prop_dictionary_get_uint32(geom_dict, "sector-size", &secsize))
+ return -1;
+ *sizep = secperunit * secsize;
+
+ return 0;
+}
+
#else
/* Unimplemented! Scrub will tell user to use -s.
*/
-off_t
-getsize(char *path)
+int
+getsize(char *path, off_t *sizep)
{
errno = ENOSYS;
return -1;

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-test_Makefile.am,v 1.1 2013/12/11 19:07:47 prlw1 Exp $
- Make unimplemented getsize() function match prototype in getsize.h.
- Use ioctl names (feature tests) rather than OS names.
XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY.
- Implement getsize() based on DIOCGDISKINFO ioctl.
--- test/Makefile.am.orig 2013-12-11 17:24:41.000000000 +0000
+++ test/Makefile.am
@@ -28,4 +28,6 @@ tgetsize_SOURCES = tgetsize.c $(common_s
tsig_SOURCES = tsig.c $(common_sources)
pat_SOURCES = pat.c $(common_sources)
+LDADD = $(LIBPROP)
+
EXTRA_DIST = $(TESTS) $(EXPS)