1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

- 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>
This commit is contained in:
Stephen Montgomery-Smith 2012-04-30 03:28:38 +00:00
parent 51281a2450
commit 215717c41e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=295706
9 changed files with 239 additions and 0 deletions

View File

@ -45,6 +45,7 @@
SUBDIR += atitvout
SUBDIR += atop
SUBDIR += auto-admin
SUBDIR += autojump
SUBDIR += automount
SUBDIR += automounter
SUBDIR += autopsy

View File

@ -0,0 +1,61 @@
# New ports collection makefile for: autojump
# Date created: 12 October 2011
# Whom: Neeraj Verma <neeraj.verma.ports@vermatech.com>
#
# $FreeBSD$
#
PORTNAME= autojump
PORTVERSION= 13
CATEGORIES= sysutils
MASTER_SITES= http://cloud.github.com/downloads/joelthelion/autojump/ \
http://www.vermatech.com/distfiles/
DISTNAME= autojump_v${PORTVERSION}
EXTRACT_SUFX= .tar.gz
MAINTAINER= neeraj.verma.ports@vermatech.com
COMMENT= Autojump is a tool that acts as a complement to cd
RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
USE_PYTHON_RUN= YES
NO_BUILD= YES
SUB_FILES+= pkg-install
PLIST_FILES= bin/autojump \
bin/jumpapplet \
share/autojump/autojump.bash \
share/autojump/autojump.zsh \
share/autojump/icon.png
MAN1= autojump.1
OPTIONS= ZSH "Install zsh version as well." On
.include <bsd.port.options.mk>
.if defined(WITH_ZSH)
RUN_DEPENDS+= ${LOCALBASE}/bin/zsh:${PORTSDIR}/shells/zsh
PLIST_FILES+= share/zsh/site-functions/_j
.endif
PLIST_DIRS= share/autojump
post-patch:
@${REINPLACE_CMD} 's|/usr/bin/python|${PYTHON_CMD}|' ${WRKSRC}/autojump
@${REINPLACE_CMD} -e 's|/usr$$|${PREFIX}|' -e 's|/usr/local|${PREFIX}|' -e 's|/bin/bash|${PREFIX}/bin/bash|' ${WRKSRC}/install.sh
@${REINPLACE_CMD} -e 's|/usr$$|${PREFIX}|' -e 's|/usr/local|${PREFIX}|' -e 's|/bin/zsh|${PREFIX}/bin/zsh|' ${WRKSRC}/install.zsh
do-install:
.if defined(WITH_ZSH)
@(cd ${INSTALL_WRKSRC} && ${SETENV} PREFIX=${PREFIX} ./install.zsh )
.else
@(cd ${INSTALL_WRKSRC} && ${SETENV} PREFIX=${PREFIX} ./install.sh )
.endif
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (autojump_v13.tar.gz) = 020ef781b30f8cbe4f183f2ccadac720e3f747e82924aaa4b95da01d76cc2153
SIZE (autojump_v13.tar.gz) = 22723

View File

