Bug 151467 - New port: sysutils/autojump acts as a complement to cd
Summary: New port: sysutils/autojump acts as a complement to cd
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: Stephen Montgomery-Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 04:30 UTC by Neeraj Verma
Modified: 2012-04-30 04:40 UTC (History)
0 users

See Also:


Attachments
file.shar (6.45 KB, text/plain)
2010-10-15 04:30 UTC, Neeraj Verma
no flags Details
shar-4.sh (9.15 KB, application/x-shellscript)
2011-07-04 13:45 UTC, neeraj.verma
no flags Details
autojump.shar (9.02 KB, application/x-shar)
2011-07-04 17:33 UTC, Stephen Montgomery-Smith
no flags Details
autojump.shar (20.85 KB, application/x-shar)
2011-12-24 03:55 UTC, neeraj.verma
no flags Details
autojump.shar (10.68 KB, application/x-shar)
2011-12-25 21:06 UTC, Stephen Montgomery-Smith
no flags Details
autojump.shar (10.83 KB, application/x-shar)
2012-03-24 04:08 UTC, neeraj.verma
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neeraj Verma 2010-10-15 04:30:10 UTC
Autojump is a tool that acts as a complement to cd: it makes navigating your file system a lot faster. It works by maintaining a database of the directories you use the most from the command line, and allows you to jump back and forth between them, by typing just a few letters of the name of the directory you want to jump to.

Fix: Patch attached with submission follows:
Comment 1 Jilles Tjoelker freebsd_committer freebsd_triage 2010-10-16 13:50:53 UTC
> [new port for autojump]

Upstream seems to offer a zsh version as well, why did you omit it?

-- 
Jilles Tjoelker
Comment 2 neeraj.verma 2010-10-17 23:57:24 UTC
Added zsh support...

Use this instead:

