Bug 74933 - new port: misc/lesspipe (a preprocessor for less)
Summary: new port: misc/lesspipe (a preprocessor for less)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 23:20 UTC by Slaven Rezic
Modified: 2004-12-12 13:20 UTC (History)
0 users

See Also:


Attachments
file.shar (2.66 KB, text/plain)
2004-12-10 23:20 UTC, Slaven Rezic
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Slaven Rezic 2004-12-10 23:20:27 UTC

    
Comment 1 Sergey Matveychuk freebsd_committer 2004-12-11 01:03:16 UTC
lesspipe.sh is empty after install. I'm not sure it's ok.

-- 
Sem.
Comment 2 Slaven Rezic 2004-12-11 13:29:05 UTC
Sergey Matveychuk <sem@FreeBSD.org> writes:

> lesspipe.sh is empty after install. I'm not sure it's ok.

It works here on a FreeBSD 4.9 system. After make install:

$ ls -l /usr/local/bin/lesspipe.sh 
-rwxr-xr-x  1 root  wheel  12061 11 Dez 14:26 /usr/local/bin/lesspipe.sh*

Can you give me more diagnostics, i.e. capturing the configuration and
installation output and send it to me?

Regards,
        Slaven

-- 
Slaven Rezic - slaven <at> rezic <dot> de

    tknotes - A knotes clone, written in Perl/Tk.
    http://ptktools.sourceforge.net/#tknotes
Comment 3 Sergey Matveychuk freebsd_committer 2004-12-11 15:16:51 UTC
Slaven Rezic wrote:

> Can you give me more diagnostics, i.e. capturing the configuration and
> installation output and send it to me?

# make install
===>  Vulnerability check disabled
===>  Extracting for lesspipe-1.43
=> Checksum OK for lesspipe-1.43.tar.gz.
===>  Patching for lesspipe-1.43
===>  Configuring for lesspipe-1.43
checking file.../usr/bin/file
   found GNU file3.41 (ok)
ksh not found in the PATH
zsh not found in the PATH
skipping /bin/sh , need at least 2.03
Sorry, no useable shell found, cannot create lesspipe.sh
##!/bin/ksh
##!/bin/zsh -y
##!/bin/sh
You could edit lesspipe.sh.in to adjust the path to the shell(s)
===>  Building for lesspipe-1.43
===>  Installing for lesspipe-1.43
===>   Generating temporary packing list
===>  Checking if misc/lesspipe already installed
mkdir -p /usr/local/bin
cp ./code2color ./lesspipe.sh /usr/local/bin
chmod 0755 /usr/local/bin/lesspipe.sh
chmod 0755 /usr/local/bin/code2color
To use lesspipe.sh, type in the following commands

         LESSOPEN="|lesspipe.sh %s"; export LESSOPEN     (sh, bash, ksh, 
zsh)

         setenv LESSOPEN "|lesspipe.sh %s"               (csh, tcsh)

or put these commands in your shell's startup file (e.g. .cshrc or .bashrc).

===>   Registering installation for lesspipe-1.43

# cat /usr/local/bin/lesspipe.sh
#!/usr/local/bin/bash


-- 
Sem.
Comment 4 Slaven Rezic 2004-12-11 19:53:06 UTC
Sergey Matveychuk <sem@FreeBSD.org> writes:

> Slaven Rezic wrote:
> 
> > Can you give me more diagnostics, i.e. capturing the configuration and
> > installation output and send it to me?
> 
[...]

OK, here's the revised port (with a patch file to make some bug fixes
in the configure file and with "bash" as a dependency). BTW, is it
possible to specify alternatives in the *_DEPENDS variables? It would
be nice if I could say

        BUILD_DEPENDS=(bash:${PORTSDIR}/shells/bash|zsh:${PORTSDIR}/shells/zsh)

as lesspipe works with either bash or zsh.

The new port follows:

