diff options
author | nonaka <nonaka@pkgsrc.org> | 2016-08-27 11:53:39 +0000 |
---|---|---|
committer | nonaka <nonaka@pkgsrc.org> | 2016-08-27 11:53:39 +0000 |
commit | 7f6212fb30db9b89863b2ae12953e2ed17fbdbae (patch) | |
tree | ce5498dc67e43c96e92f1cb244943bf68a4c6e48 /devel/dumpet | |
parent | 4060532a2ed19db7b8cff99bbb64c0dca53abbcf (diff) | |
download | pkgsrc-7f6212fb30db9b89863b2ae12953e2ed17fbdbae.tar.gz |
PR/51445: Import dumpet 2.1 as devel/dumpet.
dumpet is a tool to dump information about bootable CDs and other similar.
Diffstat (limited to 'devel/dumpet')
-rw-r--r-- | devel/dumpet/DESCR | 2 | ||||
-rw-r--r-- | devel/dumpet/Makefile | 19 | ||||
-rw-r--r-- | devel/dumpet/PLIST | 3 | ||||
-rw-r--r-- | devel/dumpet/distinfo | 10 | ||||
-rw-r--r-- | devel/dumpet/patches/patch-Makefile | 26 | ||||
-rw-r--r-- | devel/dumpet/patches/patch-dumpet.c | 33 | ||||
-rw-r--r-- | devel/dumpet/patches/patch-dumpet.h | 24 | ||||
-rw-r--r-- | devel/dumpet/patches/patch-endian.h | 76 |
8 files changed, 193 insertions, 0 deletions
diff --git a/devel/dumpet/DESCR b/devel/dumpet/DESCR new file mode 100644 index 00000000000..5fdccf085d4 --- /dev/null +++ b/devel/dumpet/DESCR @@ -0,0 +1,2 @@ +dumpet is a tool to dump information about bootable CDs and other similar +formats. diff --git a/devel/dumpet/Makefile b/devel/dumpet/Makefile new file mode 100644 index 00000000000..6fcd79ae1a5 --- /dev/null +++ b/devel/dumpet/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +DISTNAME= dumpet-2.1 +CATEGORIES= devel +MASTER_SITES= https://fedorahosted.org/releases/d/u/dumpet/ +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= nonakap@gmail.com +HOMEPAGE= https://fedorahosted.org/dumpet/ +COMMENT= Dump information about bootable CDs and other similar formats +LICENSE= gnu-gpl-v2 + +USE_TOOLS+= gmake pkg-config + +INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 + +.include "../../devel/popt/buildlink3.mk" +.include "../../textproc/libxml2/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/devel/dumpet/PLIST b/devel/dumpet/PLIST new file mode 100644 index 00000000000..e5cc1d39563 --- /dev/null +++ b/devel/dumpet/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1 2016/08/27 11:53:39 nonaka Exp $ +bin/dumpet +man/man1/dumpet.1 diff --git a/devel/dumpet/distinfo b/devel/dumpet/distinfo new file mode 100644 index 00000000000..ca619f676d4 --- /dev/null +++ b/devel/dumpet/distinfo @@ -0,0 +1,10 @@ +$NetBSD: distinfo,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +SHA1 (dumpet-2.1.tar.bz2) = 56fc8a52a8df12083912496d6d7de993f2063ec1 +RMD160 (dumpet-2.1.tar.bz2) = cf1a0923c658ef285176fca59c97a3e04636b4ef +SHA512 (dumpet-2.1.tar.bz2) = ca12d0852594acabda6a97b91e072872a6d83cd29b9c549a2f03120a8e92b19d1254ac229e27b562c5b0439b92daeec54e95df0282af4cd346e66b876d4a33b3 +Size (dumpet-2.1.tar.bz2) = 14681 bytes +SHA1 (patch-Makefile) = 23c20aa9c1c9a278344270a8930506387b8de908 +SHA1 (patch-dumpet.c) = c46e6a20888d02f4877f836e155879b0c74b946b +SHA1 (patch-dumpet.h) = b0fee038370552bbaab8c1c12f2db13ddd57edfd +SHA1 (patch-endian.h) = a229f3410287fe277fea52baea69e73f5089bbec diff --git a/devel/dumpet/patches/patch-Makefile b/devel/dumpet/patches/patch-Makefile new file mode 100644 index 00000000000..71014a87dfe --- /dev/null +++ b/devel/dumpet/patches/patch-Makefile @@ -0,0 +1,26 @@ +$NetBSD: patch-Makefile,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +--- Makefile.orig 2010-08-25 16:54:11.000000000 +0000 ++++ Makefile 2016-08-27 11:42:25.542635771 +0000 +@@ -2,9 +2,7 @@ + VERSION=2.1 + GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8) + +-CFLAGS:=-g3 -O2 -Wall -Werror +-LFLAGS:= +-CC:=gcc ++CFLAGS += -Wall + + CFLAGS += $(shell pkg-config --cflags libxml-2.0) + LFLAGS += -lpopt $(shell pkg-config --libs libxml-2.0) +@@ -21,8 +19,8 @@ clean : + @rm -vf *.o dumpet + + install : all +- install -D -m 0755 dumpet ${DESTDIR}/usr/bin/dumpet +- install -D -m 0644 dumpet.1 ${DESTDIR}/usr/share/man/man1/dumpet.1 ++ ${BSD_INSTALL_PROGRAM} dumpet ${DESTDIR}${PREFIX}/bin/dumpet ++ ${BSD_INSTALL_MAN} dumpet.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/dumpet.1 + + test-archive: clean all dumpet-$(VERSION)-$(GITVERSION).tar.bz2 + diff --git a/devel/dumpet/patches/patch-dumpet.c b/devel/dumpet/patches/patch-dumpet.c new file mode 100644 index 00000000000..13f9d21d85b --- /dev/null +++ b/devel/dumpet/patches/patch-dumpet.c @@ -0,0 +1,33 @@ +$NetBSD: patch-dumpet.c,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +--- dumpet.c.orig 2010-08-25 16:54:11.000000000 +0000 ++++ dumpet.c 2016-08-26 00:17:46.000000000 +0000 +@@ -285,7 +285,8 @@ static int dumpBootImage(struct context + image = fopen(filename, "w+"); + if (!image) { + int errnum; +- fprintf(stderr, "Could not open \"%s\": %m\n", filename); ++ fprintf(stderr, "Could not open \"%s\": %s\n", ++ filename, strerror(errno)); + errnum = errno; + free(filename); + return -errnum; +@@ -781,14 +782,16 @@ int main(int argc, char *argv[]) + + context.iso = fopen(context.filename, "r"); + if (!context.iso) { +- fprintf(stderr, "Could not open \"%s\": %m\n", context.filename); ++ fprintf(stderr, "Could not open \"%s\": %s\n", ++ context.filename, strerror(errno)); + exit(2); + } + + if (context.dumpXml) { + xml = xmlBufferCreate(); + if (!xml) { +- fprintf(stderr, "Error creating XML buffer: %m\n"); ++ fprintf(stderr, "Error creating XML buffer: %s\n", ++ strerror(errno)); + exit(3); + } + context.writer = xmlNewTextWriterMemory(xml, 0); diff --git a/devel/dumpet/patches/patch-dumpet.h b/devel/dumpet/patches/patch-dumpet.h new file mode 100644 index 00000000000..0c0748e33b3 --- /dev/null +++ b/devel/dumpet/patches/patch-dumpet.h @@ -0,0 +1,24 @@ +$NetBSD: patch-dumpet.h,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +--- dumpet.h.orig 2010-08-25 16:54:11.000000000 +0000 ++++ dumpet.h 2016-08-26 00:18:41.000000000 +0000 +@@ -39,7 +39,8 @@ static inline int read_sector(FILE *iso, + + if (n != 1) { + int errnum = errno; +- fprintf(stderr, "dumpet: Error reading image: %m\n"); ++ fprintf(stderr, "dumpet: Error reading image: %s\n", ++ strerror(errno)); + errno = errnum; + return -errno; + } +@@ -54,7 +55,8 @@ static inline int write_sector(FILE *iso + + if (n != 1) { + int errnum = errno; +- fprintf(stderr, "dumpet: Error writing image: %m\n"); ++ fprintf(stderr, "dumpet: Error writing image: %s\n", ++ strerror(errno)); + errno = errnum; + return -errno; + } diff --git a/devel/dumpet/patches/patch-endian.h b/devel/dumpet/patches/patch-endian.h new file mode 100644 index 00000000000..0c59365077c --- /dev/null +++ b/devel/dumpet/patches/patch-endian.h @@ -0,0 +1,76 @@ +$NetBSD: patch-endian.h,v 1.1 2016/08/27 11:53:39 nonaka Exp $ + +--- endian.h.orig 2010-08-25 16:54:11.000000000 +0000 ++++ endian.h 2016-08-25 06:19:59.000000000 +0000 +@@ -19,6 +19,7 @@ + #ifndef ENDIAN_H + #define ENDIAN_H + ++#if defined(__linux__) + #include <endian.h> + + #if __BYTE_ORDER == __LITTLE_ENDIAN +@@ -48,6 +49,63 @@ + #define le32_to_cpu(x) __bswap_32(x) + #define le64_to_cpu(x) __bswap_64(x) + #endif ++#elif defined(__APPLE__) ++#include <libkern/OSByteOrder.h> ++#define cpu_to_be16(x) OSSwapHostToBigInt16(x) ++#define cpu_to_be32(x) OSSwapHostToBigInt32(x) ++#define cpu_to_be64(x) OSSwapHostToBigInt64(x) ++#define be16_to_cpu(x) OSSwapBigToHostInt16(x) ++#define be32_to_cpu(x) OSSwapBigToHostInt32(x) ++#define be64_to_cpu(x) OSSwapBigToHostInt64(x) ++#define cpu_to_le16(x) OSSwapHostToLittleInt16(x) ++#define cpu_to_le32(x) OSSwapHostToLittleInt32(x) ++#define cpu_to_le64(x) OSSwapHostToLittleInt64(x) ++#define le16_to_cpu(x) OSSwapLittleToHostInt16(x) ++#define le32_to_cpu(x) OSSwapLittleToHostInt32(x) ++#define le64_to_cpu(x) OSSwapLittleToHostInt64(x) ++#elif defined(__sun__) ++#include <sys/byteorder.h> ++#define cpu_to_be16(x) BE_16(x) ++#define cpu_to_be32(x) BE_32(x) ++#define cpu_to_be64(x) BE_64(x) ++#define be16_to_cpu(x) BE_IN16(x) ++#define be32_to_cpu(x) BE_IN32(x) ++#define be64_to_cpu(x) BE_IN64(x) ++#define cpu_to_le16(x) LE_16(x) ++#define cpu_to_le32(x) LE_32(x) ++#define cpu_to_le64(x) LE_64(x) ++#define le16_to_cpu(x) LE_IN16(x) ++#define le32_to_cpu(x) LE_IN32(x) ++#define le64_to_cpu(x) LE_IN64(x) ++#elif defined(__OpenBSD__) ++#include <sys/endian.h> ++#define cpu_to_be16(x) htobe16(x) ++#define cpu_to_be32(x) htobe32(x) ++#define cpu_to_be64(x) htobe64(x) ++#define be16_to_cpu(x) betoh16(x) ++#define be32_to_cpu(x) betoh32(x) ++#define be64_to_cpu(x) betoh64(x) ++#define cpu_to_le16(x) htole16(x) ++#define cpu_to_le32(x) htole32(x) ++#define cpu_to_le64(x) htole64(x) ++#define le16_to_cpu(x) letoh16(x) ++#define le32_to_cpu(x) letoh32(x) ++#define le64_to_cpu(x) letoh64(x) ++#else /* *BSD */ ++#include <sys/endian.h> ++#define cpu_to_be16(x) htobe16(x) ++#define cpu_to_be32(x) htobe32(x) ++#define cpu_to_be64(x) htobe64(x) ++#define be16_to_cpu(x) be16toh(x) ++#define be32_to_cpu(x) be32toh(x) ++#define be64_to_cpu(x) be64toh(x) ++#define cpu_to_le16(x) htole16(x) ++#define cpu_to_le32(x) htole32(x) ++#define cpu_to_le64(x) htole64(x) ++#define le16_to_cpu(x) le16toh(x) ++#define le32_to_cpu(x) le32toh(x) ++#define le64_to_cpu(x) le64toh(x) ++#endif + + #endif /* ENDIAN_H */ + /* vim:set shiftwidth=8 softtabstop=8: */ |