diff --git a/.cvsignore b/.cvsignore index e69de29..de926c8 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +ifm-5.1.tar.gz diff --git a/ifm-5.1-destdir.patch b/ifm-5.1-destdir.patch new file mode 100644 index 0000000..7313e02 --- /dev/null +++ b/ifm-5.1-destdir.patch @@ -0,0 +1,44 @@ +--- ./doc/Makefile.in 2004-10-13 06:24:13.000000000 -0700 ++++ ./doc/Makefile.in.destdir 2005-09-04 17:53:59.000000000 -0700 +@@ -418,30 +418,28 @@ + install-doc: install-html install-pdf + + install-html: $(ifmdocdir) +- @ if test -d $(srcdir)/ifm; then \ ++ @ if test -d $(DESTDIR)$(srcdir)/ifm; then \ + set -x; \ +- rm -rf $(ifmdocdir)/html; \ +- cp -rf $(srcdir)/ifm $(ifmdocdir)/html; \ ++ rm -rf $(DESTDIR)$(ifmdocdir)/html; \ ++ cp -rf $(DESTDIR)$(srcdir)/ifm $(DESTDIR)$(ifmdocdir)/html; \ + fi + + install-pdf: $(ifmdocdir) +- @ if test -f $(srcdir)/ifm.pdf; then \ ++ @ if test -f $(DESTDIR)$(srcdir)/ifm.pdf; then \ + set -x; \ +- $(INSTALL_DATA) $(srcdir)/ifm.pdf $(ifmdocdir); \ ++ $(INSTALL_DATA) $(srcdir)/ifm.pdf $(DESTDIR)$(ifmdocdir); \ + fi + + $(ifmdocdir): +- - chmod u+w $(prefix) +- $(mkinstalldirs) $(docdir) +- - chmod u+w $(docdir) +- $(mkinstalldirs) $(ifmdocdir) ++ $(mkinstalldirs) $(DESTDIR)$(docdir) ++ $(mkinstalldirs) $(DESTDIR)$(ifmdocdir) + + dist-doc: $(EXTRA_DIST) +- if test -d $(srcdir)/ifm; then \ +- cp -rf $(srcdir)/ifm $(distdir); \ ++ if test -d $(DESTDIR)$(srcdir)/ifm; then \ ++ cp -rf $(DESTDIR)$(srcdir)/ifm $(DESTDIR)$(distdir); \ + fi +- if test -f $(srcdir)/ifm.pdf; then \ +- cp -r $(srcdir)/ifm.pdf $(distdir); \ ++ if test -f $(DESTDIR)$(srcdir)/ifm.pdf; then \ ++ cp -r $(DESTDIR)$(srcdir)/ifm.pdf $(DESTDIR)$(distdir); \ + fi + + clean-doc: realclean diff --git a/ifm.sh b/ifm.sh new file mode 100644 index 0000000..d9087d6 --- /dev/null +++ b/ifm.sh @@ -0,0 +1,6 @@ +# /etc/bash_completion.d/ifm.sh +# +# Bash completion support for ifm. + +complete -f -X '!*.@(ifm|IFM)' ifm +complete -f -X '!*.@(ifm|IFM)' tkifm diff --git a/ifm.spec b/ifm.spec new file mode 100644 index 0000000..a6c7049 --- /dev/null +++ b/ifm.spec @@ -0,0 +1,71 @@ +Name: ifm +Version: 5.1 +Release: 2%{?dist} +Summary: Interactive Fiction Mapper + +Group: Amusements/Games +License: GPL +URL: http://www.sentex.net/~dchapes/ifm/ +Source0: http://www.ifarchive.org/if-archive/mapping-tools/ifm-%{version}.tar.gz +Source1: ifm.vim +Source2: ifm.sh +Patch1: ifm-5.1-destdir.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: tk +BuildRequires: zlib-devel + +%description +IFM is a language and a program for keeping track of your progress through +an Interactive Fiction game. You can record each room you visit and its +relation to other rooms, the initial locations of useful items you find, and +the tasks you need to perform in order to solve the game. + + +%prep +%setup -q +%patch1 -p1 +cp -p %{SOURCE1} doc/. +cp -p %{SOURCE2} doc/. +sed -i -e 's,/usr/local/doc/ifm/html,%{_docdir}/%{name}-%{version}/ifm,' \ + -e 's,/usr/local/doc/ifm/ifm.pdf,%{_docdir}/%{name}-%{version}/ifm.pdf,' \ + doc/ifm.1 + + +%build +%configure +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +rm -rf $RPM_BUILD_ROOT/%{_prefix}/doc +rm -f demos/Makefile* +rm -f doc/ifm/WARNINGS doc/ifm/images.* doc/ifm/*.pl + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYING NEWS README THANKS +%doc demos/ +%doc doc/advent?.scr doc/advent.cmd doc/gfdl.lyx doc/ifm.pdf doc/macros.tex doc/tkifm.txt doc/*.ifm doc/ifm.vim doc/ifm.sh +%doc doc/ifm/ +%{_bindir}/* +%{_datadir}/ifm/ +%{_libdir}/ifm/ +%{_mandir}/man1/ifm.1* + + +%changelog +* Mon Sep 26 2005 Chris Grau 5.1-2 +- Added tk as a BR for the wish requirement in configure. +- Fixed paths in man page to point to proper documentation. +- Replaced instance of /usr with %%{_prefix}. + +* Sun Sep 4 2005 Chris Grau 5.1-1 +- Initial build. diff --git a/ifm.vim b/ifm.vim new file mode 100644 index 0000000..e2bcdde --- /dev/null +++ b/ifm.vim @@ -0,0 +1,171 @@ +" IFM syntax file +" Language: Interactive Fiction Mapper +" Maintainer: Dave Chapeskie +" $Id: ifm.vim,v 1.1 2005/10/04 21:17:50 cgrau Exp $ +" +" Note: This is my first attempt at doing vim syntax highlighting, +" if there is a better way of doing any of this please e-mail me. +" Note: This is for version 5.0 of IFM. +" TODO: handle using "$variable_name" where strings or numbers are expected +" TODO: handle "$variable_name" and "${variable_name}" within strings +" TODO: handle expressions + +" Remove any old syntax stuff hanging around +syntax clear + +" Catch keywords in the wrong spot +syntax keyword ifmError contained title map require room item task link join + +" IFM statements +" TODO: doesn't complain when there is something betweem the keyword and the +" string +" TODO: IFM2.0 and above supports changing existing objects by leaving out +" the string and using the tag, the tag doesn't get hightlighted using +" ifmId yet. +syntax region ifmTitleStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString +syntax region ifmMapStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString +syntax region ifmRequireStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmReal +syntax region ifmRoomStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString,ifmRoomOpt,ifmTagOpt,ifmDirFromOpt,ifmExitOpt,ifmScoreOpt,ifmGoOpt,ifmLengthOpt +syntax region ifmItemStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString,ifmItemOpt,ifmTagOpt,ifmInOpt,ifmScoreOpt +syntax region ifmTaskStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString,ifmTaskOpt,ifmTagOpt,ifmInOpt,ifmScoreOpt +syntax region ifmLinkStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString,ifmLinkOpt,ifmTagOpt,ifmDirOpt,ifmGoOpt,ifmLengthOpt +syntax region ifmJoinStatement end=";" matchgroup=ifmStatement start="\" contains=ifmError,ifmComment,ifmString,ifmJoinOpt,ifmTagOpt,ifmDirOpt,ifmGoOpt,ifmLengthOpt +syntax region ifmStyleStatement end=";" matchgroup=ifmStatement start="\" contains=ifmId,ifmComment +syntax region ifmEndStyleStatement end=";" matchgroup=ifmStatement start="\" contains=ifmId,ifmComment + +" GPP preprocessor statements +syntax region ifmIncludeStatement end="$" matchgroup=ifmStatement start="^%include\>" contains=ifmString,ifmComment +syntax region ifmDefineStatement end="$" matchgroup=ifmStatement start="^%define\>" contains=ifmId,ifmString,ifmComment +syntax region ifmDefevalStatement end="$" matchgroup=ifmStatement start="^%defeval\>" contains=ifmId,ifmString,ifmComment +syntax region ifmUndefStatement end="$" matchgroup=ifmStatement start="^%undef\>" contains=ifmId,ifmComment +syntax region ifmIfStatement end="$" matchgroup=ifmStatement start="^%if\>" contains=ifmString,ifmComment +syntax region ifmIfdefStatement end="$" matchgroup=ifmStatement start="^%ifdef\>" contains=ifmId,ifmComment +syntax region ifmIfndefStatement end="$" matchgroup=ifmStatement start="^%ifndef\>" contains=ifmId,ifmComment +syntax region ifmIfeqStatement end="$" matchgroup=ifmStatement start="^%ifeq\>" contains=ifmId,ifmComment +syntax region ifmIfneqStatement end="$" matchgroup=ifmStatement start="^%ifneq\>" contains=ifmId,ifmComment +syntax region ifmElseStatement end="$" matchgroup=ifmStatement start="^%else\>" contains=ifmComment +syntax region ifmEndifStatement end="$" matchgroup=ifmStatement start="^%endif\>" contains=ifmComment +syntax region ifmExecStatement end="$" matchgroup=ifmStatement start="^%exec\>" contains=ifmString,ifmComment +syntax region ifmEvalStatement end="$" matchgroup=ifmStatement start="^%eval\>" contains=ifmString,ifmComment +syntax region ifmModeStatement end="$" matchgroup=ifmStatement start="^%mode\>" contains=ifmGPPMode,ifmString,ifmComment +" TODO: highlight these pre-defined preprocessor macros +syntax keyword ifmMacro IFM_VERSION IFM_FORMAT + +syntax keyword ifmGPPMode contained push pop save restore standard user meta +syntax keyword ifmGPPMode contained quote comment nocomment string nostring +syntax keyword ifmGPPMode contained preservelf charset + +" Comments +syntax match ifmComment "#.*" contains=ifmTodo +syntax keyword ifmTodo contained TODO XXX + +" Arguments of options which we want highlighted +syntax keyword ifmGoDir contained out in up down +" TODO: ifmString doesn't handle "testStr\\" correctly... +syntax region ifmString contained start=+"+ skip=+\\"+ end=+"+ +syntax match ifmId contained "[a-zA-Z][a-zA-Z0-9_]*" +" TODO: IFM5.0 now accepts expressions whenever a number is expected +syntax match ifmInteger contained "[0-9]\+" +syntax match ifmReal contained "[0-9]\+\.[0-9]\+" + +" The options which the above arguments are part of +syntax region ifmTagOpt contained end="\<\S*\>" matchgroup=ifmKeyword start="\" contains=ifmId keepend +syntax region ifmScoreOpt contained end="\<[0-9]*\>" matchgroup=ifmKeyword start="\" contains=ifmInteger keepend +syntax region ifmLengthOpt contained end="\<[0-9]*\>" matchgroup=ifmKeyword start="\" contains=ifmInteger keepend +syntax region ifmGoOpt contained end="\<\S*\>" matchgroup=ifmKeyword start="\" contains=ifmGoDir keepend +syntax region ifmFromOpt contained end="\<\S*\>" matchgroup=ifmKeyword start="\" contains=ifmId keepend +syntax region ifmInOpt contained end="\<\S*\>" matchgroup=ifmKeyword start="\" contains=ifmId keepend + +syntax keyword ifmExitOpt contained exit skipwhite skipempty nextgroup=ifmExitDir +syntax keyword ifmExitDir contained nw n ne w e sw s se skipwhite skipempty nextgroup=ifmExitDir +syntax keyword ifmExitDir contained northwest north northeast west east southwest south southeast skipwhite skipempty nextgroup=ifmExitDir + +syntax keyword ifmDirFromOpt contained dir skipwhite skipempty nextgroup=ifmDirFrom +syntax keyword ifmDirFrom contained nw n ne w e sw s se skipwhite skipempty nextgroup=ifmDirFrom,ifmDirFromInt,ifmFromOpt +syntax keyword ifmDirFrom contained northwest north northeast west east southwest south southeast skipwhite skipempty nextgroup=ifmExitDir +syntax match ifmDirFromInt contained "[0-9]\+" skipwhite skipempty nextgroup=ifmDirFrom,ifmFromOpt + + +" Other options: +" These options take arguments but we don't hightlight them +" TODO: "in/after last" should have the word 'last' highlighted as a +" constant, similarily for tasks "in any" should have 'any' highlighted +" TODO: 'it' should be highlighted (e.g. task "xx" need xx drop it) +" TODO: IFM2.0 added things like "leave all except ID" which should be +" highlighted. +" TODO: 'cmd from' and 'cmd to' should be hightlighted instead of just 'cmd' +" TODO: IFM5.0 added "keep with/until ID [ID...]" for items; 'with'/'until' +" should be highlighted. +syntax keyword ifmRoomOpt contained link join note need after before leave cmd +syntax keyword ifmRoomOpt contained style +syntax keyword ifmItemOpt contained note need after before style +syntax keyword ifmTaskOpt contained cmd note need after follow do get give lose +syntax keyword ifmTaskOpt contained drop goto style +syntax keyword ifmLinkOpt contained to cmd need after before leave style +syntax keyword ifmJoinOpt contained to cmd need after before leave style +" These options don't have arguments +syntax keyword ifmRoomOpt contained start oneway finish nodrop nolink nopath +syntax keyword ifmItemOpt contained hidden keep ignore lost finish "given [obsolete] +syntax keyword ifmTaskOpt contained safe ignore finish +syntax keyword ifmLinkOpt contained oneway hidden nopath +syntax keyword ifmJoinOpt contained oneway hidden nopath + + +" IFM variable assignment +" [Format.]Ident = Integer|Real|String|"undef" ["in style" Id] ; +" TODO: handle "undef" keyword and "in style" clause +syntax region ifmEqInt contained end=";" matchgroup=ifmStatement start="=" contains=ifmInteger +syntax region ifmEqReal contained end=";" matchgroup=ifmStatement start="=" contains=ifmInteger,ifmReal +syntax region ifmEqString contained end=";" matchgroup=ifmStatement start="=" contains=ifmString + +syntax keyword ifmIntIdent item_text_fontsize link_dashed link_line_width link_spline link_text_fontsize map_text_fontsize page_rotate room_border_dashed room_border_width room_exit_width room_text_fontsize show_border show_page_border show_items show_tags show_title show_page_title title_fontsize page_title_fontsize map_title_fontsize fit_page show_map_title map_section_spacing show_map_border show_joins keep_unused_items all_tasks_safe solver_messages task_graph_rooms task_graph_orphans skipwhite skipempty nextgroup=ifmEqInt +syntax keyword ifmRealIdent canvas_height canvas_width font_scale link_arrow_size page_height page_margin page_width room_height room_shadow_xoff room_shadow_yoff room_size room_width map_canvas_width map_canvas_height skipwhite skipempty nextgroup=ifmEqReal +syntax keyword ifmStringIdent canvas_background_colour colour_file item_text_colour item_text_font item_text_fontdef link_colour link_inout_string link_text_colour link_text_font link_text_fontdef link_updown_string map_text_colour map_text_font page_background_colour page_border_colour page_size prolog_file room_border_colour room_colour room_exit_colour room_shadow_colour room_text_colour room_text_font room_text_fontdef title_colour page_title_colour map_title_colour title_font page_title_font map_title_font map_border_colour map_background_colour join_format task_graph_attr task_graph_node task_graph_link skipwhite skipempty nextgroup=ifmEqString + +syntax keyword ifmFormat ps tk text raw rec skipwhite skipempty nextgroup=ifmIntIdent,ifmRealIdent,ifmStringIdent + + +" Synchronization. +" Look backwards for a ';' but ignore any that occur in comments or +" strings. Stop after going back 250 lines without finding a ';' +syntax sync match ifmSyncRoutine grouphere NONE ";" +syntax sync match ifmNoSyncComment "#.*" +syntax sync region ifmNoSyncString start=+"+ skip=+\\"+ end=+"+ +syntax sync maxlines=250 + + +if !exists("did_ifm_syntax_inits") + let did_ifm_syntax_inits = 1 + " The default methods for highlighting. Can be overridden later + highlight link ifmStatement Statement + highlight link ifmRoomOpt ifmKeyword + highlight link ifmItemOpt ifmKeyword + highlight link ifmTaskOpt ifmKeyword + highlight link ifmLinkOpt ifmKeyword + highlight link ifmJoinOpt ifmKeyword + highlight link ifmExitOpt ifmKeyword + highlight link ifmDirFromOpt ifmKeyword + highlight link ifmFromOpt ifmKeyword + highlight link ifmGPPMode ifmKeyword + highlight link ifmKeyword Type + highlight link ifmGoDir Constant + highlight link ifmDirFromInt ifmDirFrom + highlight link ifmDirFrom Constant + highlight link ifmExitDir Constant + highlight link ifmInteger Number + highlight link ifmReal Number + highlight link ifmError Error + highlight link ifmString String + highlight link ifmComment Comment + highlight link ifmTodo Todo + highlight ifmId term=bold cterm=bold gui=bold + highlight link ifmFormat Type + highlight link ifmIntIdent ifmIdent + highlight link ifmRealIdent ifmIdent + highlight link ifmStringIdent ifmIdent + highlight link ifmIdent Identifier +endif + +let current_syntax = "ifm" + +" ifm: ts=8 diff --git a/sources b/sources index e69de29..7e3de10 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b6ed1f7ba02d27939cc6fab21c134c79 ifm-5.1.tar.gz