mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 04:13:08 +00:00
Redo installation file structure, move lots of things to $PREFIX/share/fish
darcs-hash:20060217101339-ac50b-d93d2c620a4b7f75f05ff461a6edbee001da7613.gz
This commit is contained in:
parent
95a01f3c8f
commit
343cafef34
196 changed files with 299 additions and 252 deletions
69
Makefile.in
69
Makefile.in
|
@ -48,13 +48,11 @@ datadir = @datadir@
|
|||
bindir = @bindir@
|
||||
mandir = @mandir@
|
||||
sysconfdir = @sysconfdir@
|
||||
fishdir = @fishdir@
|
||||
fishfile = @fishfile@
|
||||
fishinputfile = @fishinputfile@
|
||||
docdir = @docdir@
|
||||
|
||||
#Init files to install
|
||||
INIT_DIR_INSTALL = init/fish_interactive.fish init/fish_function.fish init/fish_complete.fish
|
||||
#etc files to install
|
||||
ETC_DIR_INSTALL = etc/fish_interactive.fish etc/fish_function.fish
|
||||
|
||||
# Set to 1 if we have gettext
|
||||
HAVE_GETTEXT=@HAVE_GETTEXT@
|
||||
|
@ -162,18 +160,20 @@ MAIN_DIR_FILES := Doxyfile Doxyfile.user Makefile.in configure \
|
|||
user_doc.head.html xsel-0.9.6.tar ChangeLog config.sub \
|
||||
config.guess fish_tests.c main.c fish_pager.c fishd.c seq.in
|
||||
|
||||
# Files in ./init/
|
||||
INIT_DIR_FILES :=init/fish.in init/fish_complete.fish.in \
|
||||
init/fish_function.fish init/fish_inputrc \
|
||||
init/fish_interactive.fish.in
|
||||
# Files in ./etc/
|
||||
ETC_DIR_FILES :=etc/fish.in etc/fish_function.fish etc/fish_inputrc \
|
||||
etc/fish_interactive.fish.in
|
||||
|
||||
# Files in ./share/
|
||||
SHARE_DIR_FILES :=share/fish
|
||||
|
||||
# Files in ./tests/
|
||||
TESTS_DIR_FILES := $(TEST_IN) $(TEST_IN:.in=.out) $(TEST_IN:.in=.err) \
|
||||
$(TEST_IN:.in=.status) tests/test.fish tests/gen_output.fish
|
||||
|
||||
COMPLETIONS_DIR_FILES := $(wildcard init/completions/*.fish)
|
||||
COMPLETIONS_DIR_FILES := $(wildcard share/completions/*.fish)
|
||||
|
||||
FUNCTIONS_DIR_FILES := $(wildcard init/functions/*.fish)
|
||||
FUNCTIONS_DIR_FILES := $(wildcard share/functions/*.fish)
|
||||
|
||||
# Programs to build
|
||||
PROGRAMS:=fish set_color @XSEL@ @SEQ_FALLBACK@ mimedb count fish_pager fishd
|
||||
|
@ -266,10 +266,10 @@ doc.h:$(BUILTIN_DOC_SRC) $(CMD_DOC_SRC) doc_src/doc.hdr
|
|||
fi
|
||||
|
||||
# Create a template translation object
|
||||
messages.pot: *.c *.h init/*.in init/*.fish init/completions/*.fish init/functions/*.fish seq
|
||||
messages.pot: *.c *.h etc/*.in etc/*.fish share/*.in share/completions/*.fish share/functions/*.fish seq
|
||||
if test $(HAVE_GETTEXT) = 1;then \
|
||||
xgettext -k_ -kN_ -kcomplete_desc *.c *.h -o messages.pot; \
|
||||
if ! xgettext -j -k_ -LShell init/*.in init/*.fish init/functions/*.fish init/completions/*.fish seq -o messages.pot; then \
|
||||
if ! xgettext -j -k_ -LShell etc/*.in etc/*.fish share/*.in share/completions/*.fish share/functions/*.fish seq -o messages.pot; then \
|
||||
echo "Your xgettext version is too old to build the messages.pot file"\
|
||||
rm messages.pot\
|
||||
false;\
|
||||
|
@ -348,20 +348,22 @@ install: all install-translations
|
|||
for i in $(PROGRAMS); do\
|
||||
$(INSTALL) -m 755 $$i $(DESTDIR)$(bindir) ; \
|
||||
done;
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)$(fishdir)
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)$(fishdir)/completions
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)$(fishdir)/functions
|
||||
$(INSTALL) -m 644 init/fish $(DESTDIR)$(sysconfdir)$(fishfile)
|
||||
for i in $(INIT_DIR_INSTALL); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(sysconfdir)$(fishdir); \
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish.d
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
|
||||
$(INSTALL) -m 644 etc/fish $(DESTDIR)$(sysconfdir)/fish
|
||||
$(INSTALL) -m 644 share/fish $(DESTDIR)$(datadir)/fish
|
||||
for i in $(ETC_DIR_INSTALL); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(sysconfdir)/fish.d; \
|
||||
done;
|
||||
for i in $(COMPLETIONS_DIR_FILES); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(sysconfdir)$(fishdir)/completions/; \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/completions/; \
|
||||
done;
|
||||
for i in $(FUNCTIONS_DIR_FILES); do \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(sysconfdir)$(fishdir)/functions/; \
|
||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(datadir)/fish/functions/; \
|
||||
done;
|
||||
$(INSTALL) -m 644 init/fish_inputrc $(DESTDIR)$(sysconfdir)$(fishinputfile);
|
||||
$(INSTALL) -m 644 etc/fish_inputrc $(DESTDIR)$(sysconfdir)/fish_inputrc;
|
||||
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
|
||||
for i in user_doc/html/* ChangeLog; do \
|
||||
if test -f $$i; then \
|
||||
|
@ -387,9 +389,10 @@ uninstall: uninstall-translations
|
|||
rm -f $(DESTDIR)$(bindir)/$$i; \
|
||||
done;
|
||||
rm -f $(DESTDIR)$(bindir)/xsel
|
||||
rm -f $(DESTDIR)$(sysconfdir)$(fishfile)
|
||||
rm -f $(DESTDIR)$(sysconfdir)$(fishinputfile)
|
||||
rm -r $(DESTDIR)$(sysconfdir)$(fishdir)
|
||||
rm -f $(DESTDIR)$(sysconfdir)/fish
|
||||
rm -f $(DESTDIR)$(sysconfdir)/fish_inputrc
|
||||
rm -r $(DESTDIR)$(sysconfdir)/fish.d
|
||||
rm -r $(DESTDIR)$(datadir)/fish
|
||||
rm -r $(DESTDIR)$(docdir)
|
||||
for i in fish.1* @XSEL_MAN@ mimedb.1* fishd.1* set_color.1* count.1*; do \
|
||||
rm $(DESTDIR)$(mandir)/man1/$$i; \
|
||||
|
@ -458,20 +461,22 @@ depend:
|
|||
#
|
||||
# Uses install instead of mkdir so build won't fail if the directory
|
||||
# exists
|
||||
fish-@PACKAGE_VERSION@.tar: $(DOC_SRC_DIR_FILES) $(MAIN_DIR_FILES) $(INIT_DIR_FILES) $(TEST_DIR_FILES) $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) ChangeLog
|
||||
fish-@PACKAGE_VERSION@.tar: $(DOC_SRC_DIR_FILES) $(MAIN_DIR_FILES) $(ETC_DIR_FILES) $(TEST_DIR_FILES) $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) ChangeLog
|
||||
rm -rf fish-@PACKAGE_VERSION@
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/doc_src
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/init
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/init/completions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/init/functions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/etc
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/completions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/share/functions
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/tests
|
||||
$(INSTALL) -d fish-@PACKAGE_VERSION@/po
|
||||
cp -f $(DOC_SRC_DIR_FILES) fish-@PACKAGE_VERSION@/doc_src
|
||||
cp -f $(MAIN_DIR_FILES) fish-@PACKAGE_VERSION@/
|
||||
cp -f $(INIT_DIR_FILES) fish-@PACKAGE_VERSION@/init/
|
||||
cp -f $(COMPLETIONS_DIR_FILES) fish-@PACKAGE_VERSION@/init/completions/
|
||||
cp -f $(FUNCTIONS_DIR_FILES) fish-@PACKAGE_VERSION@/init/functions/
|
||||
cp -f $(ETC_DIR_FILES) fish-@PACKAGE_VERSION@/etc/
|
||||
cp -f $(SHARE_DIR_FILES) fish-@PACKAGE_VERSION@/share/
|
||||
cp -f $(COMPLETIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/completions/
|
||||
cp -f $(FUNCTIONS_DIR_FILES) fish-@PACKAGE_VERSION@/share/functions/
|
||||
cp -f $(TESTS_DIR_FILES) fish-@PACKAGE_VERSION@/tests/
|
||||
cp -f $(TRANSLATIONS_SRC) fish-@PACKAGE_VERSION@/po/
|
||||
tar -c fish-@PACKAGE_VERSION@ >fish-@PACKAGE_VERSION@.tar
|
||||
|
@ -499,7 +504,7 @@ rpm: fish-@PACKAGE_VERSION@.tar.bz2
|
|||
|
||||
distclean: clean
|
||||
rm -f fish.spec doc_src/fish.1 doc_src/Doxyfile
|
||||
rm -f init/fish init/fish_interactive.fish init/fish_complete.fish
|
||||
rm -f etc/fish etc/fish_interactive.fish share/fish
|
||||
rm -f config.status config.log config.h Makefile
|
||||
.PHONY: distclean
|
||||
|
||||
|
|
|
@ -104,10 +104,6 @@ else
|
|||
AC_SUBST( PREFIX, [$prefix])
|
||||
fi
|
||||
|
||||
AC_SUBST(fishdir,[/fish.d])
|
||||
AC_SUBST(fishfile,[/fish])
|
||||
AC_SUBST(fishinputfile,[/fish_inputrc])
|
||||
|
||||
AC_ARG_VAR( [docdir], [Documentation direcotry] )
|
||||
|
||||
if test -z $docdir; then
|
||||
|
@ -116,7 +112,9 @@ fi
|
|||
|
||||
AC_DEFINE_UNQUOTED( DOCDIR, [L"$(eval echo $docdir)"], [Documentation directory] )
|
||||
AC_DEFINE_UNQUOTED( SYSCONFDIR, [L"$(eval echo $sysconfdir)"], [System configuration directory] )
|
||||
AC_DEFINE_UNQUOTED( DATADIR, [L"$(eval echo $datadir)"], [System configuration directory] )
|
||||
AC_SUBST( SYSCONFDIR, ["$(eval echo $sysconfdir)"] )
|
||||
AC_SUBST( DATADIR, ["$(eval echo $datadir)"] )
|
||||
|
||||
# Set up locale directory
|
||||
AC_DEFINE_UNQUOTED( [LOCALEDIR], "$(eval echo $datadir)/locale", [Locale directory])
|
||||
|
@ -235,7 +233,7 @@ fi
|
|||
# Check if we have ncurses, and use it rather than curses if possible.
|
||||
AC_SEARCH_LIBS( setupterm, [ncurses curses], [ AC_MSG_NOTICE([Found curses implementation])], [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
|
||||
|
||||
AC_CONFIG_FILES([Makefile fish.spec doc_src/fish.1 doc_src/Doxyfile init/fish init/fish_interactive.fish init/fish_complete.fish seq])
|
||||
AC_CONFIG_FILES([Makefile fish.spec doc_src/fish.1 doc_src/Doxyfile etc/fish etc/fish_interactive.fish seq])
|
||||
AC_OUTPUT
|
||||
|
||||
echo "Now run 'make' and 'make install' to built and install fish."
|
||||
|
|
|
@ -216,6 +216,42 @@ the <a href="builtins.html#fg">fg</a> command.
|
|||
To get a listing of all currently started jobs, use the <a
|
||||
href="builtins.html#jobs">jobs</a> command.
|
||||
|
||||
\subsection syntax-function Shellscript functions
|
||||
|
||||
Functions are used to group together commands and arguments
|
||||
using a single name. For example, the following is a function
|
||||
definition that calls the command 'ls -l' to print a detailed listing
|
||||
of the contents of the current directory:
|
||||
|
||||
<pre>
|
||||
function ll
|
||||
ls -l $argv
|
||||
end
|
||||
</pre>
|
||||
|
||||
The first line tells fish that a function by the name of ll is to be
|
||||
defined. To use it, simply write <code>ll</code> on the
|
||||
commandline. The second line tells fish that the command <code>ls -l
|
||||
$argv</code> should be called when ll is invoked. $argv is an array
|
||||
variable, which always contains all arguments sent to the function. In
|
||||
the example above, these are simply passed on to the ls command. For
|
||||
more information on functions, see the documentation for the <a
|
||||
href='builtin.html#function'>function builtin</a>.
|
||||
|
||||
Functions can be defined on the commandline or in a configuration
|
||||
file, but they can also be automatically loaded. Fish automatically
|
||||
searches through any directories in the array variable
|
||||
\$fish_function_path, and any functions defined are automatically
|
||||
loaded when needed. A function definition file must have a filename
|
||||
consisting of the name of the function and the suffix '.fish'.
|
||||
|
||||
The default value for \$fish_function_path is ~/.fish.d/functions,
|
||||
/etc/fish.d/functions /usr/share/fish/functions. The exact path to the
|
||||
last two of these may be slighly different depending on what install
|
||||
path prefix was chosen at configuration time. The rationale behind
|
||||
having three different directories is that the first one is for user
|
||||
specific functions, the second one is for system-wide additional
|
||||
functions and the last one is for default fish functions.
|
||||
|
||||
\subsection syntax-words Some common words
|
||||
|
||||
|
@ -313,17 +349,33 @@ href="builtins.html#complete">complete</a> builtin, or write 'complete
|
|||
--help' inside the \c fish shell.
|
||||
|
||||
For examples of how to write your own complex completions, study the
|
||||
completions in /etc/fish.d/completions (or ~/etc/fish.d/completions if
|
||||
you installed fish in your home directory).
|
||||
completions in /usr/share/fish/completions. (The exact path depends on
|
||||
your chosen installation prefix and may be slightly different)
|
||||
|
||||
If you wish to use a completion, you should consider adding it to your
|
||||
startup files. When completion has been requested for a command \c
|
||||
COMMAND, fish will automatically look for the file
|
||||
~/.fish.d/completions/COMMAND.fish. If it exists, it will be
|
||||
automatically loaded. If you have written new completions for a common
|
||||
\subsection completion-path Where to put completions
|
||||
|
||||
Completions can be defined on the commandline or in a configuration
|
||||
file, but they can also be automatically loaded. Fish automatically
|
||||
searches through any directories in the array variable
|
||||
\$fish_complete_path, and any completions defined are automatically
|
||||
loaded when needed. A completion file must have a filename consisting
|
||||
of the name of the command to complete and the suffix '.fish'.
|
||||
|
||||
The default value for \$fish_complete_path is ~/.fish.d/completions,
|
||||
/etc/fish.d/completions and /usr/share/fish/completions. The exact
|
||||
path to the last two of these may be slighly different depending on
|
||||
what install path prefix was chosen at configuration time. If a
|
||||
suitable file is found in one of these directories, it will be
|
||||
automatically loaded and the search will be stopped. The rationale
|
||||
behind having three different directories is that the first one is for
|
||||
user specific completions, the second one is for system-wide
|
||||
completions and the last one is for default fish completions.
|
||||
|
||||
If you have written new completions for a common
|
||||
Unix command, please consider sharing your work by sending it to <a
|
||||
href='mailto: fish-users@lists.sf.net'>the fish mailinglist</a>.
|
||||
|
||||
|
||||
\section expand Parameter expansion (Globbing)
|
||||
|
||||
When an argument for a program is given on the commandline, it
|
||||
|
@ -878,12 +930,15 @@ which the user can change <code>fish</code>'s behaviour.
|
|||
|
||||
\section initialization Initialization files
|
||||
|
||||
On startup, \c fish evaluates the file /etc/fish (Or ~/etc/fish if you
|
||||
installed fish in your home directory) and ~/.fish, in that order. If
|
||||
you want to run a command only on starting an interactive shell, use
|
||||
the exit status of the command 'status --is-interactive' to determine
|
||||
if the shell is interactive. If you want to run a command only when
|
||||
using a login shell, use 'status --is-login' instead.
|
||||
On startup, \c fish evaluates the files /usr/share/fish/fish,
|
||||
/etc/fish (Or ~/etc/fish if you installed fish in your home directory)
|
||||
and ~/.fish, in that order. The first file should not be directly
|
||||
edited, the second one is meant for systemwide configuration and the
|
||||
last one is meant for user configuration. If you want to run a command
|
||||
only on starting an interactive shell, use the exit status of the
|
||||
command 'status --is-interactive' to determine if the shell is
|
||||
interactive. If you want to run a command only when using a login
|
||||
shell, use 'status --is-login' instead.
|
||||
|
||||
Examples:
|
||||
|
||||
|
|
103
etc/fish
Normal file
103
etc/fish
Normal file
|
@ -0,0 +1,103 @@
|
|||
#
|
||||
# Init file for fish
|
||||
#
|
||||
# etc/fish. Generated from fish.in by configure.
|
||||
|
||||
#
|
||||
# Set default search paths
|
||||
#
|
||||
|
||||
set -g fish_function_path /usr/share/functions /etc/fish.d/functions ~/.fish.d/functions
|
||||
set -g fish_complete_path /usr/share/completions /etc/fish.d/completions ~/.fish.d/completions
|
||||
|
||||
#
|
||||
# Set default field separators
|
||||
#
|
||||
|
||||
set -g IFS \ \t\n
|
||||
|
||||
#
|
||||
# Add a few common directories to path, if they exists. Note that pure
|
||||
# console programs like makedep sometimes live in /usr/X11R6/bin, so we
|
||||
# want this even for text-only terminals.
|
||||
#
|
||||
|
||||
set -l path_list /bin /usr/bin /usr/X11R6/bin /usr/bin /sw/bin
|
||||
|
||||
# Root should also have the sbin directories in the path
|
||||
if test "$USER" = root
|
||||
set path_list $path_list /sbin /usr/sbin /usr/local/sbin
|
||||
end
|
||||
|
||||
for i in $path_list
|
||||
if not expr "$PATH" : .\*$i.\* >/dev/null
|
||||
if test -d $i
|
||||
set PATH $PATH $i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Set some value for LANG if nothing was set before, and this is a
|
||||
# login shell. Also check for i18n information in /etc/sysconfig/i18n
|
||||
#
|
||||
|
||||
if status --is-login
|
||||
if not set -q LANG >/dev/null
|
||||
set -gx LANG en_US.UTF-8
|
||||
end
|
||||
|
||||
if test -f /etc/sysconfig/i18n
|
||||
eval (cat /etc/sysconfig/i18n |sed -ne 's/^\([a-zA-Z]*\)=\(.*\)$/set -gx \1 \2;/p')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Put linux console in unicode mode. Should this be done in any other
|
||||
# situation as well?
|
||||
#
|
||||
|
||||
if expr "$LANG" : ".*[Uu][Tt][Ff]" >/dev/null
|
||||
if test linux = "$TERM"
|
||||
unicode_start ^/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# There are variables that contain colons that are not arrays. This
|
||||
# reverts them back to regular strings.
|
||||
#
|
||||
|
||||
for i in DISPLAY
|
||||
if set -q $i
|
||||
set -- $i (printf ":%s" $$i|cut -c 2-)
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Alias for gettext (or a fallback if gettext isn't installed) This
|
||||
# needs to be defined here and not in fish_function.fish, since it is
|
||||
# used by other init files.
|
||||
#
|
||||
|
||||
function _ -d "Alias for the gettext command"
|
||||
printf "%s" $argv
|
||||
end
|
||||
if test 1 = "1"
|
||||
if which gettext ^/dev/null >/dev/null
|
||||
function _ -d "Alias for the gettext command"
|
||||
gettext fish $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Load additional initialization files
|
||||
#
|
||||
|
||||
for i in fish.d/*.fish
|
||||
. $i
|
||||
end
|
|
@ -3,12 +3,18 @@
|
|||
#
|
||||
# @configure_input@
|
||||
|
||||
#
|
||||
# Set default search paths
|
||||
#
|
||||
|
||||
set -g fish_function_path ~/.fish.d/functions @SYSCONFDIR@/fish.d/functions @DATADIR@/functions
|
||||
set -g fish_complete_path ~/.fish.d/completions @SYSCONFDIR@/fish.d/completions @DATADIR@/completions
|
||||
|
||||
#
|
||||
# Set default field separators
|
||||
#
|
||||
|
||||
set -g IFS \ \t\n
|
||||
set -g fish_function_path $PWD/fish.d/functions ~/.fish.d/functions
|
||||
|
||||
#
|
||||
# Add a few common directories to path, if they exists. Note that pure
|
||||
|
@ -53,7 +59,7 @@ end
|
|||
# situation as well?
|
||||
#
|
||||
|
||||
if expr "$LANG" : ".*UTF" >/dev/null
|
||||
if expr "$LANG" : ".*[Uu][Tt][Ff]" >/dev/null
|
||||
if test linux = "$TERM"
|
||||
unicode_start ^/dev/null
|
||||
end
|
46
fish.spec.in
46
fish.spec.in
|
@ -13,40 +13,65 @@ Source0: http://roo.no-ip.org/%{name}/files/%{version}/%{name}-%{
|
|||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: doxygen ncurses-devel xorg-x11-devel
|
||||
|
||||
|
||||
|
||||
|
||||
%description
|
||||
fish is a shell geared towards interactive use. It's features are
|
||||
focused on user friendlieness and discoverability. The language syntax
|
||||
is simple but incompatible with other shell languages.
|
||||
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
|
||||
|
||||
|
||||
%build
|
||||
%configure docdir=%_datadir/doc/%{name}-%{version}
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR="$RPM_BUILD_ROOT"
|
||||
|
||||
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
|
||||
|
||||
%post
|
||||
if ! grep %_bindir/fish %_sysconfdir/shells >/dev/null; then
|
||||
echo %_bindir/fish >>%_sysconfdir/shells
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
%postun
|
||||
if [ "$1" = 0 ]; then
|
||||
grep -v %_bindir/fish %_sysconfdir/shells >%_sysconfdir/fish.tmp
|
||||
mv %_sysconfdir/fish.tmp %_sysconfdir/shells
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
|
||||
%doc %_datadir/doc/%{name}-%{version}
|
||||
|
||||
%_mandir/man1/fish.1*
|
||||
%_mandir/man1/xsel.1x*
|
||||
%_mandir/man1/mimedb.1*
|
||||
|
@ -54,6 +79,7 @@ fi
|
|||
%_mandir/man1/count.1*
|
||||
%_mandir/man1/fishd.1*
|
||||
%_mandir/man1/fish_pager.1*
|
||||
|
||||
%attr(0755,root,root) %_bindir/fish
|
||||
%attr(0755,root,root) %_bindir/fishd
|
||||
%attr(0755,root,root) %_bindir/fish_pager
|
||||
|
@ -61,16 +87,26 @@ fi
|
|||
%attr(0755,root,root) %_bindir/set_color
|
||||
%attr(0755,root,root) %_bindir/mimedb
|
||||
%attr(0755,root,root) %_bindir/count
|
||||
|
||||
%config %_sysconfdir/fish
|
||||
%config %_sysconfdir/fish_inputrc
|
||||
%dir %_sysconfdir/fish.d
|
||||
%config %_sysconfdir/fish.d/fish_*.fish
|
||||
%dir %_sysconfdir/fish.d/completions
|
||||
%config %_sysconfdir/fish.d/completions/*.fish
|
||||
%dir %_sysconfdir/fish.d/functions
|
||||
%config %_sysconfdir/fish.d/functions/*.fish
|
||||
|
||||
%dir %_datadir/fish
|
||||
%_datadir/fish/fish
|
||||
|
||||
%dir %_datadir/fish/completions
|
||||
%_datadir/fish/completions/*.fish
|
||||
|
||||
%dir %_datadir/fish/functions
|
||||
%_datadir/fish/functions/*.fish
|
||||
|
||||
%_datadir/locale/*/LC_MESSAGES/fish.mo
|
||||
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Nov 29 2005 Axel Liljencrantz <axel@liljencrantz.se> 1.17.0-0
|
||||
- 1.17.0
|
||||
|
|
|
@ -102,7 +102,7 @@ static void autoload_names( array_list_t *out, int get_hidden )
|
|||
suffix = wcsrchr( fn, L'.' );
|
||||
if( suffix && (wcscmp( suffix, L".fish" ) == 0 ) )
|
||||
{
|
||||
wchar_t *dup;
|
||||
const wchar_t *dup;
|
||||
*suffix = 0;
|
||||
dup = intern( fn );
|
||||
if( !dup )
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
|
||||
#
|
||||
# Print the current working directory in a shortened form. This
|
||||
# function is used by the default prompt command.
|
||||
#
|
||||
|
||||
function prevd-or-backward-word --key-binding
|
||||
if test -z (commandline)
|
||||
prevd
|
||||
else
|
||||
commandline -f backward-word
|
||||
end
|
||||
end
|
||||
|
||||
function nextd-or-forward-word --key-binding
|
||||
if test -z (commandline)
|
||||
nextd
|
||||
else
|
||||
commandline -f forward-word
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# This function deletes a character from the commandline if it is
|
||||
# non-empty, and exits the shell otherwise. Implementing this
|
||||
# functionality has been a longstanding request from various
|
||||
# fish-users.
|
||||
#
|
||||
|
||||
function delete-or-exit --key-binding
|
||||
if test (commandline)
|
||||
commandline -f delete-char
|
||||
else
|
||||
exit
|
||||
end
|
||||
end
|
||||
|
|
@ -1,154 +0,0 @@
|
|||
#
|
||||
# Initializations that should only be performed when in interactive mode
|
||||
#
|
||||
# @configure_input@
|
||||
|
||||
if not status --is-interactive
|
||||
exit
|
||||
end
|
||||
|
||||
#
|
||||
# Print a greeting
|
||||
#
|
||||
|
||||
printf (_ 'Welcome to fish, the friendly interactive shell\n')
|
||||
printf (_ 'Type %shelp%s for instructions on how to use fish\n') (set_color green) (set_color normal)
|
||||
|
||||
#
|
||||
# Set exit message
|
||||
#
|
||||
|
||||
function fish_on_exit -d (_ "Commands to execute when fish exits") --on-process %self
|
||||
printf (_ "Good bye\n")
|
||||
end
|
||||
|
||||
#
|
||||
# Set INPUTRC to something nice
|
||||
#
|
||||
# We override INPUTRC if already set, since it may be set by a shell
|
||||
# other than fish, which may use a different file. The new value should
|
||||
# be exported, since the fish inputrc file plays nice with other files
|
||||
# by including them when found.
|
||||
# Give priority to the default file installed with fish in
|
||||
# @SYSCONFDIR@/fish_inputrc.
|
||||
#
|
||||
|
||||
for i in ~/.fish_inputrc @SYSCONFDIR@/fish_inputrc ~/.inputrc /etc/inputrc
|
||||
if test -f $i
|
||||
set -xg INPUTRC $i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Set various color values
|
||||
#
|
||||
|
||||
function set_default -d "Set an exported universal variable, unless it has already been set"
|
||||
if not set -q $argv[1]
|
||||
set -Ux -- $argv
|
||||
end
|
||||
end
|
||||
|
||||
function set_exported_default -d "Set an exported universal variable, unless it has already been set"
|
||||
if not set -q $argv[1]
|
||||
set -Ux -- $argv
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Regular syntax highlighting colors
|
||||
set_default fish_color_normal normal
|
||||
set_default fish_color_command green
|
||||
set_default fish_color_redirection normal
|
||||
set_default fish_color_comment brown
|
||||
set_default fish_color_error red
|
||||
|
||||
set_default fish_color_cwd green
|
||||
|
||||
# Background color for matching quotes and parenthesis
|
||||
set_default fish_color_match cyan
|
||||
|
||||
# Background color for search matches
|
||||
set_default fish_color_search_match purple
|
||||
|
||||
# Pager colors
|
||||
set_default fish_pager_color_prefix cyan
|
||||
set_default fish_pager_color_completion normal
|
||||
set_default fish_pager_color_description normal
|
||||
set_default fish_pager_color_progress cyan
|
||||
|
||||
# Directory history colors
|
||||
set_default fish_color_history_current cyan
|
||||
|
||||
|
||||
#
|
||||
# Setup the CDPATH variable
|
||||
#
|
||||
|
||||
set_default CDPATH . ~
|
||||
|
||||
#
|
||||
# Match colors for grep, if supported
|
||||
#
|
||||
|
||||
if grep --color=auto --help 1>/dev/null 2>/dev/null
|
||||
set_exported_default GREP_COLOR '97;45'
|
||||
set_exported_default GREP_OPTIONS '--color=auto'
|
||||
end
|
||||
|
||||
#
|
||||
# Color definitions for ls, if supported
|
||||
#
|
||||
|
||||
if command ls --color=auto --help 1>/dev/null 2>/dev/null
|
||||
|
||||
set -l color_document 35
|
||||
set -l color_image '01;35'
|
||||
set -l color_sound '01;35'
|
||||
set -l color_video '01;35'
|
||||
set -l color_archive '01;31'
|
||||
set -l color_command '01;32'
|
||||
set -l color_backup 37
|
||||
|
||||
set -l default no=00 fi=00 'di=01;34' 'ln=01;36' 'pi=40;33' 'so=01;35' 'bd=40;33;01' 'cd=40;33;01' 'or=01;05;37;41' 'mi=01;05;37;41' ex=$color_command
|
||||
|
||||
for i in .cmd .exe .com .btm .bat .sh .csh .fish
|
||||
set default $default "*$i=$color_command"
|
||||
end
|
||||
|
||||
for i in .tar .tgz .arj .taz .lhz .zip .z .Z .gz .bz2 .bz .tz .rpm .cpio .jar .deb .rar .bin .hqx
|
||||
set default $default "*$i=$color_archive"
|
||||
end
|
||||
|
||||
for i in .jpg .jpeg .gif .bmp .xbm .xpm .png .tif
|
||||
set default $default "*$i=$color_image"
|
||||
end
|
||||
|
||||
for i in .mp3 .au .wav .aiff .ogg .wma
|
||||
set default $default "*$i=$color_sound"
|
||||
end
|
||||
|
||||
for i in .avi .mpeg .mpg .divx .mov .qt .wmv .rm
|
||||
set default $default "*$i=$color_video"
|
||||
end
|
||||
|
||||
for i in .htm .html .rtf .wpd .doc .pdf .ps .xls .swf .txt .tex .sxw .dvi INSTALL README ChangeLog
|
||||
set default $default "*$i=$color_document"
|
||||
end
|
||||
|
||||
for i in '~' .bak
|
||||
set default $default "*$i=$color_backup"
|
||||
end
|
||||
|
||||
set -gx LS_COLORS $default
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Remove temporary functions
|
||||
#
|
||||
|
||||
functions -e set_exported_default
|
||||
functions -e set_default
|
1
main.c
1
main.c
|
@ -75,6 +75,7 @@ static int read_init()
|
|||
|
||||
env_set( L"__fish_help_dir", DOCDIR, 0);
|
||||
|
||||
eval( L"builtin cd " DATADIR L" 2>/dev/null; . fish 2>/dev/null", 0, TOP );
|
||||
eval( L"builtin cd " SYSCONFDIR L" 2>/dev/null; . fish 2>/dev/null", 0, TOP );
|
||||
eval( L"builtin cd 2>/dev/null;. .fish 2>/dev/null", 0, TOP );
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue