aboutsummaryrefslogtreecommitdiff
path: root/examples/vim
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2013-04-17 14:08:01 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2013-04-17 14:08:01 +0400
commit207cd347945b53a1034d0ed8ad35037cf497e471 (patch)
tree455f399a5c405141b9c2fe500bcf9be05534d304 /examples/vim
parent62c2114fcab6cf9826089109633117494ace630e (diff)
downloadcibs-207cd347945b53a1034d0ed8ad35037cf497e471.tar.gz
Examples: vim & python
Diffstat (limited to 'examples/vim')
-rw-r--r--examples/vim/Makefile129
-rw-r--r--examples/vim/patches/vim-tiny.patch59
-rwxr-xr-xexamples/vim/vim-common.p5m.gen25
-rwxr-xr-xexamples/vim/vim-nox.p5m17
-rwxr-xr-xexamples/vim/vim-runtime.p5m.gen25
-rw-r--r--examples/vim/vim.license200
-rwxr-xr-xexamples/vim/vim.p5m17
-rw-r--r--examples/vim/vimrc56
8 files changed, 528 insertions, 0 deletions
diff --git a/examples/vim/Makefile b/examples/vim/Makefile
new file mode 100644
index 0000000..56ba8f2
--- /dev/null
+++ b/examples/vim/Makefile
@@ -0,0 +1,129 @@
+package ?= ips
+include /usr/share/cibs/rules/$(package).mk
+include /usr/share/cibs/rules/hg.mk
+bits = 64
+
+license := ViM
+license-file := vim.license
+
+hg-url := https://vim.googlecode.com/hg/
+download := $(hg-url)
+home := http://www.vim.org
+name := vim
+version := 7.3.905
+# hg update $(hg-update)
+hg-update := v$(subst .,-,$(version))
+
+build-depends += \
+ developer/build/autoconf \
+ developer/python \
+ library/tinfo
+
+
+pre-configure-stamp: autoconf-stamp
+autoconf-stamp: patch-stamp
+ cp $(sourcedir)/src/config.mk.dist $(sourcedir)/src/auto/config.mk
+ $(MAKE) -C $(sourcedir)/src autoconf
+ $(MAKE) -C $(sourcedir) distclean
+ touch $@
+
+$(eval $(call add-variant,basic))
+$(eval $(call add-variant,nox))
+$(eval $(call add-variant,tiny))
+
+# Clean protodir, because they do not exist, we do not use them,
+# and pkg requires them to exist
+pkg-protos := -d .
+
+configure-options := \
+ --prefix=/usr \
+ --mandir='$${prefix}'/share/man \
+ --without-local-dir \
+ --enable-fail-if-missing \
+
+configure-options.nox := $(configure-options) \
+ --without-x --enable-gui=no \
+ --enable-pythoninterp \
+
+configure-options.tiny := $(configure-options) \
+ --with-features=small \
+ --disable-gui \
+ --disable-xsmp \
+ --disable-xsmp-interact \
+ --disable-netbeans \
+ --enable-nls \
+ --enable-multibyte \
+ --enable-acl \
+
+configure-options.basic := $(configure-options.nox) \
+ --disable-luainterp \
+ --disable-mzschemeinterp \
+ --disable-perlinterp \
+ --disable-pythoninterp \
+ --disable-python3interp \
+ --disable-rubyinterp \
+ --disable-tclinterp \
+
+d_tmp := work/proto/tmp
+d_common := work/proto/vim-common
+d_runtime := work/proto/vim-runtime
+movefiles := /usr/share/cibs/scripts/movefiles
+
+# We are building in source dir, but within subdirs:
+configure-%-stamp: SHADOWDIR=vim-$*
+configure-%-stamp:
+ $(MAKE) -C $(sourcedir)/src shadow SHADOWDIR=$(SHADOWDIR)
+ cd $(sourcedir) && if test -f src/auto/config.cache; then make distclean; fi
+ cd $(sourcedir)/src/$(SHADOWDIR) && \
+ LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CC="$(CC)"\
+ ./configure $(configure-options.$*)
+ touch $@
+
+build-%-stamp: SHADOWDIR=vim-$*
+build-%-stamp:
+ $(MAKE) -C $(sourcedir)/src/$(SHADOWDIR)
+ touch $@
+
+install-basic-stamp:
+ $(MAKE) -C $(sourcedir)/src/vim-basic DESTDIR=$(topdir)/$(d_tmp) \
+ installvimbin \
+ installtutorbin \
+ installgtutorbin \
+ installruntime \
+ installtools \
+ install-icons \
+ install-languages
+ rm -f $(protodir)/usr/bin/vim
+ touch $@
+
+install-nox-stamp install-tiny-stamp:
+ touch $@
+
+post-install-stamp: vim-common-stamp vim-runtime-stamp
+vim-common-stamp: install-stamp
+ mkdir -p $(d_common)
+ $(movefiles) -s $(d_tmp) -d $(d_common) \
+ usr/bin/xxd \
+ usr/share/man/man1/xxd.1 \
+ usr/share/man/man1/vimdiff.1 \
+ usr/share/man/man1/vim.1
+ mkdir -p $(d_common)/etc/vim
+ mkdir -p $(d_common)/usr/share/vim
+ mkdir -p $(d_common)/var/lib/vim/addons
+ cp vimrc $(d_common)/etc/vim/vimrc
+ ln -sf ../../../etc/vim $(d_common)/usr/share/vim/vimfiles
+ ln -sf ../../../etc/vim/vimrc $(d_common)/usr/share/vim/vimrc
+ ln -sf vim73 $(d_common)/usr/share/vim/vimcurrent
+ ln -sf vim.1 $(d_common)/usr/share/man/man1/rvim.1
+ ln -sf vim.1 $(d_common)/usr/share/man/man1/rview.1
+ touch $@
+
+vim-runtime-stamp: install-stamp
+ mkdir -p $(d_runtime)
+ $(movefiles) -s $(d_tmp) -d $(d_runtime) \
+ usr/bin/vimtutor \
+ usr/share/man/man1/vimtutor.1 \
+ usr/share/vim
+ touch $@
+
+
diff --git a/examples/vim/patches/vim-tiny.patch b/examples/vim/patches/vim-tiny.patch
new file mode 100644
index 0000000..2892598
--- /dev/null
+++ b/examples/vim/patches/vim-tiny.patch
@@ -0,0 +1,59 @@
+Subject: Support sourcing a vimrc.tiny when Vim is invoked as vi
+ This is used only in the vim-tiny package to allow a specific
+ configuration for vim-tiny's vi. The vim-tiny package is substantially
+ different from the other Vim packages, so it did not make sense to
+ share the same config.
+Forwarded: not-needed
+Author: Stefano Zacchiroli <zack@debian.org>
+Author: James Vega <jamessan@debian.org>
+Bug-Debian: http://bugs.debian.org/222138
+
+--- a/src/main.c
++++ b/src/main.c
+@@ -83,6 +83,9 @@
+ #ifdef FEAT_DIFF
+ int diff_mode; /* start with 'diff' set */
+ #endif
++#ifdef SYS_TINYRC_FILE
++ int vi_mode; /* started as "vi" */
++#endif
+ } mparm_T;
+
+ /* Values for edit_type. */
+@@ -1606,6 +1609,10 @@
+ }
+ else if (STRNICMP(initstr, "vim", 3) == 0)
+ initstr += 3;
++#ifdef SYS_TINYRC_FILE
++ else if (STRNICMP(initstr, "vi", 2) == 0)
++ parmp->vi_mode = TRUE;
++#endif
+
+ /* Catch "[r][g]vimdiff" and "[r][g]viewdiff". */
+ if (STRICMP(initstr, "diff") == 0)
+@@ -2916,7 +2923,12 @@
+ * Get system wide defaults, if the file name is defined.
+ */
+ #ifdef SYS_VIMRC_FILE
+- (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
++# if defined(SYS_TINYRC_FILE) && defined(TINY_VIMRC)
++ if (parmp->vi_mode)
++ (void)do_source((char_u *)SYS_TINYRC_FILE, FALSE, DOSO_NONE);
++ else
++# endif
++ (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
+ #endif
+ #ifdef MACOS_X
+ (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE);
+--- a/src/os_unix.h
++++ b/src/os_unix.h
+@@ -233,6 +233,9 @@
+ /*
+ * Unix system-dependent file names
+ */
++#ifndef SYS_TINYRC_FILE
++# define SYS_TINYRC_FILE "$VIM/vimrc.tiny"
++#endif
+ #ifndef SYS_VIMRC_FILE
+ # define SYS_VIMRC_FILE "$VIM/vimrc"
+ #endif
diff --git a/examples/vim/vim-common.p5m.gen b/examples/vim/vim-common.p5m.gen
new file mode 100755
index 0000000..8fa78f3
--- /dev/null
+++ b/examples/vim/vim-common.p5m.gen
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+set -u
+
+pkg=vim-common
+
+tmp=/tmp/cibs-$pkg.$$
+
+proto=${proto:-work/proto/$pkg}
+
+cat <<'META' > $tmp
+set name=pkg.fmri value=pkg:/editor/vim-common@$(ips-version)
+set name=pkg.summary value="Vi IMproved - Common files"
+set name=info.upstream-url value="$(home)"
+set name=info.source-url value="$(download)"
+
+license $(license-file) license="$(license)"
+
+META
+
+/usr/share/cibs/scripts/make-payload $proto >> $tmp
+cat $tmp
+rm $tmp
+
diff --git a/examples/vim/vim-nox.p5m b/examples/vim/vim-nox.p5m
new file mode 100755
index 0000000..dec8dcb
--- /dev/null
+++ b/examples/vim/vim-nox.p5m
@@ -0,0 +1,17 @@
+set name=pkg.fmri value=pkg:/editor/vim-nox@$(ips-version)
+set name=pkg.summary value="Vi IMproved - enhanced vi editor - with scripting languages support"
+set name=info.upstream-url value="$(home)"
+set name=info.source-url value="$(download)"
+
+license $(license-file) license="$(license)"
+
+depend fmri=editor/vim-runtime@$(ips-version) type=require
+depend fmri=editor/vim-runtime@$(ips-version) type=incorporate
+
+depend fmri=editor/vim-common@$(ips-version) type=require
+depend fmri=editor/vim-common@$(ips-version) type=incorporate
+
+file work/source/src/vim-nox/vim path=usr/bin/vim.nox
+
+link path=usr/bin/vim target=vim.nox \
+ mediator=vim mediator-implementation=vim-nox
diff --git a/examples/vim/vim-runtime.p5m.gen b/examples/vim/vim-runtime.p5m.gen
new file mode 100755
index 0000000..7d51066
--- /dev/null
+++ b/examples/vim/vim-runtime.p5m.gen
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+set -u
+
+pkg=vim-runtime
+
+tmp=/tmp/cibs-$pkg.$$
+
+proto=${proto:-work/proto/$pkg}
+
+cat <<'META' > $tmp
+set name=pkg.fmri value=pkg:/editor/vim-runtime@$(ips-version)
+set name=pkg.summary value="Vi IMproved - Runtime files"
+set name=info.upstream-url value="$(home)"
+set name=info.source-url value="$(download)"
+
+license $(license-file) license="$(license)"
+
+META
+
+/usr/share/cibs/scripts/make-payload $proto >> $tmp
+cat $tmp
+rm $tmp
+
diff --git a/examples/vim/vim.license b/examples/vim/vim.license
new file mode 100644
index 0000000..9c4d006
--- /dev/null
+++ b/examples/vim/vim.license
@@ -0,0 +1,200 @@
+I) There are no restrictions on distributing unmodified copies of Vim except
+ that they must include this license text. You can also distribute
+ unmodified parts of Vim, likewise unrestricted except that they must
+ include this license text. You are also allowed to include executables
+ that you made from the unmodified Vim sources, plus your own usage
+ examples and Vim scripts.
+
+II) It is allowed to distribute a modified (or extended) version of Vim,
+ including executables and/or source code, when the following four
+ conditions are met:
+ 1) This license text must be included unmodified.
+ 2) The modified Vim must be distributed in one of the following five ways:
+ a) If you make changes to Vim yourself, you must clearly describe in
+ the distribution how to contact you. When the maintainer asks you
+ (in any way) for a copy of the modified Vim you distributed, you
+ must make your changes, including source code, available to the
+ maintainer without fee. The maintainer reserves the right to
+ include your changes in the official version of Vim. What the
+ maintainer will do with your changes and under what license they
+ will be distributed is negotiable. If there has been no negotiation
+ then this license, or a later version, also applies to your changes.
+ The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
+ changes it will be announced in appropriate places (most likely
+ vim.sf.net, www.vim.org and/or comp.editors). When it is completely
+ impossible to contact the maintainer, the obligation to send him
+ your changes ceases. Once the maintainer has confirmed that he has
+ received your changes they will not have to be sent again.
+ b) If you have received a modified Vim that was distributed as
+ mentioned under a) you are allowed to further distribute it
+ unmodified, as mentioned at I). If you make additional changes the
+ text under a) applies to those changes.
+ c) Provide all the changes, including source code, with every copy of
+ the modified Vim you distribute. This may be done in the form of a
+ context diff. You can choose what license to use for new code you
+ add. The changes and their license must not restrict others from
+ making their own changes to the official version of Vim.
+ d) When you have a modified Vim which includes changes as mentioned
+ under c), you can distribute it without the source code for the
+ changes if the following three conditions are met:
+ - The license that applies to the changes permits you to distribute
+ the changes to the Vim maintainer without fee or restriction, and
+ permits the Vim maintainer to include the changes in the official
+ version of Vim without fee or restriction.
+ - You keep the changes for at least three years after last
+ distributing the corresponding modified Vim. When the maintainer
+ or someone who you distributed the modified Vim to asks you (in
+ any way) for the changes within this period, you must make them
+ available to him.
+ - You clearly describe in the distribution how to contact you. This
+ contact information must remain valid for at least three years
+ after last distributing the corresponding modified Vim, or as long
+ as possible.
+ e) When the GNU General Public License (GPL) applies to the changes,
+ you can distribute the modified Vim under the GNU GPL version 2 or
+ any later version.
+ 3) A message must be added, at least in the output of the ":version"
+ command and in the intro screen, such that the user of the modified Vim
+ is able to see that it was modified. When distributing as mentioned
+ under 2)e) adding the message is only required for as far as this does
+ not conflict with the license used for the changes.
+ 4) The contact information as required under 2)a) and 2)d) must not be
+ removed or changed, except that the person himself can make
+ corrections.
+
+III) If you distribute a modified version of Vim, you are encouraged to use
+ the Vim license for your changes and make them available to the
+ maintainer, including the source code. The preferred way to do this is
+ by e-mail or by uploading the files to a server and e-mailing the URL.
+ If the number of changes is small (e.g., a modified Makefile) e-mailing a
+ context diff will do. The e-mail address to be used is
+ <maintainer@vim.org>
+
+IV) It is not allowed to remove this license from the distribution of the Vim
+ sources, parts of it or from a modified version. You may use this
+ license for previous Vim releases instead of the license that they came
+ with, at your option.
+
+On Debian systems the GNU General Public License (GPL) version 2 is located on
+the filesystem at /usr/share/common-licenses/GPL-2.
+
+The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
+Moolenaar and are distributed under the Open Publication License, v1.0 or later
+(no license options are exercised):
+
+
+Open Publication License
+v1.0, 8 June 1999
+
+
+I. REQUIREMENTS ON BOTH UNMODIFIED AND MODIFIED VERSIONS
+
+The Open Publication works may be reproduced and distributed in whole or in
+part, in any medium physical or electronic, provided that the terms of this
+license are adhered to, and that this license or an incorporation of it by
+reference (with any options elected by the author(s) and/or publisher) is
+displayed in the reproduction.
+
+Proper form for an incorporation by reference is as follows:
+
+ Copyright (c) <year> by <author's name or designee>. This material may be
+ distributed only subject to the terms and conditions set forth in the Open
+ Publication License, vX.Y or later (the latest version is presently
+ available at http://www.opencontent.org/openpub/).
+
+The reference must be immediately followed with any options elected by the
+author(s) and/or publisher of the document (see section VI).
+
+Commercial redistribution of Open Publication-licensed material is permitted.
+
+Any publication in standard (paper) book form shall require the citation of the
+original publisher and author. The publisher and author's names shall appear on
+all outer surfaces of the book. On all outer surfaces of the book the original
+publisher's name shall be as large as the title of the work and cited as
+possessive with respect to the title.
+
+
+II. COPYRIGHT
+
+The copyright to each Open Publication is owned by its author(s) or designee.
+
+
+III. SCOPE OF LICENSE
+
+The following license terms apply to all Open Publication works, unless
+otherwise explicitly stated in the document.
+
+Mere aggregation of Open Publication works or a portion of an Open Publication
+work with other works or programs on the same media shall not cause this
+license to apply to those other works. The aggregate work shall contain a
+notice specifying the inclusion of the Open Publication material and
+appropriate copyright notice.
+
+SEVERABILITY. If any part of this license is found to be unenforceable in any
+jurisdiction, the remaining portions of the license remain in force.
+
+NO WARRANTY. Open Publication works are licensed and provided "as is" without
+warranty of any kind, express or implied, including, but not limited to, the
+implied warranties of merchantability and fitness for a particular purpose or a
+warranty of non-infringement.
+
+
+IV. REQUIREMENTS ON MODIFIED WORKS
+
+All modified versions of documents covered by this license, including
+translations, anthologies, compilations and partial documents, must meet the
+following requirements:
+
+ 1. The modified version must be labeled as such.
+ 2. The person making the modifications must be identified and the
+ modifications dated.
+ 3. Acknowledgement of the original author and publisher if applicable must
+ be retained according to normal academic citation practices.
+ 4. The location of the original unmodified document must be identified.
+ 5. The original author's (or authors') name(s) may not be used to assert or
+ imply endorsement of the resulting document without the original author's
+ (or authors') permission.
+
+
+V. GOOD-PRACTICE RECOMMENDATIONS
+
+In addition to the requirements of this license, it is requested from and
+strongly recommended of redistributors that:
+
+ 1. If you are distributing Open Publication works on hardcopy or CD-ROM, you
+ provide email notification to the authors of your intent to redistribute
+ at least thirty days before your manuscript or media freeze, to give the
+ authors time to provide updated documents. This notification should
+ describe modifications, if any, made to the document.
+ 2. All substantive modifications (including deletions) be either clearly
+ marked up in the document or else described in an attachment to the
+ document.
+ 3. Finally, while it is not mandatory under this license, it is considered
+ good form to offer a free copy of any hardcopy and CD-ROM expression of
+ an Open Publication-licensed work to its author(s).
+
+
+VI. LICENSE OPTIONS
+
+The author(s) and/or publisher of an Open Publication-licensed document may
+elect certain options by appending language to the reference to or copy of the
+license. These options are considered part of the license instance and must be
+included with the license (or its incorporation by reference) in derived works.
+
+A. To prohibit distribution of substantively modified versions without the
+explicit permission of the author(s). "Substantive modification" is defined as
+a change to the semantic content of the document, and excludes mere changes in
+format or typographical corrections.
+
+To accomplish this, add the phrase `Distribution of substantively modified
+versions of this document is prohibited without the explicit permission of the
+copyright holder.' to the license reference or copy.
+
+B. To prohibit any publication of this work or derivative works in whole or in
+part in standard (paper) book form for commercial purposes is prohibited unless
+prior permission is obtained from the copyright holder.
+
+To accomplish this, add the phrase 'Distribution of the work or derivative of
+the work in any standard (paper) book form is prohibited unless prior
+permission is obtained from the copyright holder.' to the license reference or
+copy.
diff --git a/examples/vim/vim.p5m b/examples/vim/vim.p5m
new file mode 100755
index 0000000..7408f81
--- /dev/null
+++ b/examples/vim/vim.p5m
@@ -0,0 +1,17 @@
+set name=pkg.fmri value=pkg:/editor/vim@$(ips-version)
+set name=pkg.summary value="Vi IMproved - enhanced vi editor"
+set name=info.upstream-url value="$(home)"
+set name=info.source-url value="$(download)"
+
+license $(license-file) license="$(license)"
+
+depend fmri=editor/vim-runtime@$(ips-version) type=require
+depend fmri=editor/vim-runtime@$(ips-version) type=incorporate
+
+depend fmri=editor/vim-common@$(ips-version) type=require
+depend fmri=editor/vim-common@$(ips-version) type=incorporate
+
+file work/source/src/vim-basic/vim path=usr/bin/vim.basic
+
+link path=usr/bin/vim target=vim.basic \
+ mediator=vim mediator-implementation=vim-basic
diff --git a/examples/vim/vimrc b/examples/vim/vimrc
new file mode 100644
index 0000000..1381979
--- /dev/null
+++ b/examples/vim/vimrc
@@ -0,0 +1,56 @@
+
+set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vimcurrent,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
+
+" Set paper size from /etc/papersize if available (Debian-specific)
+if filereadable("/etc/papersize")
+ let s:papersize = matchstr(readfile('/etc/papersize', '', 1), '\p*')
+ if strlen(s:papersize)
+ exe "set printoptions+=paper:" . s:papersize
+ endif
+endif
+
+if has('gui_running')
+ " Make shift-insert work like in Xterm
+ map <S-Insert> <MiddleMouse>
+ map! <S-Insert> <MiddleMouse>
+endif
+
+" remove change the following statements
+set nocompatible " Use Vim defaults instead of 100% vi compatibility
+set backspace=indent,eol,start " more powerful backspacing
+
+" Now we set some defaults for the editor
+set history=50 " keep 50 lines of command line history
+set ruler " show the cursor position all the time
+
+" modelines have historically been a source of security/resource
+" vulnerabilities -- disable by default, even when 'nocompatible' is set
+set nomodeline
+
+" Suffixes that get lower priority when doing tab completion for filenames.
+" These are files we are not likely to want to edit or read.
+set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
+
+" We know xterm-debian is a color terminal
+if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
+ set t_Co=16
+ set t_Sfet t_Sb=
+endif
+
+syntax enable
+colorscheme desert
+set ai
+set expandtab
+set hlsearch
+set incsearch
+set laststatus=2
+set linebreak
+set mouse=a
+set number
+set pastetoggle=<F5>
+set showcmd
+set sm
+set statusline=%F\ [%Y,\ %{&ff}]\ %=\ %l:%c\ (%p%%)\ \|\ %{strftime(\"%Y-%m-%d,\ %H:%M\")}
+set sw=4
+set tabstop=4
+set wrap