# HG changeset patch # User Aleksej Bobylev # Date 1413925880 -10800 # Node ID 4466c09bba166dc3399d18b5907291c08829163c # Parent 5d1b0ab9a2997e8c372c34369cf0b53acc334a23 Add manserver. diff -r 5d1b0ab9a299 -r 4466c09bba16 manserver/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/receipt Wed Oct 22 00:11:20 2014 +0300 @@ -0,0 +1,26 @@ +# SliTaz package receipt. + +PACKAGE="manserver" +VERSION="1.08" +CATEGORY="development" +SHORT_DESC="Man to HTML converter which can act as an HTTP server on port 8888" +MAINTAINER="al.bobylev@gmail.com" +LICENSE="custom" +WEB_SITE="http://www.squarebox.co.uk/users/rolf/download/manServer.shtml" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WGET_URL="http://www.squarebox.co.uk/download/$TARBALL" + +DEPENDS="perl" #also can use busybox to extract gz, bz2 or xz man pages + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin $fs/usr/share/licenses $fs/usr/share/man/man1 $fs/etc/init.d + cd $src; patch -p0 -i $stuff/manserver-1.08-add-xz.patch + install -Dm755 $src/manServer.pl $fs/usr/bin/manServer + install -Dm755 $stuff/manserver $fs/usr/bin/manserver + install -Dm644 $src/LICENSE $fs/usr/share/licenses/manserver.txt + install -Dm644 $src/manServer.1 $fs/usr/share/man/man1 + install -Dm644 $stuff/manpath.config $fs/etc/manpath.config + ln -s daemon $fs/etc/init.d/manserver +} diff -r 5d1b0ab9a299 -r 4466c09bba16 manserver/stuff/manpath.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/manpath.config Wed Oct 22 00:11:20 2014 +0300 @@ -0,0 +1,3 @@ +MANDB_MAP /usr/man +MANDB_MAP /usr/share/man +MANDB_MAP /usr/share/man/ru diff -r 5d1b0ab9a299 -r 4466c09bba16 manserver/stuff/manserver --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/manserver Wed Oct 22 00:11:20 2014 +0300 @@ -0,0 +1,2 @@ +#!/bin/sh +nohup /usr/bin/manServer -s >/dev/null 2>&1 & >/dev/null 2>&1 diff -r 5d1b0ab9a299 -r 4466c09bba16 manserver/stuff/manserver-1.08-add-xz.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/manserver-1.08-add-xz.patch Wed Oct 22 00:11:20 2014 +0300 @@ -0,0 +1,87 @@ +--- manServer.pl.orig ++++ manServer.pl +@@ -175,7 +175,7 @@ + listDir($request); + $processed = 1; + } +- elsif (-f $request || -f "$request.gz" || -f "$request.bz2") ++ elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz") + { + # Only allow fully specified files if they're in our manpath + foreach $md (@manpath) +@@ -270,7 +270,7 @@ + foreach $f (@files) + { + next if ($f eq "." || $f eq ".." || $f !~ m/\./); +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + # ($name) = ($f =~ m,/([^/]*)$,); + print OUT "$f \n"; + } +@@ -322,6 +322,13 @@ + $srcfile =~ m/^(.*)$/; + $srcfile = $1; # untaint + } ++ elsif (-f "$file.xz") ++ { ++ $zfile = "$file.xz"; ++ $srcfile = "/usr/bin/xzcat $zfile |"; ++ $srcfile =~ m/^(.*)$/; ++ $srcfile = $1; # untaint ++ } + } + print LOG "man2html $file\n"; + $foundNroffTag = 0; +@@ -2823,7 +2830,7 @@ + @multipleMatches = (); + + $file = $_[0]; +- return $file if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + + # Search the path for the requested man page, which may be of the form: + # "/usr/man/man1/ls.1", "ls.1" or "ls". +@@ -2837,7 +2844,7 @@ + { + $dir = $md; + $file = "$dir/man$sect/$page.$sect"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + } + } + else +@@ -2855,13 +2862,13 @@ + { + ($s) = ($dir =~ m/man([0-9A-Za-z]+)$/); + $file = "$dir/$page.$s"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + $file = "$dir/$request"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + if ($sect && "$page.$sect" ne $request) + { + $file = "$dir/$page.$sect"; +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); + } + } + if (@multipleMatches == 1) +@@ -2882,7 +2889,7 @@ + { + if ($f =~ m/^$page\./) + { +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + push(@multipleMatches, "$dir/$f"); + } + } +@@ -2908,7 +2915,7 @@ + { + next if ($f eq "." || $f eq ".." || $f !~ m/\./); + next unless ("$dir/$f" =~ m/perl/); +- $f =~ s/\.(gz|bz2)$//; ++ $f =~ s/\.(gz|bz2|xz)$//; + ($name) = ($f =~ m,(.+)\.[^.]*$,); + $perlPages{$name} = "$dir/$f"; + } diff -r 5d1b0ab9a299 -r 4466c09bba16 manserver/stuff/manserver.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manserver/stuff/manserver.desktop Wed Oct 22 00:11:20 2014 +0300 @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Man pages +Name[ru]=Страницы Man +Exec=browser http://localhost:8888/ +Icon=help-contents +Categories=Development;Documentation;