]> git.proxmox.com Git - pve-docs.git/commitdiff
cleanup pve-docs package - only include documentation files
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 25 May 2016 05:01:19 +0000 (07:01 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 25 May 2016 05:01:19 +0000 (07:01 +0200)
apache2 and mediawiki setup files should go into a separate package.

doc-debian/README [deleted file]
doc-debian/docs [deleted file]
doc-debian/install
doc-debian/pve-docs-mediawiki-import [deleted file]
doc-debian/pve-docs.conf [deleted file]
doc-debian/pvedocs-include.php [deleted file]
doc-debian/rules

diff --git a/doc-debian/README b/doc-debian/README
deleted file mode 100644 (file)
index 29b1440..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-To enable the apache site use:
-
-# a2ensite pve-docs.conf
-# /etc/init.d/apache2 reload
-
-Now you should be able to access the documentation at:
-
-* Admin Guide and Manual pages
-http://your-server/pve-docs
-
-* API Viewer
-http://your-server/pve-docs/api-viewer
-
-
diff --git a/doc-debian/docs b/doc-debian/docs
deleted file mode 100644 (file)
index df6f1f3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-debian/README
index 5a5b1712a9ed61c761e0a6b32c008b53b854429d..1412e516da9ac25676f7e25999aa31f29831f9a9 100644 (file)
@@ -1,3 +1 @@
 /usr/share/
 /usr/share/
-debian/pvedocs-include.php /etc/mediawiki-extensions/extensions-available/
-debian/pve-docs-mediawiki-import /usr/bin
\ No newline at end of file
diff --git a/doc-debian/pve-docs-mediawiki-import b/doc-debian/pve-docs-mediawiki-import
deleted file mode 100755 (executable)
index 9e3ced0..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use Data::Dumper;
-
-use IO::File;
-use File::Basename;
-use MediaWiki::API;
-
-my $config_fn = "/root/.pve-docs"; # format 'username:pw'
-
-my $fh = IO::File->new("$config_fn") || 
-    die "Please configure the mediawiki user/passswd in '$config_fn'\n";
-
-my $api_url = "http://localhost/api.php";
-
-my $config = <$fh>;
-chomp $config;
-
-my ($username, $passwd) = split(':', $config, 2);
-
-my $mw = MediaWiki::API->new();
-$mw->{config}->{api_url} = $api_url;
-
-# log in to the wiki
-$mw->login({ lgname => $username, lgpassword => $passwd })
-    || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
-
-sub update_page {
-    my ($pagename, $include, $category) = @_;
-
-    print "update mediawiki page: $pagename\n";
-
-    my $ref = $mw->get_page( { title => $pagename } );
-    my $page =  $ref->{'*'} || '';
-
-    if ($page !~ m/^\{\{#pvedocs:.*\}\}\s*$/m) {
-       $page = "{{#pvedocs:$include}}\n$page";
-    } else {
-       $page =~ s/^\{\{#pvedocs:.*\}\}\s*$/\{\{#pvedocs:$include\}\}\n/m;
-    }
-
-    if ($category) {
-       my $catstr = "Category:$category";
-
-       if ($page !~ m/^\[\[$catstr\]\]\s*$/m) {
-           $page .= "\n[[$catstr]]\n";
-       }
-    }
-    
-    my $timestamp = $ref->{timestamp};
-    my $wcmd = {
-       action => 'edit',
-       title => $pagename,
-       basetimestamp => $timestamp, # to avoid edit conflicts
-       text => $page,
-    };
-
-    $mw->edit($wcmd) || 
-       die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
-}
-
-my $cat_refdoc = "Reference Documentation";
-
-my $docs = {
-    'chapter-ha-manager-plain.html' => {
-       title => "High Availability",
-       category => $cat_refdoc,
-    },
-    'chapter-sysadmin-plain.html' => {
-       title => "Host System Administration",
-       category => $cat_refdoc,
-    },
-    'chapter-pct-plain.html' => {
-       title => "Linux Container",
-       category => $cat_refdoc,
-    },
-    'chapter-pmxcfs-plain.html' => {
-       title => "Proxmox Cluster File System (pmxcfs)",
-       category => $cat_refdoc,
-    },
-    'chapter-pve-bibliography-plain.html' => {
-       title => "Bibliography",
-       category => $cat_refdoc,
-    },
-    'chapter-pvecm-plain.html' => {
-       title => "Cluster Manager",
-       category => $cat_refdoc,
-    },
-    'chapter-pve-faq-plain.html' => {
-       title => "FAQ",
-       category => $cat_refdoc,
-    },
-    'chapter-pve-firewall-plain.html' => {
-       title => "Firewall",
-       category => $cat_refdoc,
-    },
-    'chapter-pvesm-plain.html' => {
-       title => "Storage",
-       category => $cat_refdoc,
-    },
-    'chapter-pveum-plain.html' => {
-       title => "User Management",
-       category => $cat_refdoc,
-    },
-    'chapter-qm-plain.html' => {
-       title => "Qemu/KVM Virtual Machines",
-       category => $cat_refdoc,
-    },
-    'chapter-vzdump-plain.html' => {
-       title => "Backup and Restore",
-       category => $cat_refdoc,
-    },
-    'qm.conf.5-plain.html' => {
-       title => "Manual: vm.conf",
-       category => $cat_refdoc,
-    },
-    'pct.conf.5-plain.html' => {
-       title => "Manual: pct.conf",
-       category => $cat_refdoc,
-    },
-    'datacenter.cfg.5-plain.html' => {
-       title => "Manual: datacenter.cfg",
-       category => $cat_refdoc,
-    },
-    # Storage Plugins
-    'pve-storage-dir-plain.html' => {
-       title => "Storage: Directory",
-       category => $cat_refdoc,
-    },
-    'pve-storage-glusterfs-plain.html' => {
-       title => "Storage: GlusterFS",
-       category => $cat_refdoc,
-    },
-    'pve-storage-iscsidirect-plain.html' => {
-       title => "Storage: User Mode iSCSI",
-       category => $cat_refdoc,
-    },
-    'pve-storage-iscsi-plain.html' => {
-       title => "Storage: iSCSI",
-       category => $cat_refdoc,
-    },
-    'pve-storage-lvm-plain.html' => {
-       title => "Storage: LVM",
-       category => $cat_refdoc,
-    },q
-    'pve-storage-lvmthin-plain.html' => {
-       title => "Storage: LVM Thin",
-       category => $cat_refdoc,
-    },
-    'pve-storage-nfs-plain.html' => {
-       title => "Storage: NFS",
-       category => $cat_refdoc,
-    },
-    'pve-storage-rbd-plain.html' => {
-       title => "Storage: RBD",
-       category => $cat_refdoc,
-    },
-    'pve-storage-zfspool-plain.html' => {
-       title => "Storage: ZFS",
-       category => $cat_refdoc,
-    },
-};
-
-#update_page("testpage1", $filename, $d->{category});
-
-foreach my $filename (keys %$docs) {
-    my $path = "/usr/share/pve-docs/$filename";
-    die "no such file '$path'" if ! -f $path;
-    my $d = $docs->{$filename};
-    update_page($d->{title}, $filename, $d->{category});
-}
diff --git a/doc-debian/pve-docs.conf b/doc-debian/pve-docs.conf
deleted file mode 100644 (file)
index 2b9b8e1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<Directory /usr/share/pve-docs>
-       AllowOverride None
-       Order allow,deny
-        allow from all
-</Directory>
-
-Alias /pve-docs /usr/share/pve-docs/
diff --git a/doc-debian/pvedocs-include.php b/doc-debian/pvedocs-include.php
deleted file mode 100644 (file)
index 5fc5378..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-# see http://www.mediawiki.org/wiki/Manual:Parser_functions
-
-$wgExtensionCredits['parserhook'][] = array(
-    'name' => "PVE Documenation Pages",
-    'description' => "Display PVE Documentation Pages", 
-    'author' => "Dietmar Maurer",
-);
-# Define a setup function
-$wgHooks['ParserFirstCallInit'][] = 'efPvedocsParserFunction_Setup';
-
-# Add a hook to initialise the magic word
-$wgHooks['LanguageGetMagic'][] = 'efPvedocsParserFunction_Magic';
-function efPvedocsParserFunction_Setup(&$parser) {
-    # Set a function hook associating the "pvedocs" magic
-    # word with our function
-    $parser->setFunctionHook( 'pvedocs', 'efPvedocsParserFunction_Render' );
-    return true;
-}
-function efPvedocsParserFunction_Magic(&$magicWords, $langCode) {
-    # Add the magic word
-    # The first array element is whether to be case sensitive,
-    # in this case (0) it is not case sensitive, 1 would be sensitive
-    # All remaining elements are synonyms for our parser function
-    $magicWords['pvedocs'] = array( 0, 'pvedocs' );
-
-    # unless we return true, other parser functions extensions won't get loaded.
-    return true;
-}
-
-function encodeURI($uri) {
-    return preg_replace_callback("{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i",
-        function ($m) { return sprintf('%%%02X', ord($m[0])); }, $uri);
-}
-
-function efPvedocsParserFunction_Render($parser, $param1 = '', $param2 = '') {
-
-       $parser->disableCache();
-
-    # only allow simply names, so that users can only include
-    # files from within "/usr/share/pve-docs/"
-       if (!preg_match("/[a-z0-9.-]+\.html/i", $param1)) {
-        die("no such manual page");
-       }   
-
-       $content = file_get_contents("/usr/share/pve-docs/$param1");
-
-    $output = "<noscript><div><p>" .
-        "This page requires java-script. To view " .
-        "this page without java-script goto " .
-        "<a href='/pve-docs/$param1'>$param1</a>" .
-        "</div></noscript>\n";
-
-       # hack to inject html without modifications my mediawiki parser
-       $encHtml = encodeURI($content);
-       $output .= "<div id='pve_embed_data'></div>";
-       $output .= "<script>" .
-        "var data = decodeURI(\"".$encHtml."\");" .
-        "document.getElementById('pve_embed_data').innerHTML = data;" .
-        "</script>";
-       
-       return array($output, 'noparse' => true, 'isHTML' => true);
-}
-
-?>
index d4e2f6bf661a36270af78b5bcb23ac7f43cb67f9..736b14ecf6ca8aa5dd9fe739d0f3797874ed9011 100755 (executable)
@@ -3,12 +3,5 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-PACKAGE=pve-docs
-destdir := $(CURDIR)/debian/$(PACKAGE)
-
 %:
        dh $@ 
 %:
        dh $@ 
-
-override_dh_install:
-       dh_install
-       install -D -m 0644 debian/pve-docs.conf $(destdir)/etc/apache2/sites-available/pve-docs.conf