# 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:
#
#	lesspipe
#	lesspipe/distinfo
#	lesspipe/Makefile
#	lesspipe/pkg-descr
#	lesspipe/pkg-message
#	lesspipe/files
#	lesspipe/files/patch-configure
#
echo c - lesspipe
mkdir -p lesspipe > /dev/null 2>&1
echo x - lesspipe/distinfo
sed 's/^X//' >lesspipe/distinfo << 'END-of-lesspipe/distinfo'
XMD5 (lesspipe-1.43.tar.gz) = 76c5ce7b45afc3fa7584acb299e0d98f
XSIZE (lesspipe-1.43.tar.gz) = 51922
END-of-lesspipe/distinfo
echo x - lesspipe/Makefile
sed 's/^X//' >lesspipe/Makefile << 'END-of-lesspipe/Makefile'
X# New ports collection makefile for:   lesspipe
X# Date created:        11 December 2004
X# Whom:                Slaven Rezic <slaven@rezic.de>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	lesspipe
XPORTVERSION=	1.43
XCATEGORIES=	misc
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	lesspipe
X
XMAINTAINER=	slaven@rezic.de
XCOMMENT=	A preprocessor for less
X
XBUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash
X.if defined(WITH_FANCY)
X.if ${WITH_FANCY} == yes
XBUILD_DEPENDS+=	zip:${PORTSDIR}/archivers/zip \
X		rpm:${PORTSDIR}/archivers/rpm \
X		dpkg:${PORTSDIR}/archivers/dpkg \
X		antiword:${PORTSDIR}/textproc/antiword \
X		lynx:${PORTSDIR}/www/lynx \
X		pdftotext:${PORTSDIR}/graphics/xpdf \
X		unrtf:${PORTSDIR}/textproc/unrtf \
X		dvi2tty:${PORTSDIR}/print/dvi2tty \
X		pstotext:${PORTSDIR}/print/pstotext \
X		mp3info:${PORTSDIR}/audio/mp3info \
X		isoinfo:${PORTSDIR}/sysutils/cdrtools \
X		cabextract:${PORTSDIR}/archivers/cabextract
X.endif
X.endif
X
XUSE_PERL5=	yes
X
XHAS_CONFIGURE=	yes
XCONFIGURE_ARGS=	--default --prefix=${PREFIX}
X
XPLIST_FILES=	bin/lesspipe.sh \
X		bin/code2color
X
Xdo-build:
X
Xpost-install:
X	@${CAT} pkg-message
X
X.include <bsd.port.mk>
END-of-lesspipe/Makefile
echo x - lesspipe/pkg-descr
sed 's/^X//' >lesspipe/pkg-descr << 'END-of-lesspipe/pkg-descr'
Xlesspipe is a powerful preprocessor for less(1). The features include
X
X* Reading of various file formats like tar files, word, pdf and
X  postscript documents
X
X* Transparent handling of compressed files (gzip, bzip2, zip)
X
X* Optional syntax highlightning of source files
X
XWWW: http://sourceforge.net/projects/lesspipe
END-of-lesspipe/pkg-descr
echo x - lesspipe/pkg-message
sed 's/^X//' >lesspipe/pkg-message << 'END-of-lesspipe/pkg-message'
XTo use lesspipe.sh, type in the following commands
X
X	LESSOPEN="|lesspipe.sh %s"; export LESSOPEN     (sh, bash, ksh, zsh)
X
X        setenv LESSOPEN "|lesspipe.sh %s"               (csh, tcsh)
X
Xor put these commands in your shell's startup file (e.g. .cshrc or .bashrc).
X
END-of-lesspipe/pkg-message
echo c - lesspipe/files
mkdir -p lesspipe/files > /dev/null 2>&1
echo x - lesspipe/files/patch-configure
sed 's/^X//' >lesspipe/files/patch-configure << 'END-of-lesspipe/files/patch-configure'
X--- configure~	Thu Dec  9 09:30:52 2004
X+++ configure	Sat Dec 11 20:46:04 2004
X@@ -28,7 +28,7 @@
X The Makefile is of little use (copy lesspipe.sh and code2color to the
X install location)
X EOF
X-  exit;
X+  exit !$opt_help ? 1 : 0;
X }
X $opt_prefix ||= '/usr/local';
X open OUT, ">Makefile";
X@@ -188,7 +188,7 @@
X   my $rc = system "$have{file} -L ./configure >/dev/null 2>&1";
X   if ( $rc ) {
X     print "  found system version of file, looking for GNU file\n";
X-    exit unless inpath("Continue anyway", 'gfile');
X+    exit 1 unless inpath("Continue anyway", 'gfile');
X     $have{file} = $have{gfile} if $have{gfile};
X   }
X   $rc = system "$have{file} -L ./configure >/dev/null 2>&1";
X@@ -215,7 +215,7 @@
X         $have{file} = $rep{file};
X         check_file_vers();
X       }
X-      exit if $yesno =~ /^n/i;
X+      exit 1 if $yesno =~ /^n/i;
X     } else {
X       $have{file} .= ' -L -s';
X       print "  found GNU file$vers (ok)\n";
X@@ -277,10 +277,10 @@
X     print OUT "#!$file$opt\n";
X     $selected_shell = $name if ! $selected_shell;
X   }
X-  if ( $#bad == 2 ) {
X+  if ( !$selected_shell ) {
X     print "Sorry, no useable shell found, cannot create lesspipe.sh\n", @bad;
X     print "You could edit lesspipe.sh.in to adjust the path to the shell(s)\n";
X-    exit;
X+    exit 1;
X   } else {
X     print OUT @bad;
X   }
END-of-lesspipe/files/patch-configure
exit


-- 
Slaven Rezic - slaven <at> rezic <dot> de

Tk-AppMaster: a perl/Tk module launcher designed for handhelds
	http://tk-appmaster.sf.net
Comment 5 Sergey Matveychuk freebsd_committer 2004-12-12 13:00:46 UTC
Slaven Rezic wrote:

> X.if defined(WITH_FANCY)
> X.if ${WITH_FANCY} == yes

Please, don't do so. Historicaly the ports system checks if variable is 
defined. So .if defined(..) is enought. For a negate variable use 
WITHOUT_FOO form.

-- 
Sem.
Comment 6 Sergey Matveychuk freebsd_committer 2004-12-12 13:17:19 UTC
Slaven Rezic wrote:

> X	LESSOPEN="|lesspipe.sh %s"; export LESSOPEN     (sh, bash, ksh, zsh)
> X
> X        setenv LESSOPEN "|lesspipe.sh %s"               (csh, tcsh)

It does not work for me. Only if I set a full path to lesspipe.sh. Even 
when I got /usr/local/bin in my PATH.

I've fixed it and will commit. Please take a look and feel free for 
asking if something is not understandable.

-- 
Sem.
Comment 7 Sergey Matveychuk freebsd_committer 2004-12-12 13:20:01 UTC
State Changed
From-To: open->closed

Committed with modifications, thanks!