wok-next rev 17260
Add manserver.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Oct 22 00:11:20 2014 +0300 (2014-10-22) |
parents | 5d1b0ab9a299 |
children | 533c0cab6960 |
files | manserver/receipt manserver/stuff/manpath.config manserver/stuff/manserver manserver/stuff/manserver-1.08-add-xz.patch manserver/stuff/manserver.desktop |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/manserver/receipt Wed Oct 22 00:11:20 2014 +0300 1.3 @@ -0,0 +1,26 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="manserver" 1.7 +VERSION="1.08" 1.8 +CATEGORY="development" 1.9 +SHORT_DESC="Man to HTML converter which can act as an HTTP server on port 8888" 1.10 +MAINTAINER="al.bobylev@gmail.com" 1.11 +LICENSE="custom" 1.12 +WEB_SITE="http://www.squarebox.co.uk/users/rolf/download/manServer.shtml" 1.13 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.14 +WGET_URL="http://www.squarebox.co.uk/download/$TARBALL" 1.15 + 1.16 +DEPENDS="perl" #also can use busybox to extract gz, bz2 or xz man pages 1.17 + 1.18 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.19 +genpkg_rules() 1.20 +{ 1.21 + mkdir -p $fs/usr/bin $fs/usr/share/licenses $fs/usr/share/man/man1 $fs/etc/init.d 1.22 + cd $src; patch -p0 -i $stuff/manserver-1.08-add-xz.patch 1.23 + install -Dm755 $src/manServer.pl $fs/usr/bin/manServer 1.24 + install -Dm755 $stuff/manserver $fs/usr/bin/manserver 1.25 + install -Dm644 $src/LICENSE $fs/usr/share/licenses/manserver.txt 1.26 + install -Dm644 $src/manServer.1 $fs/usr/share/man/man1 1.27 + install -Dm644 $stuff/manpath.config $fs/etc/manpath.config 1.28 + ln -s daemon $fs/etc/init.d/manserver 1.29 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/manserver/stuff/manpath.config Wed Oct 22 00:11:20 2014 +0300 2.3 @@ -0,0 +1,3 @@ 2.4 +MANDB_MAP /usr/man 2.5 +MANDB_MAP /usr/share/man 2.6 +MANDB_MAP /usr/share/man/ru
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/manserver/stuff/manserver Wed Oct 22 00:11:20 2014 +0300 3.3 @@ -0,0 +1,2 @@ 3.4 +#!/bin/sh 3.5 +nohup /usr/bin/manServer -s >/dev/null 2>&1 & >/dev/null 2>&1
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/manserver/stuff/manserver-1.08-add-xz.patch Wed Oct 22 00:11:20 2014 +0300 4.3 @@ -0,0 +1,87 @@ 4.4 +--- manServer.pl.orig 4.5 ++++ manServer.pl 4.6 +@@ -175,7 +175,7 @@ 4.7 + listDir($request); 4.8 + $processed = 1; 4.9 + } 4.10 +- elsif (-f $request || -f "$request.gz" || -f "$request.bz2") 4.11 ++ elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz") 4.12 + { 4.13 + # Only allow fully specified files if they're in our manpath 4.14 + foreach $md (@manpath) 4.15 +@@ -270,7 +270,7 @@ 4.16 + foreach $f (@files) 4.17 + { 4.18 + next if ($f eq "." || $f eq ".." || $f !~ m/\./); 4.19 +- $f =~ s/\.(gz|bz2)$//; 4.20 ++ $f =~ s/\.(gz|bz2|xz)$//; 4.21 + # ($name) = ($f =~ m,/([^/]*)$,); 4.22 + print OUT "<A HREF=\"$root$request/$f\">$f</A> \n"; 4.23 + } 4.24 +@@ -322,6 +322,13 @@ 4.25 + $srcfile =~ m/^(.*)$/; 4.26 + $srcfile = $1; # untaint 4.27 + } 4.28 ++ elsif (-f "$file.xz") 4.29 ++ { 4.30 ++ $zfile = "$file.xz"; 4.31 ++ $srcfile = "/usr/bin/xzcat $zfile |"; 4.32 ++ $srcfile =~ m/^(.*)$/; 4.33 ++ $srcfile = $1; # untaint 4.34 ++ } 4.35 + } 4.36 + print LOG "man2html $file\n"; 4.37 + $foundNroffTag = 0; 4.38 +@@ -2823,7 +2830,7 @@ 4.39 + @multipleMatches = (); 4.40 + 4.41 + $file = $_[0]; 4.42 +- return $file if (-f $file || -f "$file.gz" || -f "$file.bz2"); 4.43 ++ return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); 4.44 + 4.45 + # Search the path for the requested man page, which may be of the form: 4.46 + # "/usr/man/man1/ls.1", "ls.1" or "ls". 4.47 +@@ -2837,7 +2844,7 @@ 4.48 + { 4.49 + $dir = $md; 4.50 + $file = "$dir/man$sect/$page.$sect"; 4.51 +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); 4.52 ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); 4.53 + } 4.54 + } 4.55 + else 4.56 +@@ -2855,13 +2862,13 @@ 4.57 + { 4.58 + ($s) = ($dir =~ m/man([0-9A-Za-z]+)$/); 4.59 + $file = "$dir/$page.$s"; 4.60 +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); 4.61 ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); 4.62 + $file = "$dir/$request"; 4.63 +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); 4.64 ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); 4.65 + if ($sect && "$page.$sect" ne $request) 4.66 + { 4.67 + $file = "$dir/$page.$sect"; 4.68 +- push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2"); 4.69 ++ push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz"); 4.70 + } 4.71 + } 4.72 + if (@multipleMatches == 1) 4.73 +@@ -2882,7 +2889,7 @@ 4.74 + { 4.75 + if ($f =~ m/^$page\./) 4.76 + { 4.77 +- $f =~ s/\.(gz|bz2)$//; 4.78 ++ $f =~ s/\.(gz|bz2|xz)$//; 4.79 + push(@multipleMatches, "$dir/$f"); 4.80 + } 4.81 + } 4.82 +@@ -2908,7 +2915,7 @@ 4.83 + { 4.84 + next if ($f eq "." || $f eq ".." || $f !~ m/\./); 4.85 + next unless ("$dir/$f" =~ m/perl/); 4.86 +- $f =~ s/\.(gz|bz2)$//; 4.87 ++ $f =~ s/\.(gz|bz2|xz)$//; 4.88 + ($name) = ($f =~ m,(.+)\.[^.]*$,); 4.89 + $perlPages{$name} = "$dir/$f"; 4.90 + }
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/manserver/stuff/manserver.desktop Wed Oct 22 00:11:20 2014 +0300 5.3 @@ -0,0 +1,7 @@ 5.4 +[Desktop Entry] 5.5 +Type=Application 5.6 +Name=Man pages 5.7 +Name[ru]=Страницы Man 5.8 +Exec=browser http://localhost:8888/ 5.9 +Icon=help-contents 5.10 +Categories=Development;Documentation;