Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ee593cd63ecf84f9b7864a4a489644e0d970a973

commit ee593cd63ecf84f9b7864a4a489644e0d970a973
Author: Devil505 <[email protected]>
Date:   Fri Dec 30 13:35:38 2011 +0100

frugalware-wiki-docs-20111230-1-i686
* new package

diff --git a/source/docs-extra/frugalware-wiki-docs/FrugalBuild 
b/source/docs-extra/frugalware-wiki-docs/FrugalBuild
new file mode 100644
index 0000000..8df44e9
--- /dev/null
+++ b/source/docs-extra/frugalware-wiki-docs/FrugalBuild
@@ -0,0 +1,23 @@
+# Compiling Time: 0.05 SBU
+# Maintainer: Devil505 <[email protected]>
+
+pkgname=frugalware-wiki-docs
+pkgver=20111230
+pkgrel=1
+pkgdesc="Documentation from wiki.frugalware.org"
+url="http://www.frugalware.org/";
+depends=()
+makedepends=('perl-json-xs')
+options=('docs' '!strip')
+groups=('docs-extra')
+archs=('i686' 'x86_64')
+up2date=$pkgver
+source=(get.sh index.pl)
+sha1sums=('a1a546b1eef28ded2f9bece20ec467ed23a9fd00' \
+          'c3a8e1331a2ae825a2b1ac053bccadee322ab1d3')
+
+build() {
+  bash $Fsrcdir/get.sh $Fsrcdir $Fsrcdir/pages || Fdie
+  Fmkdir usr/share/doc/frugalware-wiki/html || Fdie
+  cp -r $Fsrcdir/pages/* $Fdestdir/usr/share/doc/frugalware-wiki/html/ || Fdie
+}
diff --git a/source/docs-extra/frugalware-wiki-docs/get.sh 
b/source/docs-extra/frugalware-wiki-docs/get.sh
new file mode 100644
index 0000000..6c9f81a
--- /dev/null
+++ b/source/docs-extra/frugalware-wiki-docs/get.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+TARGETDIR=$2
+
+mkdir -p $TARGETDIR
+
+cat >$TARGETDIR/index.html <<EOF
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+<HTML>
+       <HEAD>
+               <TITLE>FrugalWiki index</TITLE>
+               <META http-equiv="content-type" content="text/html; 
charset=utf-8"/>
+       </HEAD>
+       <BODY>
+EOF
+
+perl $1/index.pl https://wiki.frugalware.org | while read A; do
+    TITLE=`echo $A | cut -d \  -f 2- | tr ' ' '_'`
+    ID=`echo $A | cut -d \  -f 1`
+    echo "$ID => $TITLE"
+    echo "<P><A HREF='$ID.html'>$TITLE</A>" >>$TARGETDIR/index.html
+    [ -f "$TARGETDIR/$ID.html" ] || wget --no-check-certificate -q 
"https://wiki.frugalware.org/index.php?title=$TITLE&printable=yes"; -O 
"$TARGETDIR/$ID.html"
+done
+
+echo "</BODY></HTML>" >>$TARGETDIR/index.html
diff --git a/source/docs-extra/frugalware-wiki-docs/index.pl 
b/source/docs-extra/frugalware-wiki-docs/index.pl
new file mode 100644
index 0000000..3f954a6
--- /dev/null
+++ b/source/docs-extra/frugalware-wiki-docs/index.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+use Encode;
+use JSON::XS;
+
+$URL=$ARGV[0];
+
+@ALLPAGES=();
+
+my $pageid;
+my $pagetitle;
+my $from = "";
+my $ret;
+again:
+my $count = 0;
+$cmd="wget --no-check-certificate -q 
\"$URL/api.php?action=query&list=allpages&aplimit=500&format=json&apfilterredir=nonredirects&apfrom=$from\"
 -O -";
+#print STDERR $cmd."\n";
+$text=`$cmd`;
+$ret = JSON::XS->new->utf8->decode($text);
+$H = $ret->{query}->{allpages};
+foreach $i (@$H)
+{
+    push @ALLPAGES, encode("UTF-8", "$i->{title}");
+    printf("%08u %s", $i->{pageid}, encode("UTF-8", "$i->{title}\n"));
+    $count++;
+}
+
+if($count == 1)
+{
+    exit 0;
+}
+
+@ALLPAGES = sort @ALLPAGES;
+$from = $ALLPAGES[-1];
+goto again;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to