ports/106658: New port: sysutils/linux-rename - Rename multiple files using substitution
Jonathan Liu
Net147 at hotmail.com
Wed Dec 13 08:00:37 UTC 2006
>Number: 106658
>Category: ports
>Synopsis: New port: sysutils/linux-rename - Rename multiple files using substitution
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 13 08:00:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Jonathan Liu
>Release: 6.2-RC1
>Organization:
>Environment:
FreeBSD freebsd 6.2-RC1 FreeBSD 6.2-RC1 #0: Thu Nov 16 05:12:08 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386
>Description:
Rename is a port of the Linux rename utility included with util-linux.
It allows renaming multiple files using substitution.
WWW: http://freshmeat.net/projects/util-linux/
>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:
#
# linux-rename
# linux-rename/files
# linux-rename/files/patch-rename.1
# linux-rename/files/patch-nls.h
# linux-rename/files/patch-rename.c
# linux-rename/distinfo
# linux-rename/Makefile
# linux-rename/pkg-descr
#
echo c - linux-rename
mkdir -p linux-rename > /dev/null 2>&1
echo c - linux-rename/files
mkdir -p linux-rename/files > /dev/null 2>&1
echo x - linux-rename/files/patch-rename.1
sed 's/^X//' >linux-rename/files/patch-rename.1 << 'END-of-linux-rename/files/patch-rename.1'
X--- rename.1.orig Mon Aug 23 01:14:45 2004
X+++ rename.1 Wed Dec 13 18:19:33 2006
X@@ -3,11 +3,11 @@
X .\"
X .TH RENAME 1 "1 January 2000" "" "Linux Programmer's Manual"
X .SH NAME
X-rename \- Rename files
X+linux-rename \- Rename files
X .SH SYNOPSIS
X-.BI rename " from to file..."
X+.BI linux-rename " from to file..."
X .SH DESCRIPTION
X-.B rename
X+.B linux-rename
X will rename the specified files by replacing the first occurrence of
X .I from
X in their name by
X@@ -19,8 +19,8 @@
X
X .RS
X .nf
X-rename foo foo0 foo?
X-rename foo foo0 foo??
X+linux-rename foo foo0 foo?
X+linux-rename foo foo0 foo??
X .fi
X .RE
X
X@@ -30,7 +30,7 @@
X And
X .RS
X .nf
X-rename .htm .html *.htm
X+linux-rename .htm .html *.htm
X .fi
X .RE
X
END-of-linux-rename/files/patch-rename.1
echo x - linux-rename/files/patch-nls.h
sed 's/^X//' >linux-rename/files/patch-nls.h << 'END-of-linux-rename/files/patch-nls.h'
X--- nls.h.orig Fri Jul 5 07:03:26 2002
X+++ nls.h Wed Dec 13 07:42:12 2006
X@@ -1,7 +1,5 @@
X int main(int argc, char *argv[]);
X
X-#include "../defines.h" /* for HAVE_locale_h */
X-
X #ifndef PACKAGE
X #define PACKAGE "util-linux"
X #endif
X@@ -10,25 +8,12 @@
X #define LOCALEDIR "/usr/share/locale"
X #endif
X
X-#ifdef HAVE_locale_h
X-# include <locale.h>
X-#endif
X+#include <locale.h>
X
X-#if defined MAY_ENABLE_NLS && !defined DISABLE_NLS
X-# include <libintl.h>
X-# define _(Text) gettext (Text)
X-# ifdef gettext_noop
X-# define N_(String) gettext_noop (String)
X-# else
X-# define N_(String) (String)
X-# endif
X+#include <libintl.h>
X+#define _(Text) gettext (Text)
X+#ifdef gettext_noop
X+# define N_(String) gettext_noop (String)
X #else
X-# undef bindtextdomain
X-# define bindtextdomain(Domain, Directory) /* empty */
X-# undef textdomain
X-# define textdomain(Domain) /* empty */
X-# define _(Text) (Text)
X-# define N_(Text) (Text)
X+# define N_(String) (String)
X #endif
X-
X-
END-of-linux-rename/files/patch-nls.h
echo x - linux-rename/files/patch-rename.c
sed 's/^X//' >linux-rename/files/patch-rename.c << 'END-of-linux-rename/files/patch-rename.c'
X--- rename.c.orig Wed May 10 07:39:03 2000
X+++ rename.c Wed Dec 13 07:52:51 2006
X@@ -19,6 +19,8 @@
X #include <errno.h>
X #include "nls.h"
X
X+#define util_linux_version "util-linux-2.12r"
X+
X static char *progname;
X
X static int
END-of-linux-rename/files/patch-rename.c
echo x - linux-rename/distinfo
sed 's/^X//' >linux-rename/distinfo << 'END-of-linux-rename/distinfo'
XMD5 (util-linux-2.12r.tar.bz2) = af9d9e03038481fbf79ea3ac33f116f9
XSHA256 (util-linux-2.12r.tar.bz2) = b8e499b338ce9fbd1fb315194b26540ec823c0afc46c9e145ac7a3e38ad57e6b
XSIZE (util-linux-2.12r.tar.bz2) = 1370907
END-of-linux-rename/distinfo
echo x - linux-rename/Makefile
sed 's/^X//' >linux-rename/Makefile << 'END-of-linux-rename/Makefile'
X# Ports collection makefile for: linux-rename
X# Date created: December 13 2006
X# Whom: Jonathan Liu <Net147 at hotmail.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME= linux-rename
XPORTVERSION= 2.12r
XCATEGORIES= sysutils
XMASTER_SITES= http://www.kernel.org/pub/linux/utils/util-linux/
XDISTNAME= util-linux-${PORTVERSION}
X
XMAINTAINER= ports at FreeBSD.org
XCOMMENT= Rename multiple files using substitution
X
XPLIST_FILES= bin/${PORTNAME}
XMAN1= ${PORTNAME}.1
X
XUSE_BZIP2= 1
XUSE_GCC= 3.4+
X
XCFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib -lintl
XEXTRACT_AFTER_ARGS= | tar -xf - \
X ${DISTNAME}/lib/nls.h \
X ${DISTNAME}/misc-utils/rename.1 \
X ${DISTNAME}/misc-utils/rename.c
X
X.include <bsd.port.pre.mk>
X
Xpost-extract:
X ${MV} ${WRKSRC}/lib/nls.h ${WRKSRC}
X ${MV} ${WRKSRC}/misc-utils/rename.1 ${WRKSRC}
X ${MV} ${WRKSRC}/misc-utils/rename.c ${WRKSRC}
X ${RMDIR} ${WRKSRC}/lib
X ${RMDIR} ${WRKSRC}/misc-utils
X
Xpre-build-script:
X ${MV} ${WRKSRC}/rename.1 ${WRKSRC}/linux-rename.1
X
Xdo-build:
X ${CC} ${CFLAGS} -o ${WRKSRC}/linux-rename ${WRKSRC}/rename.c
X
Xdo-install:
X ${INSTALL_PROGRAM} ${WRKSRC}/linux-rename ${PREFIX}/bin
X ${INSTALL_MAN} ${WRKSRC}/linux-rename.1 ${PREFIX}/man/man1/
X
X.include <bsd.port.post.mk>
END-of-linux-rename/Makefile
echo x - linux-rename/pkg-descr
sed 's/^X//' >linux-rename/pkg-descr << 'END-of-linux-rename/pkg-descr'
XRename is a port of the Linux rename utility included with util-linux.
XIt allows renaming multiple files using substitution.
X
XWWW: http://freshmeat.net/projects/util-linux/
END-of-linux-rename/pkg-descr
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list