summaryrefslogtreecommitdiff
path: root/libre/parabola-wiki-lite
diff options
context:
space:
mode:
Diffstat (limited to 'libre/parabola-wiki-lite')
-rw-r--r--libre/parabola-wiki-lite/PKGBUILD44
-rw-r--r--libre/parabola-wiki-lite/libre.patch57
2 files changed, 101 insertions, 0 deletions
diff --git a/libre/parabola-wiki-lite/PKGBUILD b/libre/parabola-wiki-lite/PKGBUILD
new file mode 100644
index 000000000..8f6d5e534
--- /dev/null
+++ b/libre/parabola-wiki-lite/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+_pkgname=arch-wiki-lite
+pkgname=parabola-wiki-lite
+pkgver=20160606
+_codever=20160430
+pkgrel=2
+pkgdesc="The wiki without html. 1/9 as big, easily searched and viewable on console."
+arch=('any')
+url="http://kmkeen.com/arch-wiki-lite/"
+_watch="https://www.parabola.onu/packages/libre/any/parabola-wiki-docs/"
+license=('GPL' 'FDL')
+depends=('bash' 'gzip')
+makedepends=('python' 'parabola-wiki-docs')
+optdepends=('dialog: for interactive menu'
+ 'parabola-wiki-docs: for wiki-search-html'
+ 'xdg-utils: for wiki-search-html')
+replaces=('arch-wiki-lite')
+conflicts=('arch-wiki-lite')
+mksource=("http://kmkeen.com/$_pkgname/$_pkgname-$_codever.tar.gz"
+ 'libre.patch')
+source=("https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver.tar.gz")
+mkmd5sums=('827909e927c20303395d74c65e34f04e'
+ '1f039df2eae54ac2c5d56bb3d31c4ed9')
+md5sums=('d846ef6e76cf2f0b15ab539d00fed60b')
+
+mksource() {
+ cd "$srcdir/$_pkgname"
+ patch -p1 -i "$srcdir/libre.patch"
+ mv "$srcdir/$_pkgname" "$srcdir/$pkgname"
+}
+
+build() {
+ cd "$srcdir/$pkgname"
+ LC_ALL=en_US.UTF-8 python3 wiki_lite.py
+}
+
+package() {
+ cd "$srcdir/$pkgname"
+ install -d "$pkgdir/usr/share/doc/parabola-wiki/text/"
+ install -m 0644 wiki/* "$pkgdir/usr/share/doc/parabola-wiki/text/"
+ install -Dm 0755 wiki-search "$pkgdir/usr/bin/wiki-search"
+ install -Dm 0755 wiki-search-html "$pkgdir/usr/bin/wiki-search-html"
+ install -Dm 0644 wiki-search.dialog.rc "$pkgdir/etc/dialog.d/wiki-search.dialog.rc"
+}
diff --git a/libre/parabola-wiki-lite/libre.patch b/libre/parabola-wiki-lite/libre.patch
new file mode 100644
index 000000000..faf170514
--- /dev/null
+++ b/libre/parabola-wiki-lite/libre.patch
@@ -0,0 +1,57 @@
+--- arch-wiki-lite.orig/wiki_lite.py 2014-07-11 15:37:52.000000000 -0500
++++ arch-wiki-lite/wiki_lite.py 2016-06-06 08:00:56.369924650 -0500
+@@ -8,7 +8,7 @@
+ This should be using a real html parser,
+ but input is safe/known and there is a lot to parse.
+ """
+-wiki_path = '/usr/share/doc/arch-wiki/html/'
++wiki_path = '/usr/share/doc/parabola-wiki/html/'
+ dump_path = './wiki/'
+
+ # not a complete list, but does cover the current wiki
+@@ -143,7 +143,7 @@
+ os.makedirs(dump_path)
+ toc = generate_toc()
+ toc_file = open(dump_path + 'index', 'w')
+- txt_file = gzip.open(dump_path + 'arch-wiki.txt.gz', 'w')
++ txt_file = gzip.open(dump_path + 'parabola-wiki.txt.gz', 'w')
+ escape_regex = re.compile('&#x?[0-9A-Fa-f]+;')
+ for path in all_html_paths(wiki_path):
+ if path == 'index.html':
+--- arch-wiki-lite.orig/wiki-search 2016-04-30 10:44:25.000000000 -0500
++++ arch-wiki-lite/wiki-search 2016-06-06 08:05:30.488986591 -0500
+@@ -3,11 +3,11 @@
+ # todo, ewiki-search (extended regex)
+ # and/or multiword (matches + 1, product, divided by word count)
+
+-wiki_path="/usr/share/doc/arch-wiki/text"
++wiki_path="/usr/share/doc/parabola-wiki/text"
+ #wiki_path="./wiki"
+ dialogrc_path="/etc/dialog.d/wiki-search.dialog.rc"
+-html_path="/usr/share/doc/arch-wiki/html"
+-wikiball="$wiki_path/arch-wiki.txt.gz"
++html_path="/usr/share/doc/parabola-wiki/html"
++wikiball="$wiki_path/parabola-wiki.txt.gz"
+ tmp="/tmp/.wiki-search.${USER}.tmp"
+ COLOR1='\e[1;32m'
+ COLOR5='\e[1;34m'
+@@ -126,7 +126,7 @@
+ ;;
+ -h|--help|'')
+ echo "$(basename $0)"
+- echo "Search and view your local copy of the Arch wiki."
++ echo "Search and view your local copy of the Parabola wiki."
+ echo ""
+ echo "Search with '$(basename $0) [query]' where query is a regex"
+ echo "or a list of terms to match individually."
+--- arch-wiki-lite.orig/wiki-search-html 2016-04-30 10:20:28.000000000 -0500
++++ arch-wiki-lite/wiki-search-html 2016-06-06 08:06:29.153749809 -0500
+@@ -7,7 +7,7 @@
+ source $wikisearch --source
+
+ if [[ ! -d "$html_path" ]]; then
+- echo "pacman -S arch-wiki-docs"
++ echo "pacman -S parabola-wiki-docs"
+ exit 1
+ fi
+