@ -0,0 +1,68 @@
--- ./install.sh.orig 2010-10-01 10:49:18.000000000 -0400
+++ ./install.sh 2011-12-03 23:04:22.000000000 -0500
@@ -41,56 +41,12 @@
echo "Installing to ${prefix} ..."
# INSTALL AUTOJUMP
-sudo mkdir -p ${prefix}/share/autojump/
-sudo mkdir -p ${prefix}/bin/
-sudo mkdir -p ${prefix}/share/man/man1/
-sudo cp icon.png ${prefix}/share/autojump/
-sudo cp jumpapplet ${prefix}/bin/
-sudo cp autojump ${prefix}/bin/
-sudo cp autojump.1 ${prefix}/share/man/man1/
-
-if [ -d "/etc/profile.d" ]; then
- sudo cp autojump.bash /etc/profile.d/
- sudo cp autojump.sh /etc/profile.d/
-
- # Make sure that the code we just copied has been sourced.
- # check if .bashrc has sourced /etc/profile or /etc/profile.d/autojump.bash
- if [ `grep -c "^[[:space:]]*source\|\. /etc/profile(\.d/autojump\.bash)[[:space:]]*$" ~/.bashrc` -eq 0 ]; then
- echo "Your .bashrc doesn't seem to source /etc/profile or /etc/profile.d/autojump.bash"
- echo "Adding the /etc/profile.d/autojump.bash to your .bashrc"
- echo "" >> ~/.bashrc
- echo "# Added by autojump install.sh" >> ~/.bashrc
- echo "source /etc/profile.d/autojump.bash" >> ~/.bashrc
- fi
- echo "Done!"
- echo
- echo "You need to source your ~/.bashrc (source ~/.bashrc) before you can start using autojump."
-else
- 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]"
- read ans
- if [ ${#ans} -gt 0 ]; then
- if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
-
- # Answered yes. Go ahead and add the autojump code
- echo "" >> ~/.bashrc
- echo "#autojump" >> ~/.bashrc
- cat autojump.bash | grep -v "^#" >> ~/.bashrc
-
- # Since OSX uses .bash_profile, we need to make sure that .bashrc is properly sourced.
- # Makes the assumption that if they have a line: source ~/.bashrc or . ~/.bashrc, that
- # .bashrc has been properly sourced and you don't need to add it.
- OS=`uname`
- if [ $OS == 'Darwin' -a `grep -c "^[[:space:]]*source\|\. ~/\.bashrc[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then
- echo "You are using OSX and your .bash_profile doesn't seem to be sourcing .bashrc"
- echo "Adding source ~/.bashrc to your bashrc"
- echo -e "\n# Get the aliases and functions" >> ~/.bash_profile
- echo -e "if [ -f ~/.bashrc ]; then\n . ~/.bashrc\nfi" >> ~/.bash_profile
- fi
- echo "You need to source your ~/.bashrc (source ~/.bashrc) before you can start using autojump."
- else
- echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!"
- fi
- else
- echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!"
- fi
-fi
+mkdir -p ${prefix}/share/autojump/
+mkdir -p ${prefix}/bin/
+mkdir -p ${prefix}/man/man1/
+cp icon.png ${prefix}/share/autojump/
+cp autojump.bash ${prefix}/share/autojump/
+cp autojump.zsh ${prefix}/share/autojump/
+cp jumpapplet ${prefix}/bin/
+cp autojump ${prefix}/bin/
+cp autojump.1 ${prefix}/man/man1/

View File

@ -0,0 +1,65 @@
--- ./install.zsh.orig 2010-10-01 10:49:18.000000000 -0400
+++ ./install.zsh 2011-12-03 23:25:09.000000000 -0500
@@ -39,19 +39,21 @@
echo "Installing main files to ${prefix} ..."
-sudo mkdir -p ${prefix}/share/autojump/
-sudo mkdir -p ${prefix}/bin/
-sudo mkdir -p ${prefix}/share/man/man1/
-sudo cp icon.png ${prefix}/share/autojump/
-sudo cp jumpapplet ${prefix}/bin/
-sudo cp autojump ${prefix}/bin/
-sudo cp autojump.1 ${prefix}/share/man/man1/
+mkdir -p ${prefix}/share/autojump/
+mkdir -p ${prefix}/bin/
+mkdir -p ${prefix}/man/man1/
+cp icon.png ${prefix}/share/autojump/
+cp autojump.bash ${prefix}/share/autojump/
+cp autojump.zsh ${prefix}/share/autojump/
+cp jumpapplet ${prefix}/bin/
+cp autojump ${prefix}/bin/
+cp autojump.1 ${prefix}/man/man1/
# autocompletion file in the first directory of the FPATH variable
fail=true
for f in $fpath
do
- sudo cp _j $f && fail=false && break
+ cp _j $f && fail=false && break
done
if $fail
then
@@ -60,32 +60,3 @@
else
echo "Installed autocompletion file to $f"
fi
-
-if [ -d "/etc/profile.d" ]; then
- sudo cp autojump.zsh /etc/profile.d/
- sudo cp autojump.sh /etc/profile.d/
- echo "Remember to add the line"
- echo " source /etc/profile.d/autojump.zsh"
- echo "or"
- echo " source /etc/profile"
- echo "to your ~/.zshrc if it's not there already"
- echo
- echo "You need to source your ~/.zshrc (source ~/.zshrc) before you can start using autojump."
-else
- 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]"
- read ans
- if [ ${#ans} -gt 0 ]; then
- if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
- echo "" >> ~/.zshrc
- echo "#autojump" >> ~/.zshrc
- cat autojump.zsh >> ~/.zshrc
- echo "Done!"
- echo
- echo "You need to source your ~/.zshrc (source ~/.zshrc) before you can start using autojump."
- else
- echo "Then you need to put autojump.zsh, or the code from it, somewhere where it will get read. Good luck!"
- fi
- else
- echo "Then you need to put autojump.zsh, or the code from it, somewhere where it will get read. Good luck!"
- fi
-fi

View File

@ -0,0 +1,14 @@
#!/bin/sh
case $2 in
POST-INSTALL)
if [ -e /etc/profile ]; then \
cp %%PREFIX%%/share/autojump/autojump.bash /etc/profile.autojump
echo ". /etc/profile.autojump" >> /etc/profile
fi
if [ -e /etc/zshrc ]; then \
cp %%PREFIX%%/share/autojump/autojump.zsh /etc/zshrc.autojump
echo ". /etc/zshrc.autojump" >> /etc/zshrc
fi
;;
esac

View File

@ -0,0 +1,15 @@
#!/bin/sh
case $2 in
POST-DEINSTALL)
rm -f /etc/profile.autojump
rm -f /etc/zshrc.autojump
# delete the source (.) line from the /etc/profile and /etc/zshrc
if [ -f /etc/profile ] ; then
sed -i '' -e '/profile.autojump/d' /etc/profile
fi
if [ -f /etc/zshrc ] ; then
sed -i '' -e '/zshrc.autojump/d' /etc/zshrc
fi
;;
esac

View File

@ -0,0 +1,7 @@
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.
WWW: http://github.com/joelthelion/autojump/wiki

View File

@ -0,0 +1,6 @@
**************************************************************
* AutoJump installed
**************************************************************
* Note: Your /etc/profile was changed for this installation.
* changes will be reverted when you un-install the package.
**************************************************************