# 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:
#
#       autojump
#       autojump/files
#       autojump/files/patch-autojump
#       autojump/files/patch-install.sh
#       autojump/pkg-descr
#       autojump/distinfo
#       autojump/Makefile
#
echo c - autojump
mkdir -p autojump > /dev/null 2>&1
echo c - autojump/files
mkdir -p autojump/files > /dev/null 2>&1
echo x - autojump/files/patch-autojump
sed 's/^X//' >autojump/files/patch-autojump <<
'6917d57faf6ecf383ae7da8503e66008'
X--- ./autojump.orig    2010-10-13 22:47:47.000000000 -0400
X+++ ./autojump 2010-10-13 22:41:08.000000000 -0400
X@@ -1,4 +1,4 @@
X-#!/usr/bin/python
X+#!/usr/local/bin/python
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
6917d57faf6ecf383ae7da8503e66008
echo x - autojump/files/patch-install.sh
sed 's/^X//' >autojump/files/patch-install.sh <<
'dffdbfd25a1b39a4ce4177d40a358e55'
X--- ./install.sh.orig  2010-10-13 22:39:46.000000000 -0400
X+++ ./install.sh       2010-10-13 22:43:22.000000000 -0400
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/usr/local/bin/bash
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
X@@ -16,11 +16,11 @@
X #along with autojump.  If not, see <http://www.gnu.org/licenses/>.
X 
X function show_help {
X-        echo "sudo ./install.sh [--prefix /usr/local]"
X+        echo "./install.sh [--prefix /usr/local]"
X }
X 
X # Default install directory.
X-prefix=/usr
X+prefix=/usr/local
X 
X # Command line parsing
X while true; do
X@@ -41,32 +41,32 @@
X echo "Installing to ${prefix} ..."
X 
X # INSTALL AUTOJUMP
X-sudo mkdir -p ${prefix}/share/autojump/
X-sudo mkdir -p ${prefix}/bin/
X-sudo mkdir -p ${prefix}/share/man/man1/
X-sudo cp icon.png ${prefix}/share/autojump/
X-sudo cp jumpapplet ${prefix}/bin/
X-sudo cp autojump ${prefix}/bin/
X-sudo cp autojump.1 ${prefix}/share/man/man1/
X+mkdir -p ${prefix}/share/autojump/
X+mkdir -p ${prefix}/bin/
X+mkdir -p ${prefix}/share/man/man1/
X+cp icon.png ${prefix}/share/autojump/
X+cp jumpapplet ${prefix}/bin/
X+cp autojump ${prefix}/bin/
X+cp autojump.1 ${prefix}/share/man/man1/
X 
X-if [ -d "/etc/profile.d" ]; then
X-    sudo cp autojump.bash /etc/profile.d/
X-    sudo cp autojump.sh /etc/profile.d/
X+if [ -d "${prefix}/etc/profile.d" ]; then
X+    cp autojump.bash ${prefix}/etc/profile.d/
X+    cp autojump.sh ${prefix}/etc/profile.d/
X 
X     # Make sure that the code we just copied has been sourced.
X-    # check if .bashrc has sourced /etc/profile
or /etc/profile.d/autojump.bash
X+    # check if .bashrc has sourced /etc/profile or
${prefix}/etc/profile.d/autojump.bash
X     if [ `grep -c "^[[:space:]]*source\|\. /etc/profile(\.d/autojump
\.bash)[[:space:]]*$" ~/.bashrc` -eq 0 ]; then
X-        echo "Your .bashrc doesn't seem to source /etc/profile
or /etc/profile.d/autojump.bash"
X-        echo "Adding the /etc/profile.d/autojump.bash to your .bashrc"
X+        echo "Your .bashrc doesn't seem to source /etc/profile or
${prefix}/etc/profile.d/autojump.bash"
X+        echo "Adding the ${prefix}/etc/profile.d/autojump.bash to
your .bashrc"
X         echo "" >> ~/.bashrc
X         echo "# Added by autojump install.sh" >> ~/.bashrc
X-        echo "source /etc/profile.d/autojump.bash" >> ~/.bashrc
X+        echo "source ${prefix}/etc/profile.d/autojump.bash" >>
~/.bashrc
X     fi
X     echo "Done!"
X     echo
X     echo "You need to source your ~/.bashrc (source ~/.bashrc) before
you can start using autojump."
X else
X-    echo "Your distribution does not have a /etc/profile.d directory,
the default that we install one of the scripts to. Would you like us to
copy it into your ~/.bashrc file to make it work? (If you have done this
once before, delete the old version before doing it again.) [y/n]"
X+    echo "Your distribution does not have a ${prefix}/etc/profile.d
directory, the default that we install one of the scripts to. Would you
like us to copy it into your ~/.bashrc file to make it work? (If you
have done this once before, delete the old version before doing it
again.) [y/n]"
X     read ans
X     if [ ${#ans} -gt 0 ]; then
X            if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans =
"Yes" ]; then
dffdbfd25a1b39a4ce4177d40a358e55
echo x - autojump/pkg-descr
sed 's/^X//' >autojump/pkg-descr << 'af87931262491898c6ab1cc3c3ddac55'
XAutojump is a tool that acts as a complement to cd: it makes navigating
your filesystem a lot faster. It works by automagically maintaining a
database of the directories you use the most from the command line, and
allows you to jump back and forth between them, by typing just a few
letters of the name of the directory you want to jump to.
X
XWWW: http://github.com/joelthelion/autojump/wiki
X
af87931262491898c6ab1cc3c3ddac55
echo x - autojump/distinfo
sed 's/^X//' >autojump/distinfo << '60a32d51eebaff511cac7ae3e366850a'
XMD5 (autojump_v13.tar.gz) = 13e4e6173f4ed63b8babb00fcd95f600
XSHA256 (autojump_v13.tar.gz) =
020ef781b30f8cbe4f183f2ccadac720e3f747e82924aaa4b95da01d76cc2153
XSIZE (autojump_v13.tar.gz) = 22723
60a32d51eebaff511cac7ae3e366850a
echo x - autojump/Makefile
sed 's/^X//' >autojump/Makefile << '64238b552e4fe3c222efa4fdde5e5897'
X# New ports collection makefile for:  autojump 
X# Date created:        12 October 2010
X# Whom:                Neeraj Verma <neeraj.verma.ports@vermatech.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=      autojump
XDISTNAME=      autojump_v13
XPORTVERSION=   v13 
XDISTFILES=     autojump_v13.tar.gz
XCATEGORIES=    sysutils
XMASTER_SITES=  http://github.com/downloads/joelthelion/autojump/ \
X               http://www.vermatech.com/distfiles/
X
XMAINTAINER=    neeraj.verma.ports@vermatech.com
XCOMMENT=       Autojump is a tool that acts as a complement to cd: it
makes navigating your filesystem a lot faster. It works by automagically
maintaining a database of the directories you use the most from the
command line, and allows you to jump back and forth between them, by
typing just a few letters of the name of the directory you want to jump
to.
X
XPLIST_FILES=   bin/autojump \
X               bin/jumpapplet \
X               share/autojump/icon.png \
X               share/man/man1/autojump.1 \
X               etc/profile.d/autojump.sh
X
XPLIST_FILES+=  etc/profile.d/autojump.bash
X
XOPTIONS=       ZSH "Install zsh version as well." On
X
X.include <bsd.port.options.mk>
X
X.if defined(WITH_ZSH)
XPLIST_FILES+=  etc/profile.d/autojump.zsh
XRUN_DEPENDS=   ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
X               ${LOCALBASE}/bin/zsh:${PORTSDIR}/shells/zsh
X.else
XRUN_DEPENDS=   ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
X.endif
X
XPLIST_DIRS=    share/autojump
X
X
X.if !target(do-build)
Xdo-build:
X# do nothing since the program is all scripts based.
X.endif
X
X.if !target(do-install)
Xdo-install:
X       @(cd ${INSTALL_WRKSRC} && ./install.sh ) 
X.if defined(WITH_ZSH)
X       @(cd ${INSTALL_WRKSRC} && ./install.zsh ) 
X.endif
X.endif
X
X.include <bsd.port.mk>
X
64238b552e4fe3c222efa4fdde5e5897
exit
Comment 3 neeraj.verma 2010-10-18 00:23:34 UTC
The following has been modified to work with zsh.

Use this instead...

# 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:
#
#       autojump
#       autojump/files
#       autojump/files/patch-autojump
#       autojump/files/patch-install.zsh
#       autojump/files/patch-install.sh
#       autojump/pkg-descr
#       autojump/distinfo
#       autojump/Makefile
#
echo c - autojump
mkdir -p autojump > /dev/null 2>&1
echo c - autojump/files
mkdir -p autojump/files > /dev/null 2>&1
echo x - autojump/files/patch-autojump
sed 's/^X//' >autojump/files/patch-autojump <<
'6917d57faf6ecf383ae7da8503e66008'
X--- ./autojump.orig    2010-10-01 10:49:18.000000000 -0400
X+++ ./autojump 2010-10-17 19:00:36.000000000 -0400
X@@ -1,4 +1,4 @@
X-#!/usr/bin/python
X+#!/usr/local/bin/python
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
6917d57faf6ecf383ae7da8503e66008
echo x - autojump/files/patch-install.zsh
sed 's/^X//' >autojump/files/patch-install.zsh <<
'd02a62ee01389e4b53e4877dbeb4f3f9'
X--- ./install.zsh.orig 2010-10-17 19:08:50.000000000 -0400
X+++ ./install.zsh      2010-10-17 19:09:05.000000000 -0400
X@@ -1,4 +1,4 @@
X-#! /bin/zsh
X+#! /usr/local/bin/zsh
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
X@@ -19,7 +19,7 @@
X         echo "sudo ./install.sh [--prefix /usr/local]"
X }
X 
X-prefix=/usr
X+prefix=/usr/local
X 
X #command line parsing
X while true; do
X@@ -39,19 +39,19 @@
X 
X echo "Installing main files to ${prefix} ..."
X 
X-sudo mkdir -p ${prefix}/share/autojump/
X-sudo mkdir -p ${prefix}/bin/
X-sudo mkdir -p ${prefix}/share/man/man1/
X-sudo cp icon.png ${prefix}/share/autojump/
X-sudo cp jumpapplet ${prefix}/bin/
X-sudo cp autojump ${prefix}/bin/
X-sudo cp autojump.1 ${prefix}/share/man/man1/
X+mkdir -p ${prefix}/share/autojump/
X+mkdir -p ${prefix}/bin/
X+mkdir -p ${prefix}/share/man/man1/
X+cp icon.png ${prefix}/share/autojump/
X+cp jumpapplet ${prefix}/bin/
X+cp autojump ${prefix}/bin/
X+cp autojump.1 ${prefix}/share/man/man1/
X 
X # autocompletion file in the first directory of the FPATH variable
X fail=true
X for f in $fpath
X do
X-    sudo cp _j $f && fail=false && break
X+    cp _j $f && fail=false && break
X done
X if $fail
X then
X@@ -61,18 +61,18 @@
X     echo "Installed autocompletion file to $f"
X fi
X 
X-if [ -d "/etc/profile.d" ]; then
X-    sudo cp autojump.zsh /etc/profile.d/
X-    sudo cp autojump.sh /etc/profile.d/
X+if [ -d "/usr/local/etc/profile.d" ]; then
X+    cp autojump.zsh /usr/local/etc/profile.d/
X+    cp autojump.sh /usr/local/etc/profile.d/
X     echo "Remember to add the line" 
X-    echo "    source /etc/profile.d/autojump.zsh"
X+    echo "    source /usr/local/etc/profile.d/autojump.zsh"
X     echo "or"
X-    echo "    source /etc/profile"
X+    echo "    source /usr/local/etc/profile"
X     echo "to your ~/.zshrc if it's not there already"
X     echo
X     echo "You need to source your ~/.zshrc (source ~/.zshrc) before
you can start using autojump."
X else
X-    echo "Your distribution does not have a /etc/profile.d directory,
the default that we install one of the scripts to. Would you like us to
copy it into your ~/.zshrc file to make it work? (If you have done this
once before, delete the old version before doing it again.) [y/n]"
X+    echo "Your distribution does not have a /usr/local/etc/profile.d
directory, the default that we install one of the scripts to. Would you
like us to copy it into your ~/.zshrc file to make it work? (If you have
done this once before, delete the old version before doing it again.)
[y/n]"
X     read ans
X     if [ ${#ans} -gt 0 ]; then
X       if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ];
then
d02a62ee01389e4b53e4877dbeb4f3f9
echo x - autojump/files/patch-install.sh
sed 's/^X//' >autojump/files/patch-install.sh <<
'dffdbfd25a1b39a4ce4177d40a358e55'
X--- ./install.sh.orig  2010-10-01 10:49:18.000000000 -0400
X+++ ./install.sh       2010-10-17 19:00:36.000000000 -0400
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/usr/local/bin/bash
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
X@@ -16,11 +16,11 @@
X #along with autojump.  If not, see <http://www.gnu.org/licenses/>.
X 
X function show_help {
X-        echo "sudo ./install.sh [--prefix /usr/local]"
X+        echo "./install.sh [--prefix /usr/local]"
X }
X 
X # Default install directory.
X-prefix=/usr
X+prefix=/usr/local
X 
X # Command line parsing
X while true; do
X@@ -41,32 +41,32 @@
X echo "Installing to ${prefix} ..."
X 
X # INSTALL AUTOJUMP
X-sudo mkdir -p ${prefix}/share/autojump/
X-sudo mkdir -p ${prefix}/bin/
X-sudo mkdir -p ${prefix}/share/man/man1/
X-sudo cp icon.png ${prefix}/share/autojump/
X-sudo cp jumpapplet ${prefix}/bin/
X-sudo cp autojump ${prefix}/bin/
X-sudo cp autojump.1 ${prefix}/share/man/man1/
X+mkdir -p ${prefix}/share/autojump/
X+mkdir -p ${prefix}/bin/
X+mkdir -p ${prefix}/share/man/man1/
X+cp icon.png ${prefix}/share/autojump/
X+cp jumpapplet ${prefix}/bin/
X+cp autojump ${prefix}/bin/
X+cp autojump.1 ${prefix}/share/man/man1/
X 
X-if [ -d "/etc/profile.d" ]; then
X-    sudo cp autojump.bash /etc/profile.d/
X-    sudo cp autojump.sh /etc/profile.d/
X+if [ -d "${prefix}/etc/profile.d" ]; then
X+    cp autojump.bash ${prefix}/etc/profile.d/
X+    cp autojump.sh ${prefix}/etc/profile.d/
X 
X     # Make sure that the code we just copied has been sourced.
X-    # check if .bashrc has sourced /etc/profile
or /etc/profile.d/autojump.bash
X+    # check if .bashrc has sourced /etc/profile or
${prefix}/etc/profile.d/autojump.bash
X     if [ `grep -c "^[[:space:]]*source\|\. /etc/profile(\.d/autojump
\.bash)[[:space:]]*$" ~/.bashrc` -eq 0 ]; then
X-        echo "Your .bashrc doesn't seem to source /etc/profile
or /etc/profile.d/autojump.bash"
X-        echo "Adding the /etc/profile.d/autojump.bash to your .bashrc"
X+        echo "Your .bashrc doesn't seem to source /etc/profile or
${prefix}/etc/profile.d/autojump.bash"
X+        echo "Adding the ${prefix}/etc/profile.d/autojump.bash to
your .bashrc"
X         echo "" >> ~/.bashrc
X         echo "# Added by autojump install.sh" >> ~/.bashrc
X-        echo "source /etc/profile.d/autojump.bash" >> ~/.bashrc
X+        echo "source ${prefix}/etc/profile.d/autojump.bash" >>
~/.bashrc
X     fi
X     echo "Done!"
X     echo
X     echo "You need to source your ~/.bashrc (source ~/.bashrc) before
you can start using autojump."
X else
X-    echo "Your distribution does not have a /etc/profile.d directory,
the default that we install one of the scripts to. Would you like us to
copy it into your ~/.bashrc file to make it work? (If you have done this
once before, delete the old version before doing it again.) [y/n]"
X+    echo "Your distribution does not have a ${prefix}/etc/profile.d
directory, the default that we install one of the scripts to. Would you
like us to copy it into your ~/.bashrc file to make it work? (If you
have done this once before, delete the old version before doing it
again.) [y/n]"
X     read ans
X     if [ ${#ans} -gt 0 ]; then
X            if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans =
"Yes" ]; then
dffdbfd25a1b39a4ce4177d40a358e55
echo x - autojump/pkg-descr
sed 's/^X//' >autojump/pkg-descr << 'af87931262491898c6ab1cc3c3ddac55'
XAutojump is a tool that acts as a complement to cd: it makes navigating
your filesystem a lot faster. It works by automagically maintaining a
database of the directories you use the most from the command line, and
allows you to jump back and forth between them, by typing just a few
letters of the name of the directory you want to jump to.
X
XWWW: http://github.com/joelthelion/autojump/wiki
X
af87931262491898c6ab1cc3c3ddac55
echo x - autojump/distinfo
sed 's/^X//' >autojump/distinfo << '60a32d51eebaff511cac7ae3e366850a'
XMD5 (autojump_v13.tar.gz) = 13e4e6173f4ed63b8babb00fcd95f600
XSHA256 (autojump_v13.tar.gz) =
020ef781b30f8cbe4f183f2ccadac720e3f747e82924aaa4b95da01d76cc2153
XSIZE (autojump_v13.tar.gz) = 22723
60a32d51eebaff511cac7ae3e366850a
echo x - autojump/Makefile
sed 's/^X//' >autojump/Makefile << '64238b552e4fe3c222efa4fdde5e5897'
X# New ports collection makefile for:  autojump 
X# Date created:        12 October 2010
X# Whom:                Neeraj Verma <neeraj.verma.ports@vermatech.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=      autojump
XDISTNAME=      autojump_v13
XPORTVERSION=   v13 
XDISTFILES=     autojump_v13.tar.gz
XCATEGORIES=    sysutils
XMASTER_SITES=  http://github.com/downloads/joelthelion/autojump/ \
X               http://www.vermatech.com/distfiles/
X
XMAINTAINER=    neeraj.verma.ports@vermatech.com
XCOMMENT=       Autojump is a tool that acts as a complement to cd: it
makes navigating your filesystem a lot faster. It works by automagically
maintaining a database of the directories you use the most from the
command line, and allows you to jump back and forth between them, by
typing just a few letters of the name of the directory you want to jump
to.
X
XPLIST_FILES=   bin/autojump \
X               bin/jumpapplet \
X               share/autojump/icon.png \
X               share/man/man1/autojump.1 \
X               etc/profile.d/autojump.sh
X
XPLIST_FILES+=  etc/profile.d/autojump.bash
X
XOPTIONS=       ZSH "Install zsh version as well." On
X
X.include <bsd.port.options.mk>
X
X.if defined(WITH_ZSH)
XPLIST_FILES+=  etc/profile.d/autojump.zsh
XRUN_DEPENDS=   ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
X               ${LOCALBASE}/bin/zsh:${PORTSDIR}/shells/zsh
X.else
XRUN_DEPENDS=   ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
X.endif
X
XPLIST_DIRS=    share/autojump
X
X
X.if !target(do-build)
Xdo-build:
X# do nothing since the program is all scripts based.
X.endif
X
X.if !target(do-install)
Xdo-install:
X       @(cd ${INSTALL_WRKSRC} && ./install.sh ) 
X.if defined(WITH_ZSH)
X       @(cd ${INSTALL_WRKSRC} && ./install.zsh ) 
X.endif
X.endif
X
X.include <bsd.port.mk>
X
64238b552e4fe3c222efa4fdde5e5897
exit




On Sat, 2010-10-16 at 14:50 +0200, Jilles Tjoelker wrote:
> > [new port for autojump]
> 
> Upstream seems to offer a zsh version as well, why did you omit it?
>
Comment 4 Baptiste Daroussin freebsd_committer freebsd_triage 2011-02-07 11:33:33 UTC
Hi,

Can you fix your ports to repects what is describe here:
http://www.freebsd.org/doc/en/books/porters-handbook/ ?
ports-mgmt/portlint and reading Mk/*.mk comments (header) may also help.


What I can see so far:

too long comment line
duplicated RUN_DEPENDS line
re invent of NO_BUILD macro
bad do-install usage
github mastersite not providing the distfile.
bad PORTVERSION

regards,
Bapt
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2011-05-07 16:25:42 UTC
State Changed
From-To: open->feedback

Waiting for sender feedback
Comment 6 numberformat 2011-05-18 01:41:50 UTC
Thanks for looking at my submission. Here are my comments:

1. I have fixed this. The comment line has been shortened.
2. the duplicated RUN_DEPENDS line is not actually duplicated. It is part of
an IF ELSE statement.
3. I am not understanding what the reinvent of "NO_BUILD" macro means. Can
you please elaborate?
4. I have fixed this.
5. I have fixed this.
6. I spoke to the author about fixing his version and package naming scheme.
He said he will not change it so I had to change my PORTVERSION value to be
non standard. Is that OK?

Let me know your thoughts and I will post the modified files.
Comment 7 Stephen Montgomery-Smith freebsd_committer freebsd_triage 2011-07-01 04:00:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stephen

I'll take it.
Comment 8 Stephen Montgomery-Smith 2011-07-01 04:08:30 UTC
I'll have a go at committing your port.

What bapt meant about "NO_BUILD" is that instead of using your construction:

if !target(do-build)
do-build:
# do nothing since the program is all scripts based.
.endif

you could have just written:

NO_BUILD=	yes

As for the non-standard port labelling, maybe we could call the port 
autojump.13 or something like that.  Something that portlint doesn't 
object to.

Anyway, send the modified shar file, and I'll see what i can do.
Comment 9 neeraj.verma 2011-07-04 13:45:38 UTC
Stephen,
	Thanks for looking at my port submission. I have made the changes that
you have mentioned. Please see attached.

Thanks.
Comment 10 Stephen Montgomery-Smith 2011-07-04 17:33:19 UTC
There are a few more things needed to get this port into shape.

First, there is a port ports-mgmt/portlint which installs a program 
called portlint.  Run "portlint -abt" from within your port, and it will 
print a lot of errors.  I am attaching a shar file in which I have 
corrected these errors.

Second, you need to make sure that "make deinstall" really does remove 
everything - directories as well as files.  What I do is this

find /usr/local | sort > fff-1
make install deinstall
find /usr/local | sort > fff-2
diff fff1 fff2

to see if there is anything left behind.  You have quite a few files and 
directories left over.  (In fact, "make install deinstall" should really 
leave /usr/local as it was before, and the FreeBSD people compute 
checksums of each file and see if it was as before.)

Third, the man pages should be stored in man/man1, not in 
share/man/man1.  Then you don't put then in PLIST_FILES, but in MAN1 
(see 
http://www.freebsd.org/doc/en/books/porters-handbook/makefile-manpages.html). 
  So you will need to patch the installation files.

Fourth, the install program changes /root/.bashrc or whatever.  But this 
should really by done by each individual user.  It would be better if 
your port would write instructions to the screen (use pkg-message). 
Hopefully these instructions are also in the man pages.

Also, if the port writes to various system wide profiles, it will have 
to restore them on deinstallation.  This job is sufficiently complex 
that you need to use a pkg-plist file instead of PLIST_FILE and 
PLIST_DIR in Makefile.

Fifth, this port is not "prefix friendly."  If the user of the port 
happens to have PREFIX=/bubbly/boo/boo, then when the port is installed, 
everything should be in /bubbly/boo/boo, and all the installed scripts 
should be modified to know that this is what ${prefix} is.  I see places 
where prefix is hard coded in the installation scripts.

Generally this port will need a lot of work before it fits well into the 
FreeBSD ports structure.  If you need help, you can reply to this 
message, and I will see what I can do (time constraints being what they 
are).
Comment 11 neeraj.verma 2011-12-04 05:21:52 UTC
Thanks for your feedback. I took the latest version you posted and made
the following changes:

* Tested the make deinstall functionality. Everything seems to be in
order. The only remaining files are those of the dependencies (bash, zsh
and python). Please let me know if there are files that remained.

* Python has been added to the list of dependencies for this port. It
was missing before.

* The location of the man file has been fixed and tested.

* The port has been changed not to touch ~/.bashrc and or ~/.zshrc. a
pkg-message has been added to notify the user of the system wide
profiles it does modify. ( the port no longer asks the user if they want
to modify any file )

* The /etc/profile and/or /etc/zshrc are modified upon installation and
de-installation of the port. 

* verified the port is prefix friendly. Please let me know if you find
any places where it is hard coded.

Below is the most up-to-date SHAR of this port. 

I know that there are a couple of things that still might need to be
done. I am awaiting your response.


# 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:
#
#	autojump
#	autojump/files
#	autojump/files/patch-autojump
#	autojump/files/patch-install.sh
#	autojump/files/patch-install.zsh
#	autojump/distinfo
#	autojump/pkg-descr
#	autojump/Makefile
#	autojump/pkg-message
#	autojump/pkg-deinstall
#	autojump/pkg-install
#
echo c - autojump
mkdir -p autojump > /dev/null 2>&1
echo c - autojump/files
mkdir -p autojump/files > /dev/null 2>&1
echo x - autojump/files/patch-autojump
sed 's/^X//' >autojump/files/patch-autojump <<
'6917d57faf6ecf383ae7da8503e66008'
X--- ./autojump.orig	2010-10-01 10:49:18.000000000 -0400
X+++ ./autojump	2011-12-03 17:58:54.000000000 -0500
X@@ -1,4 +1,4 @@
X-#!/usr/bin/python
X+#!/usr/local/bin/python
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
6917d57faf6ecf383ae7da8503e66008
echo x - autojump/files/patch-install.sh
sed 's/^X//' >autojump/files/patch-install.sh <<
'dffdbfd25a1b39a4ce4177d40a358e55'
X--- ./install.sh.orig	2010-10-01 10:49:18.000000000 -0400
X+++ ./install.sh	2011-12-03 23:04:22.000000000 -0500
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/usr/local/bin/bash
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
X@@ -16,11 +16,11 @@
X #along with autojump.  If not, see <http://www.gnu.org/licenses/>.
X 
X function show_help {
X-        echo "sudo ./install.sh [--prefix /usr/local]"
X+        echo "./install.sh [--prefix /usr/local]"
X }
X 
X # Default install directory.
X-prefix=/usr
X+prefix=/usr/local
X 
X # Command line parsing
X while true; do
X@@ -41,56 +41,10 @@
X echo "Installing to ${prefix} ..."
X 
X # INSTALL AUTOJUMP
X-sudo mkdir -p ${prefix}/share/autojump/
X-sudo mkdir -p ${prefix}/bin/
X-sudo mkdir -p ${prefix}/share/man/man1/
X-sudo cp icon.png ${prefix}/share/autojump/
X-sudo cp jumpapplet ${prefix}/bin/
X-sudo cp autojump ${prefix}/bin/
X-sudo cp autojump.1 ${prefix}/share/man/man1/
X-
X-if [ -d "/etc/profile.d" ]; then
X-    sudo cp autojump.bash /etc/profile.d/
X-    sudo cp autojump.sh /etc/profile.d/
X-
X-    # Make sure that the code we just copied has been sourced.
X-    # check if .bashrc has sourced /etc/profile
or /etc/profile.d/autojump.bash
X-    if [ `grep -c "^[[:space:]]*source\|\. /etc/profile(\.d/autojump
\.bash)[[:space:]]*$" ~/.bashrc` -eq 0 ]; then
X-        echo "Your .bashrc doesn't seem to source /etc/profile
or /etc/profile.d/autojump.bash"
X-        echo "Adding the /etc/profile.d/autojump.bash to your .bashrc"
X-        echo "" >> ~/.bashrc
X-        echo "# Added by autojump install.sh" >> ~/.bashrc
X-        echo "source /etc/profile.d/autojump.bash" >> ~/.bashrc
X-    fi
X-    echo "Done!"
X-    echo
X-    echo "You need to source your ~/.bashrc (source ~/.bashrc) before
you can start using autojump."
X-else
X-    echo "Your distribution does not have a /etc/profile.d directory,
the default that we install one of the scripts to. Would you like us to
copy it into your ~/.bashrc file to make it work? (If you have done this
once before, delete the old version before doing it again.) [y/n]"
X-    read ans
X-    if [ ${#ans} -gt 0 ]; then
X-	     if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ];
then
X-
X-                # Answered yes. Go ahead and add the autojump code
X-	        echo "" >> ~/.bashrc
X-	        echo "#autojump" >> ~/.bashrc
X-	        cat autojump.bash | grep -v "^#" >> ~/.bashrc
X-
X-                # Since OSX uses .bash_profile, we need to make sure
that .bashrc is properly sourced.
X-                # Makes the assumption that if they have a line:
source ~/.bashrc or . ~/.bashrc, that
X-                # .bashrc has been properly sourced and you don't need
to add it.
X-                OS=`uname`
X-                if [ $OS == 'Darwin' -a `grep -c "^[[:space:]]*source
\|\. ~/\.bashrc[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then
X-                    echo "You are using OSX and your .bash_profile
doesn't seem to be sourcing .bashrc"
X-                    echo "Adding source ~/.bashrc to your bashrc"
X-                    echo -e "\n# Get the aliases and functions" >>
~/.bash_profile
X-                    echo -e "if [ -f ~/.bashrc ]; then\n  . ~/.bashrc
\nfi" >> ~/.bash_profile
X-                fi
X-                echo "You need to source your ~/.bashrc (source
~/.bashrc) before you can start using autojump."
X-	     else
X-	         echo "Then you need to put autojump.sh, or the code from it,
somewhere where it will get read. Good luck!"
X-	     fi
X-    else
X-        echo "Then you need to put autojump.sh, or the code from it,
somewhere where it will get read. Good luck!"
X-    fi
X-fi
X+mkdir -p ${prefix}/share/autojump/
X+mkdir -p ${prefix}/bin/
X+mkdir -p ${prefix}/man/man1/
X+cp icon.png ${prefix}/share/autojump/
X+cp jumpapplet ${prefix}/bin/
X+cp autojump ${prefix}/bin/
X+cp autojump.1 ${prefix}/man/man1/
dffdbfd25a1b39a4ce4177d40a358e55
echo x - autojump/files/patch-install.zsh
sed 's/^X//' >autojump/files/patch-install.zsh <<
'd02a62ee01389e4b53e4877dbeb4f3f9'
X--- ./install.zsh.orig	2010-10-01 10:49:18.000000000 -0400
X+++ ./install.zsh	2011-12-03 23:25:09.000000000 -0500
X@@ -1,4 +1,4 @@
X-#! /bin/zsh
X+#! /usr/local/bin/zsh
X #Copyright Joel Schaerer 2008, 2009
X #This file is part of autojump
X 
X@@ -19,7 +19,7 @@
X         echo "sudo ./install.sh [--prefix /usr/local]"
X }
X 
X-prefix=/usr
X+prefix=/usr/local
X 
X #command line parsing
X while true; do
X@@ -39,19 +39,19 @@
X 
X echo "Installing main files to ${prefix} ..."
X 
X-sudo mkdir -p ${prefix}/share/autojump/
X-sudo mkdir -p ${prefix}/bin/
X-sudo mkdir -p ${prefix}/share/man/man1/
X-sudo cp icon.png ${prefix}/share/autojump/
X-sudo cp jumpapplet ${prefix}/bin/
X-sudo cp autojump ${prefix}/bin/
X-sudo cp autojump.1 ${prefix}/share/man/man1/
X+mkdir -p ${prefix}/share/autojump/
X+mkdir -p ${prefix}/bin/
X+mkdir -p ${prefix}/man/man1/
X+cp icon.png ${prefix}/share/autojump/
X+cp jumpapplet ${prefix}/bin/
X+cp autojump ${prefix}/bin/
X+cp autojump.1 ${prefix}/man/man1/
X 
X # autocompletion file in the first directory of the FPATH variable
X fail=true
X for f in $fpath
X do
X-    sudo cp _j $f && fail=false && break
X+    cp _j $f && fail=false && break
X done
X if $fail
X then
X@@ -60,32 +60,3 @@
X else
X     echo "Installed autocompletion file to $f"
X fi
X-
X-if [ -d "/etc/profile.d" ]; then
X-    sudo cp autojump.zsh /etc/profile.d/
X-    sudo cp autojump.sh /etc/profile.d/
X-    echo "Remember to add the line" 
X-    echo "    source /etc/profile.d/autojump.zsh"
X-    echo "or"
X-    echo "    source /etc/profile"
X-    echo "to your ~/.zshrc if it's not there already"
X-    echo
X-    echo "You need to source your ~/.zshrc (source ~/.zshrc) before
you can start using autojump."
X-else
X-    echo "Your distribution does not have a /etc/profile.d directory,
the default that we install one of the scripts to. Would you like us to
copy it into your ~/.zshrc file to make it work? (If you have done this
once before, delete the old version before doing it again.) [y/n]"
X-    read ans
X-    if [ ${#ans} -gt 0 ]; then
X-	if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
X-	    echo "" >> ~/.zshrc
X-	    echo "#autojump" >> ~/.zshrc
X-	    cat autojump.zsh >> ~/.zshrc
X-            echo "Done!"
X-            echo
X-            echo "You need to source your ~/.zshrc (source ~/.zshrc)
before you can start using autojump."
X-	else
X-	    echo "Then you need to put autojump.zsh, or the code from it,
somewhere where it will get read. Good luck!"
X-	fi
X-    else
X-    	    echo "Then you need to put autojump.zsh, or the code from it,
somewhere where it will get read. Good luck!"
X-    fi
X-fi
d02a62ee01389e4b53e4877dbeb4f3f9
echo x - autojump/distinfo
sed 's/^X//' >autojump/distinfo << '60a32d51eebaff511cac7ae3e366850a'
XSHA256 (autojump_v13.tar.gz) =
020ef781b30f8cbe4f183f2ccadac720e3f747e82924aaa4b95da01d76cc2153
XSIZE (autojump_v13.tar.gz) = 22723
60a32d51eebaff511cac7ae3e366850a
echo x - autojump/pkg-descr
sed 's/^X//' >autojump/pkg-descr << 'af87931262491898c6ab1cc3c3ddac55'
XAutojump is a tool that acts as a complement to cd: it makes navigating
your
Xfilesystem a lot faster. It works by automagically maintaining a
database of
Xthe directories you use the most from the command line, and allows you
to jump
Xback and forth between them, by typing just a few letters of the name
of the
Xdirectory you want to jump to.
X
XWWW: http://github.com/joelthelion/autojump/wiki
af87931262491898c6ab1cc3c3ddac55
echo x - autojump/Makefile
sed 's/^X//' >autojump/Makefile << '64238b552e4fe3c222efa4fdde5e5897'
X# New ports collection makefile for:  autojump
X# Date created:        12 October 2011
X# Whom:                Neeraj Verma <neeraj.verma.ports@vermatech.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	autojump
XPORTVERSION=	13
XCATEGORIES=	sysutils
XMASTER_SITES=	http://github.com/downloads/joelthelion/autojump/ \
X		http://www.vermatech.com/distfiles/
XDISTNAME=	autojump_v13
X
XMAINTAINER=	neeraj.verma.ports@vermatech.com
XCOMMENT=	Autojump is a tool that acts as a complement to cd
X
XNO_BUILD=	YES
X
XPLIST_FILES=	bin/autojump \
X		bin/jumpapplet \
X		share/autojump/icon.png \
X		man/man1/autojump.1 
X
XOPTIONS=	ZSH "Install zsh version as well." On
X
X.include <bsd.port.options.mk>
X
X.if defined(WITH_ZSH)
XRUN_DEPENDS=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
X		${LOCALBASE}/bin/zsh:${PORTSDIR}/shells/zsh \
X		${LOCALBASE}/bin/python:${PORTSDIR}/lang/python 
X.else
XRUN_DEPENDS=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \
X		${LOCALBASE}/bin/python:${PORTSDIR}/lang/python 
X.endif
X
XPLIST_DIRS=	share/autojump
X
Xdo-install:
X.if defined(WITH_ZSH)
X	@(cd ${INSTALL_WRKSRC} && ./install.zsh )
X.else
X	@(cd ${INSTALL_WRKSRC} && ./install.sh )
X.endif
X	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME}
POST-INSTALL
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
64238b552e4fe3c222efa4fdde5e5897
echo x - autojump/pkg-message
sed 's/^X//' >autojump/pkg-message << '0c84fd6d3e4beddb2ab714012913806a'
X**************************************************************
X* AutoJump installed
X**************************************************************
X* Note: Your /etc/profile was changed for this installation.
X* changes will be reverted when you un-install the package. 
X**************************************************************
0c84fd6d3e4beddb2ab714012913806a
echo x - autojump/pkg-deinstall
sed 's/^X//' >autojump/pkg-deinstall <<
'8202d45a1a2656e1318046a72bd04ea7'
X#!/bin/sh
X
Xcase $2 in
XPOST-DEINSTALL)
X	rm -f /etc/profile.autojump
X	rm -f /etc/zshrc.autojump
X	# delete the source (.) line from the /etc/profile and /etc/zshrc
X	sed -i '' -e '/profile.autojump/d' /etc/profile
X	sed -i '' -e '/zshrc.autojump/d' /etc/zshrc
X	;;
Xesac
8202d45a1a2656e1318046a72bd04ea7
echo x - autojump/pkg-install
sed 's/^X//' >autojump/pkg-install << '7f92930a482aac056bffddcf4b02b53e'
X#!/bin/sh
X
Xcase $2 in
XPOST-INSTALL)
X	cp work/autojump_v13/autojump.bash /etc/profile.autojump
X	cp work/autojump_v13/autojump.zsh /etc/zshrc.autojump
X	echo ". /etc/profile.autojump" >> /etc/profile
X	echo ". /etc/zshrc.autojump" >> /etc/zshrc
X	;;
Xesac
7f92930a482aac056bffddcf4b02b53e
exit
Comment 12 Stephen Montgomery-Smith 2011-12-24 01:10:21 UTC
I cannot read the last shar file you submitted.  Could you email it as 
an attachment?  Or put it on a web page somewhere and send the link?

Thanks, Stephen
Comment 13 neeraj.verma 2011-12-24 03:55:49 UTC
Please see attached.
Comment 14 Stephen Montgomery-Smith 2011-12-25 21:06:17 UTC
I made quite a large number of changes to your submission.  Can you 
check it over and make sure it still does what you want it to do?

1.  I spent some time making it PREFIX friendly.
2.  I made sure that it would install properly as a package.  You can 
check this yourself by doing "make package; make deinstall; make clean; 
pkg_add autojump-13.tbz".  The problem is that ${WRKSRC} will not be 
present when the package is being installed.  For this reason, I copied 
autojump.bash and autojump.zsh into ${PREFIX}/share/autojump.

Things you might or might not want to do.
3.  Notice I put conditionals in pkg-install so that it would only 
modify the files if they exist.  Maybe you want to make similar changes 
to pkg-deinstall.
4.  Look at the shells/bash port.  It has a pkg-install that acts 
differently when the person doesn't have write access to /etc.  It is 
possible to install a port without being root.
5.  Instead of using "cp" in the install scripts, you might want to 
consider using "install."  This is probably more a matter of style than 
anything else, but you are relying on the person who wrapped the source 
tarball to have got his permissions correct on the various files.

Comment 15 neeraj.verma 2012-03-24 04:08:33 UTC
Stephen,

The following are the changes:

* added conditionals to during pkg-deinstall process
* Fixed broken link to Master site 
* Changed DISTNAME to  use ${portversion}
* Tested functionality to make sure everything still worked.

As soon as this port is published, look into the remaining items.

Let me know if anything else is needed.

Thanks.
Comment 16 dfilter service freebsd_committer freebsd_triage 2012-04-30 04:28:54 UTC
stephen     2012-04-30 03:28:38 UTC

  FreeBSD ports repository

  Modified files:
    sysutils             Makefile 
  Added files:
    sysutils/autojump    Makefile distinfo pkg-deinstall pkg-descr 
                         pkg-message 
    sysutils/autojump/files patch-install.sh patch-install.zsh 
                            pkg-install.in 
  Log:
  - New port sysutils/autojump
  
  Autojump is a tool that acts as a complement to cd: it makes navigating your
  filesystem a lot faster. It works by automagically maintaining a database of
  the directories you use the most from the command line, and allows you to jump
  back and forth between them, by typing just a few letters of the name of the
  directory you want to jump to.
  
  PR:             ports/151467
  Submitted by:   Neeraj Verma <neeraj.verma.ports@vermatech.com>
  
  Revision  Changes    Path
  1.1397    +1 -0      ports/sysutils/Makefile
  1.1       +61 -0     ports/sysutils/autojump/Makefile (new)
  1.1       +2 -0      ports/sysutils/autojump/distinfo (new)
  1.1       +68 -0     ports/sysutils/autojump/files/patch-install.sh (new)
  1.1       +65 -0     ports/sysutils/autojump/files/patch-install.zsh (new)
  1.1       +14 -0     ports/sysutils/autojump/files/pkg-install.in (new)
  1.1       +15 -0     ports/sysutils/autojump/pkg-deinstall (new)
  1.1       +7 -0      ports/sysutils/autojump/pkg-descr (new)
  1.1       +6 -0      ports/sysutils/autojump/pkg-message (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 17 Stephen Montgomery-Smith freebsd_committer freebsd_triage 2012-04-30 04:29:50 UTC
State Changed
From-To: feedback->closed

Committed, thanks!