summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dewender2013-02-12 00:45:16 +0100
committerJohannes Dewender2013-02-12 00:45:16 +0100
commitfb8edefc1551aab609ea94984b3ed005ad30e085 (patch)
tree4db175e08e18aa4a479cafafd6940f868e1817f6
downloadaur-fb8edefc1551aab609ea94984b3ed005ad30e085.tar.gz
move all vimwiki packages to _vimwiki
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD50
-rw-r--r--convert-links.patchbin0 -> 3105 bytes
-rw-r--r--convert_links.py66
-rw-r--r--license.txt22
-rw-r--r--vimwiki.install24
7 files changed, 193 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..8f93cc63a06e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = vim-vimwiki
+ pkgdesc = Personal Wiki for Vim
+ pkgver = 2.0.1
+ pkgrel = 1
+ url = http://code.google.com/p/vimwiki/
+ install = vimwiki.install
+ arch = any
+ groups = vim-plugins
+ license = MIT
+ license = GPL3
+ depends = vim
+ depends = python2
+ source = http://vimwiki.googlecode.com/files/vimwiki-2-0-1.zip
+ source = license.txt
+ source = convert_links.py
+ source = convert-links.patch
+ md5sums = fd3ea1842270db87e0b8b966970fedc1
+ md5sums = e19fa0689d06a724fc8ddfe824ef2680
+ md5sums = 0fc0e816bb93e408b62f74e8b2073daa
+ md5sums = 97a75e0b9448cfb16720c7b923a74aa0
+
+pkgname = vim-vimwiki
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..bd9b4a41adc0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+*.tar.gz
+*.tar.xz
+*.tgz
+*.rpm
+*.zip
+*.bz2
+src/
+pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..38b9feb439ed
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Contributor: Johannes Dewender < arch at JonnyJD dot net >
+
+pkgname=vim-vimwiki
+pkgver=2.0.1
+pkgrel=1
+pkgdesc="Personal Wiki for Vim"
+arch=('any')
+url="http://code.google.com/p/vimwiki/"
+license=('MIT' 'GPL3')
+groups=('vim-plugins')
+depends=('vim' 'python2')
+install=vimwiki.install
+source=(http://vimwiki.googlecode.com/files/vimwiki-2-0-1.zip
+ license.txt
+ convert_links.py
+ convert-links.patch)
+md5sums=('fd3ea1842270db87e0b8b966970fedc1'
+ 'e19fa0689d06a724fc8ddfe824ef2680'
+ '0fc0e816bb93e408b62f74e8b2073daa'
+ '97a75e0b9448cfb16720c7b923a74aa0')
+
+build () {
+ cd "$srcdir"
+
+ # change symlink to file
+ mv convert_links.py convert_links.symlink
+ cp -L convert_links.symlink convert_links.py
+ rm convert_links.symlink
+ patch -p1 < convert-links.patch
+}
+
+package () {
+ cd "$srcdir"
+
+ install -d $pkgdir/usr/share/vim/vimfiles/autoload/vimwiki
+ install -Dm644 autoload/vimwiki/* \
+ ${pkgdir}/usr/share/vim/vimfiles/autoload/vimwiki/
+
+ install -d $pkgdir/usr/share/vim/vimfiles/{doc,ftplugin,plugin,syntax}
+ for x in {ftplugin,plugin,syntax}; do
+ install -Dm644 $x/* $pkgdir/usr/share/vim/vimfiles/$x/
+ done
+ install -Dm644 license.txt $pkgdir/usr/share/licenses/$pkgname/license.txt
+ install -Dm644 doc/vimwiki.txt $pkgdir/usr/share/vim/vimfiles/doc/
+
+ # install convert-links
+ install -D convert_links.py $pkgdir/usr/bin/vimwiki_convert_links
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/convert-links.patch b/convert-links.patch
new file mode 100644
index 000000000000..92588517738e
--- /dev/null
+++ b/convert-links.patch
Binary files differ
diff --git a/convert_links.py b/convert_links.py
new file mode 100644
index 000000000000..be4a4e08ef41
--- /dev/null
+++ b/convert_links.py
@@ -0,0 +1,66 @@
+''' Convert CamelCase links in a vimwiki to enclosing with double square
+bracket format. Errs on the safe side by only converting CamelCase words that
+have a corresponding file.
+
+Be very careful running this script. Make a backup of your wiki before running
+it. Run this on a copy of your wiki and then check you are happy with the
+conversions. Carefully check the files and links that will be converted.
+
+Usage:
+ python convert_links.py wiki_directory
+
+Bugs:
+* TODO CamelCase links already wrapped in [[ will have additional [[ added
+* All instances of filenames will be converted in some cases this might be incorrect
+
+License: GPL3
+Author: Julian Ryde
+
+'''
+
+import sys
+import os
+
+def is_camelcase(s):
+ # works quite well but Camelcase returns true
+ return (s != s.lower()) and (s != s.upper())
+
+
+wiki_ext = '.wiki'
+basedir = sys.argv[1] # base directory of the wiki
+#outputdir = sys.argv[2]
+
+# generate dictionary of file names
+
+wiki_files = os.listdir(basedir)
+
+# select .wiki files
+wiki_files = [wiki_file[:-5] for wiki_file in wiki_files if wiki_file.endswith(wiki_ext)]
+wiki_files.sort()
+# remove ones that are not CamelCase better to be safe and change minimally
+wiki_links = [wiki_file for wiki_file in wiki_files if is_camelcase(wiki_file)]
+
+print '\nWiki files to be altered in', basedir
+print wiki_files
+
+print '\nLinks to be converted within these files'
+print wiki_links
+
+res = raw_input("\nIf you are happy with these changes press enter to continue.")
+
+
+# turn into set for fast membership query
+wiki_links = set(wiki_links)
+
+
+# for each wiki file find all instances of members of wiki_files in the file
+# contents and replace
+for wiki_file in wiki_files:
+ fname = os.path.join(basedir, wiki_file + wiki_ext)
+ contents = open(fname).read()
+ # replace each wiki_link with the new form for this file
+ for wiki_link in wiki_links:
+ contents = contents.replace(wiki_link, '[[' + wiki_link + ']]')
+ # save modified contents
+ #print 'Saving', fname
+ open(fname, 'w').write(contents)
diff --git a/license.txt b/license.txt
new file mode 100644
index 000000000000..a2784c730add
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,22 @@
+The MIT Licence
+http://www.opensource.org/licenses/mit-license.php
+
+Copyright (c) 2009 Maxim Kim
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vimwiki.install b/vimwiki.install
new file mode 100644
index 000000000000..6796134f8094
--- /dev/null
+++ b/vimwiki.install
@@ -0,0 +1,24 @@
+post_install() {
+ echo -n "Updating vim help tags..."
+ /usr/bin/vim --noplugins -u NONE -U NONE \
+ --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q" > /dev/null 2>&1
+ echo "done."
+
+ echo "The link syntax change with vimwiki 2."
+ echo "CamelCase words are no longer considered links."
+ echo "If you want to make all of these links, please use"
+ echo " vimwiki_convert_links [wiki_directory]"
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install
+}
+
+op=$1
+shift
+
+$op $*