Date: Wed, 1 Jun 2005 22:20:07 -0400 (EDT) From: Craig Rodrigues <rodrigc@crodrigues.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/81789: sysutils/xfsprogs port (NEW) Message-ID: <200506020220.j522K707059148@c-66-30-114-143.hsd1.ma.comcast.net> Resent-Message-ID: <200506020220.j522K1HS071584@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 81789 >Category: ports >Synopsis: sysutils/xfsprogs port (NEW) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu Jun 02 02:20:01 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Craig Rodrigues >Release: FreeBSD 6.0-CURRENT i386 >Organization: >Environment: System: FreeBSD dibbler.crodrigues.org 6.0-CURRENT FreeBSD 6.0-CURRENT #59: Tue May 17 07:48:42 EDT 2005 rodrigc@dibbler.crodrigues.org:/usr/obj/usr/src/sys/MYKERNEL1 i386 >Description: New port for xfsprogs. These are utilities for dealing with XFS filesystems. This is part of the XFS for FreeBSD project: http://people.freebsd.org/~rodrigc/xfs/ >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # xfsprogs # xfsprogs/files # xfsprogs/files/patch-configure # xfsprogs/files/patch-Makefile # xfsprogs/files/patch-buildmacros # xfsprogs/files/patch-builddefs.in # xfsprogs/files/patch-fstype.c # xfsprogs/files/patch-fstype.h # xfsprogs/files/patch-aclocal.m4 # xfsprogs/files/patch-fsck_Makefile # xfsprogs/Makefile # xfsprogs/pkg-plist # xfsprogs/pkg-descr # xfsprogs/distinfo # echo c - xfsprogs mkdir -p xfsprogs > /dev/null 2>&1 echo c - xfsprogs/files mkdir -p xfsprogs/files > /dev/null 2>&1 echo x - xfsprogs/files/patch-configure sed 's/^X//' >xfsprogs/files/patch-configure << 'END-of-xfsprogs/files/patch-configure' X--- configure.orig Sat Aug 16 00:16:35 2003 X+++ configure Sat Aug 16 00:31:29 2003 X@@ -3080,6 +3080,8 @@ X echo "${ECHO_T}$ac_cv_prog_egrep" >&6 X EGREP=$ac_cv_prog_egrep X X+OBJEXT=o X+ac_objext=o X X echo "$as_me:$LINENO: checking for ANSI C header files" >&5 X echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 END-of-xfsprogs/files/patch-configure echo x - xfsprogs/files/patch-Makefile sed 's/^X//' >xfsprogs/files/patch-Makefile << 'END-of-xfsprogs/files/patch-Makefile' X--- Makefile.orig Thu Dec 23 13:35:01 2004 X+++ Makefile Thu Dec 23 13:35:08 2004 X@@ -44,7 +44,7 @@ X Logs/* built .census install.* install-dev.* *.gz X X SUBDIRS = include libxfs libxlog libhandle libdisk \ X- copy db fsck growfs io imap logprint mkfile mkfs repair rtcp \ X+ db fsck growfs io imap logprint mkfile mkfs repair rtcp \ X m4 man doc po debian build X X default: $(CONFIGURE) END-of-xfsprogs/files/patch-Makefile echo x - xfsprogs/files/patch-buildmacros sed 's/^X//' >xfsprogs/files/patch-buildmacros << 'END-of-xfsprogs/files/patch-buildmacros' X--- include/buildmacros.orig Sat Aug 16 01:41:15 2003 X+++ include/buildmacros Sat Aug 16 01:41:48 2003 X@@ -54,8 +54,6 @@ X $(LFILES:.l=.o) \ X $(YFILES:%.y=%.tab.o) X X-INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP) X- X SHELL = /bin/sh X IMAGES_DIR = $(TOPDIR)/all-images X DIST_DIR = $(TOPDIR)/dist END-of-xfsprogs/files/patch-buildmacros echo x - xfsprogs/files/patch-builddefs.in sed 's/^X//' >xfsprogs/files/patch-builddefs.in << 'END-of-xfsprogs/files/patch-builddefs.in' X--- include/builddefs.in.orig Thu Dec 23 13:38:50 2004 X+++ include/builddefs.in Thu Dec 23 13:39:02 2004 X@@ -113,7 +113,7 @@ X PCFLAGS = -I/usr/local/include X endif X X-GCFLAGS = -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \ X+GCFLAGS = $(OPTIMIZER) $(DEBUG) -funsigned-char -fno-strict-aliasing -Wall \ X -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ X -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include X END-of-xfsprogs/files/patch-builddefs.in echo x - xfsprogs/files/patch-fstype.c sed 's/^X//' >xfsprogs/files/patch-fstype.c << 'END-of-xfsprogs/files/patch-fstype.c' X--- libdisk/fstype.c.orig Tue Aug 19 15:29:58 2003 X+++ libdisk/fstype.c Tue Aug 19 15:31:13 2003 X@@ -63,6 +63,28 @@ X return (a>>8) | (a<<8); X } X X+#define blksize 512 X+static int X+read_dev(int fd, void *buf, size_t len) X+{ X+ char block[blksize]; X+ size_t ret; X+ size_t readlen = len - len % blksize; X+ X+ ret = read(fd, buf, readlen); X+ if (ret != readlen) X+ return ret; X+ X+ if (readlen == len) X+ return ret; X+ X+ ret = read(fd, block, blksize); X+ if (ret != blksize) X+ return ret; X+ X+ memcpy((char*)buf + readlen, block, len - readlen); X+ return len; X+} X /* X Probes the device and attempts to determine the type of filesystem X contained within. X@@ -120,7 +142,7 @@ X (block sizes larger than 2K will be null padded) */ X for (bs = 1; bs < 16; bs++) { X lseek(fd, bs*2048+32768, SEEK_SET); X- if (read(fd, (char *)&isosb, sizeof(isosb)) != sizeof(isosb)) X+ if (read_dev(fd, (char *)&isosb, sizeof(isosb)) != sizeof(isosb)) X return 0; X if (isosb.id[0]) X break; X@@ -130,7 +152,7 @@ X for (j = 1; j < 64; j++) { X if (j > 1) { X lseek(fd, j*bs*2048+32768, SEEK_SET); X- if (read(fd, (char *)&isosb, sizeof(isosb)) X+ if (read_dev(fd, (char *)&isosb, sizeof(isosb)) X != sizeof(isosb)) X return 0; X } X@@ -212,7 +234,9 @@ X undesired side effects - first check that `device' refers X to a block device or ordinary file */ X if (stat (device, &statbuf) || X- !(S_ISBLK(statbuf.st_mode) || S_ISREG(statbuf.st_mode))) X+ !(S_ISBLK(statbuf.st_mode) || X+ S_ISREG(statbuf.st_mode) || X+ S_ISCHR(statbuf.st_mode))) X return 0; X X fd = open(device, O_RDONLY); X@@ -225,7 +249,7 @@ X if (!type) { X /* block 0 */ X if (lseek(fd, 0, SEEK_SET) != 0 X- || read(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb)) X+ || read_dev(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb)) X goto try_iso9660; X /* Gyorgy Kovesdi: none of my photocds has a readable block 0 */ X X@@ -262,7 +286,7 @@ X if (!type) { X /* sector 1 */ X if (lseek(fd, 512 , SEEK_SET) != 512 X- || read(fd, (char *) &svsb, sizeof(svsb)) != sizeof(svsb)) X+ || read_dev(fd, (char *) &svsb, sizeof(svsb)) != sizeof(svsb)) X goto io_error; X if (sysvmagic(svsb) == SYSV_SUPER_MAGIC ) X type = "sysv"; X@@ -271,7 +295,7 @@ X if (!type) { X /* block 1 */ X if (lseek(fd, 1024, SEEK_SET) != 1024 || X- read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb)) X+ read_dev(fd, (char *) &sb, sizeof(sb)) != sizeof(sb)) X goto io_error; X X /* ext2 has magic in little-endian on disk, so "swapped" is X@@ -311,7 +335,7 @@ X if (!type) { X /* block 3 */ X if (lseek(fd, 0xc00, SEEK_SET) != 0xc00 X- || read(fd, (char *) &adfssb, sizeof(adfssb)) != sizeof(adfssb)) X+ || read_dev(fd, (char *) &adfssb, sizeof(adfssb)) != sizeof(adfssb)) X goto io_error; X X /* only a weak test */ X@@ -326,7 +350,7 @@ X X /* block 8 */ X if (lseek(fd, 8192, SEEK_SET) != 8192 X- || read(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb)) X+ || read_dev(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb)) X goto io_error; X X mag = ufsmagic(ufssb); X@@ -338,7 +362,7 @@ X /* block 8 */ X if (lseek(fd, REISERFS_OLD_DISK_OFFSET_IN_BYTES, SEEK_SET) != X REISERFS_OLD_DISK_OFFSET_IN_BYTES X- || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) != X+ || read_dev(fd, (char *) &reiserfssb, sizeof(reiserfssb)) != X sizeof(reiserfssb)) X goto io_error; X if (is_reiserfs_magic_string(&reiserfssb)) X@@ -348,7 +372,7 @@ X if (!type) { X /* block 8 */ X if (lseek(fd, 0x2000, SEEK_SET) != 0x2000 X- || read(fd, (char *) &hpfssb, sizeof(hpfssb)) != sizeof(hpfssb)) X+ || read_dev(fd, (char *) &hpfssb, sizeof(hpfssb)) != sizeof(hpfssb)) X goto io_error; X X if (hpfsmagic(hpfssb) == HPFS_SUPER_MAGIC) X@@ -358,7 +382,7 @@ X if (!type) { X /* block 32 */ X if (lseek(fd, JFS_SUPER1_OFF, SEEK_SET) != JFS_SUPER1_OFF X- || read(fd, (char *) &jfssb, sizeof(jfssb)) != sizeof(jfssb)) X+ || read_dev(fd, (char *) &jfssb, sizeof(jfssb)) != sizeof(jfssb)) X goto io_error; X if (!strncmp(jfssb.s_magic, JFS_MAGIC, 4)) X type = "jfs"; X@@ -368,7 +392,7 @@ X /* block 32 */ X try_iso9660: X if (lseek(fd, 0x8000, SEEK_SET) != 0x8000 X- || read(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb)) X+ || read_dev(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb)) X goto io_error; X X if (strncmp(isosb.hs.id, HS_STANDARD_ID, sizeof(isosb.hs.id)) == 0) { X@@ -388,7 +412,7 @@ X /* block 64 */ X if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) != X REISERFS_DISK_OFFSET_IN_BYTES X- || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) != X+ || read_dev(fd, (char *) &reiserfssb, sizeof(reiserfssb)) != X sizeof(reiserfssb)) X goto io_error; X if (is_reiserfs_magic_string(&reiserfssb)) X@@ -396,6 +420,19 @@ X } X X if (!type) { X+ int mag; X+ X+ /* block 64 */ X+ if (lseek(fd, 65536, SEEK_SET) != 65536 X+ || read_dev(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb)) X+ goto io_error; X+ X+ mag = ufsmagic(ufssb); X+ if (mag == UFS2_SUPER_MAGIC_LE || mag == UFS2_SUPER_MAGIC_BE) X+ type = "ufs2"; X+ } X+ X+ if (!type) { X /* perhaps the user tries to mount the swap space X on a new disk; warn her before she does mke2fs on it */ X int pagesize = getpagesize(); X@@ -408,7 +445,7 @@ X if (rd > sizeof(buf)) X rd = sizeof(buf); X if (lseek(fd, 0, SEEK_SET) != 0 X- || read(fd, buf, rd) != rd) X+ || read_dev(fd, buf, rd) != rd) X goto io_error; X if (may_be_swap(buf+pagesize) || X may_be_swap(buf+4096) || may_be_swap(buf+8192)) END-of-xfsprogs/files/patch-fstype.c echo x - xfsprogs/files/patch-fstype.h sed 's/^X//' >xfsprogs/files/patch-fstype.h << 'END-of-xfsprogs/files/patch-fstype.h' X--- libdisk/fstype.h.orig Tue Aug 19 15:30:08 2003 X+++ libdisk/fstype.h Tue Aug 19 15:31:13 2003 X@@ -135,6 +135,8 @@ X /* From jj@sunsite.ms.mff.cuni.cz Mon Mar 23 15:19:05 1998 */ X #define UFS_SUPER_MAGIC_LE 0x00011954 X #define UFS_SUPER_MAGIC_BE 0x54190100 X+#define UFS2_SUPER_MAGIC_LE 0x19540119 X+#define UFS2_SUPER_MAGIC_BE 0x19015419 X struct ufs_super_block { X u_char s_dummy[0x55c]; X u_char s_magic[4]; END-of-xfsprogs/files/patch-fstype.h echo x - xfsprogs/files/patch-aclocal.m4 sed 's/^X//' >xfsprogs/files/patch-aclocal.m4 << 'END-of-xfsprogs/files/patch-aclocal.m4' X--- aclocal.m4.orig Tue Oct 12 20:26:01 2004 X+++ aclocal.m4 Thu Dec 23 14:52:43 2004 X@@ -107,7 +107,7 @@ X tar=$TAR X AC_SUBST(tar) X if test -z "$ZIP"; then X- AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin) X+ AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin:/usr/bin) X fi X X zip=$ZIP X@@ -148,14 +148,14 @@ X X if test "$enable_gettext" = yes; then X if test -z "$MSGFMT"; then X- AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin) X+ AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin:$PATH) X fi X msgfmt=$MSGFMT X AC_SUBST(msgfmt) X AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext) X X if test -z "$MSGMERGE"; then X- AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin) X+ AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin:$PATH) X fi X msgmerge=$MSGMERGE X AC_SUBST(msgmerge) END-of-xfsprogs/files/patch-aclocal.m4 echo x - xfsprogs/files/patch-fsck_Makefile sed 's/^X//' >xfsprogs/files/patch-fsck_Makefile << 'END-of-xfsprogs/files/patch-fsck_Makefile' X--- fsck/Makefile.orig Tue Aug 19 15:39:28 2003 X+++ fsck/Makefile Tue Aug 19 15:41:13 2003 X@@ -35,7 +35,7 @@ X X LTCOMMAND = fsck.xfs X CFILES = xfs_fsck.c X-LCFLAGS = -s -O3 X+LCFLAGS = -s X LLDFLAGS += -static X X default: $(LTCOMMAND) END-of-xfsprogs/files/patch-fsck_Makefile echo x - xfsprogs/Makefile sed 's/^X//' >xfsprogs/Makefile << 'END-of-xfsprogs/Makefile' X# New ports collection makefile for: xfsprogs X# Date created: Wed Jun 1 21:48:59 EDT 2005 X# Whom: Craig Rodrigues <rodrigc@FreeBSD.org> X# X# $FreeBSD$ X# X XPORTNAME= xfsprogs XPORTVERSION= 2.6.25 XCATEGORIES= sysutils XMASTER_SITES= ftp://oss.sgi.com/projects/xfs/cmd_tars/ XDISTNAME= ${PORTNAME}-${PORTVERSION} XEXTRACT_SUFX= .src.tar.gz X XMAINTAINER= rodrigc@FreeBSD.ORG XCOMMENT= A set of utilities and library to manipulate an xfs filesystem X XUSE_REINPLACE= yes XUSE_GMAKE= yes XUSE_GETTEXT= yes XUSE_AUTOTOOLS= yes XUSE_AUTOCONF_VER= 259 XGNU_CONFIGURE= yes XCONFIGURE_ENV+= INSTALL="${INSTALL} ${_BINOWNGRP}" \ X CFLAGS="${CFLAGS}" \ X LIBTOOL=${LIBTOOL} XMAKE_ENV+= INSTALL="${INSTALL} ${_BINOWNGRP}" XCONFIGURE_ARGS+= --disable-shared --enable-readline XALL_TARGET= X XMAN5= xfs.5 XMAN8= fsck.xfs.8 mkfs.xfs.8 xfs_admin.8 xfs_bmap.8 xfs_check.8 \ X xfs_copy.8 xfs_db.8 xfs_freeze.8 xfs_growfs.8 xfs_info.8 \ X xfs_io.8 xfs_logprint.8 xfs_mkfile.8 xfs_ncheck.8 \ X xfs_repair.8 xfs_rtcp.8 X Xpre-configure: X ${RM} -f ${WRKSRC}/configure X Xpost-configure: X ${FIND} ${WRKSRC} -name "configure" | ${XARGS} ${REINPLACE_CMD} -e \ X 's|-lpthread|${PTHREAD_LIBS}|g' X X.include <bsd.port.mk> END-of-xfsprogs/Makefile echo x - xfsprogs/pkg-plist sed 's/^X//' >xfsprogs/pkg-plist << 'END-of-xfsprogs/pkg-plist' Xbin/xfs_admin Xbin/xfs_db Xbin/xfs_check Xbin/xfs_ncheck Xbin/xfs_freeze Xbin/xfs_growfs Xbin/xfs_info Xbin/xfs_io Xbin/xfs_bmap Xbin/xfs_logprint Xbin/xfs_mkfile Xbin/xfs_rtcp Xsbin/fsck.xfs Xsbin/mkfs.xfs Xsbin/xfs_repair X%%PORTDOCS%%%%DOCSDIR%%/PORTING X%%PORTDOCS%%%%DOCSDIR%%/CHANGES.gz X%%PORTDOCS%%%%DOCSDIR%%/CREDITS X%%PORTDOCS%%%%DOCSDIR%%/README.LVM X%%PORTDOCS%%%%DOCSDIR%%/README.quota X%%PORTDOCS%%%%DOCSDIR%%/COPYING X%%PORTDOCS%%%%DOCSDIR%%/README X%%PORTDOCS%%@dirrm %%DOCSDIR%% END-of-xfsprogs/pkg-plist echo x - xfsprogs/pkg-descr sed 's/^X//' >xfsprogs/pkg-descr << 'END-of-xfsprogs/pkg-descr' XSet of utilities and library to manipulate an XFS filesystem. X XWWW: http://oss.sgi.com/projects/xfs/ END-of-xfsprogs/pkg-descr echo x - xfsprogs/distinfo sed 's/^X//' >xfsprogs/distinfo << 'END-of-xfsprogs/distinfo' XMD5 (xfsprogs-2.6.25.src.tar.gz) = 65fbf692f348b57f21edd4813733d9ae XSIZE (xfsprogs-2.6.25.src.tar.gz) = 850024 END-of-xfsprogs/distinfo exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506020220.j522K707059148>