Browse Source

add even more plugins and establish an admin view by default

Ralf S. Engelschall 21 years ago
parent
commit
c2cbb3282b
4 changed files with 130 additions and 31 deletions
  1. 35 15
      kwiki/kwiki-apache.conf
  2. 3 0
      kwiki/kwiki-plugins.txt
  3. 30 6
      kwiki/kwiki.patch
  4. 62 10
      kwiki/kwiki.spec

+ 35 - 15
kwiki/kwiki-apache.conf

@@ -26,25 +26,45 @@ Alias /kwiki/ @l_prefix@/var/kwiki/
             SetHandler perl-script
             PerlHandler Apache::Registry
         </Files>
-        <Perl>
-            #   support optional lib/ subdir similar to index.cgi 
-            use lib "@l_prefix@/var/kwiki/lib";
-            #   pre-load all Kiwki plugins
-            use CGI;
-            use Spoon;
-            use Spiffy;
-            use Kwiki;
-            use IO::File;
-            my $io = new IO::File "<@l_prefix@/var/kwiki/plugins" or die;
-            my $run = ''; $run .= $_ while (<$io>);
-            $io->close();
-            $run =~ s|^(Kwiki::.+)$|use $1;|mg;
-            eval "$run";
-        </Perl>
     </IfModule>
     <IfModule !mod_perl.c>
         #   use standardized mod_cgi
         AddHandler cgi-script .cgi
     </IfModule>
 </Directory>
+<Directory @l_prefix@/var/kwiki/admin>
+    #   access control
+    Require user admin
+    AuthType Basic
+    AuthName Restricted
+    AuthUserFile @l_prefix@/var/kwiki/admin/passwd
+    <Files passwd>
+        Order allow,deny
+        Deny from all
+        Satisfy All
+    </Files>
+
+    #   local server configuration
+    Options +FollowSymLinks
+</Directory>
+
+#   optional mod_perl setup
+<IfModule mod_perl.c>
+    <Perl>
+        #   support optional lib/ subdir similar to index.cgi 
+        use lib "@l_prefix@/var/kwiki/lib";
+
+        #   pre-load all Kiwki plugins
+        use CGI;
+        use Spoon;
+        use Spiffy;
+        use Kwiki;
+        use IO::File;
+        my $io = new IO::File "<@l_prefix@/var/kwiki/plugins" or die;
+        my $run = ''; $run .= $_ while (<$io>);
+        $io->close();
+        $run =~ s|^(Kwiki::.+)$|use $1;|mg;
+        eval "$run";
+    </Perl>
+</IfModule>
 

+ 3 - 0
kwiki/kwiki-plugins.txt

@@ -29,6 +29,7 @@ Kwiki::ParagraphBlocks
 Kwiki::PreformattedBlocks
 Kwiki::HtmlBlocks
 Kwiki::ShortcutLinks
+Kwiki::ForeignLinkGlyphs
 
 #   Additional Wiki Interface Extensions
 #Kwiki::BreadCrumbs
@@ -43,6 +44,7 @@ Kwiki::ShortcutLinks
 #Kwiki::PageInclude
 #Kwiki::PageTemplate
 #Kwiki::Comments
+#Kwiki::Infobox
 
 #   Additional Text Block Formatters
 #Kwiki::ShellBlocks
@@ -70,6 +72,7 @@ Kwiki::ShortcutLinks
 #Kwiki::NavigationToolbar
 
 #   Esoteric Extension
+#Kwiki::ConfigBlocks
 #Kwiki::Email
 #Kwiki::Notify::Mail
 #Kwiki::Archive::Cvs

+ 30 - 6
kwiki/kwiki.patch

@@ -1,6 +1,18 @@
+Index: Kwiki-0.37/lib/Kwiki/Command.pm
+--- Kwiki-0.37/lib/Kwiki/Command.pm.orig	2005-01-11 11:16:11 +0100
++++ Kwiki-0.37/lib/Kwiki/Command.pm	2005-01-13 21:14:26 +0100
+@@ -114,7 +114,7 @@
+         next unless $self->is_kwiki_dir($dir);
+         $self->msg('Updating ', $dir->absolute->pathname, "\n");
+         $dir->chdir;
+-        system("kwiki -quiet -update");
++        system("@l_prefix@/bin/kwiki -quiet -update");
+     }
+ }
+ 
 Index: Kwiki-0.37/lib/Kwiki/Display.pm
 --- Kwiki-0.37/lib/Kwiki/Display.pm.orig	2005-01-11 11:16:46 +0100
-+++ Kwiki-0.37/lib/Kwiki/Display.pm	2005-01-12 15:35:08 +0100
++++ Kwiki-0.37/lib/Kwiki/Display.pm	2005-01-13 21:13:39 +0100
 @@ -84,7 +84,7 @@
  __template/tt2/display_changed_by.html__
  [% IF self.preferences.display_changed_by.value %]
@@ -10,9 +22,21 @@ Index: Kwiki-0.37/lib/Kwiki/Display.pm
  <em>
  Last changed by [% page.edit_by_link %] at [% page.edit_time %]
  </em>
+Index: Kwiki-0.37/lib/Kwiki/Theme/Basic.pm
+--- Kwiki-0.37/lib/Kwiki/Theme/Basic.pm.orig	2004-12-02 03:15:06 +0100
++++ Kwiki-0.37/lib/Kwiki/Theme/Basic.pm	2005-01-13 21:15:12 +0100
+@@ -42,6 +42,8 @@
+ </h1>
+ </div>
+ 
++<p/>
++
+ <div id="toolbar_pane">
+ [% hub.toolbar.html %]
+ [% IF hub.have_plugin('user_name') %]
 Index: Kwiki-Diff-0.01/lib/Kwiki/Diff.pm
 --- Kwiki-Diff-0.01/lib/Kwiki/Diff.pm.orig	2004-08-25 18:01:20 +0200
-+++ Kwiki-Diff-0.01/lib/Kwiki/Diff.pm	2005-01-12 15:35:08 +0100
++++ Kwiki-Diff-0.01/lib/Kwiki/Diff.pm	2005-01-13 21:13:39 +0100
 @@ -166,6 +166,11 @@
  <img src="icons/gnome/image/diff.png" alt="Differences" />
  <!-- END diff_button_icon.html -->
@@ -27,7 +51,7 @@ Index: Kwiki-Diff-0.01/lib/Kwiki/Diff.pm
  <a href="[% script_name %]?action=revisions&page_id=[% page_id %]&revision_id=[% revision_id %]" accesskey="r" title="Revision [% revision_id %]">
 Index: Kwiki-Favorites-0.13/lib/Kwiki/Favorites.pm
 --- Kwiki-Favorites-0.13/lib/Kwiki/Favorites.pm.orig	2005-01-11 17:03:22 +0100
-+++ Kwiki-Favorites-0.13/lib/Kwiki/Favorites.pm	2005-01-12 15:35:08 +0100
++++ Kwiki-Favorites-0.13/lib/Kwiki/Favorites.pm	2005-01-13 21:13:39 +0100
 @@ -111,7 +111,7 @@
  }
  </script>
@@ -39,7 +63,7 @@ Index: Kwiki-Favorites-0.13/lib/Kwiki/Favorites.pm
  </form>
 Index: Kwiki-Notify-Mail-0.02/lib/Kwiki/Notify/Mail.pm
 --- Kwiki-Notify-Mail-0.02/lib/Kwiki/Notify/Mail.pm.orig	2004-09-01 02:11:53 +0200
-+++ Kwiki-Notify-Mail-0.02/lib/Kwiki/Notify/Mail.pm	2005-01-12 15:35:30 +0100
++++ Kwiki-Notify-Mail-0.02/lib/Kwiki/Notify/Mail.pm	2005-01-13 21:13:39 +0100
 @@ -58,7 +58,7 @@
  	$msg->print(\*TEMPFILE);
  	close TEMPFILE;
@@ -51,7 +75,7 @@ Index: Kwiki-Notify-Mail-0.02/lib/Kwiki/Notify/Mail.pm
  
 Index: Kwiki-RecentChangesRSS-0.05/lib/Kwiki/RecentChangesRSS.pm
 --- Kwiki-RecentChangesRSS-0.05/lib/Kwiki/RecentChangesRSS.pm.orig	2004-12-11 22:50:42 +0100
-+++ Kwiki-RecentChangesRSS-0.05/lib/Kwiki/RecentChangesRSS.pm	2005-01-12 15:35:08 +0100
++++ Kwiki-RecentChangesRSS-0.05/lib/Kwiki/RecentChangesRSS.pm	2005-01-13 21:13:39 +0100
 @@ -312,6 +312,7 @@
  rss_skipHours:
  rss_skipDays:
@@ -71,7 +95,7 @@ Index: Kwiki-RecentChangesRSS-0.05/lib/Kwiki/RecentChangesRSS.pm
  eNpjdDdgQAX/Gd9+QBP6w8SAAYBC/1YzcBdYr2eYvYG7ACTEAhQ98JVb9vRvBoG/DD+gqhga2Jmd
 Index: Kwiki-Search-0.12/lib/Kwiki/Search.pm
 --- Kwiki-Search-0.12/lib/Kwiki/Search.pm.orig	2004-12-16 00:38:12 +0100
-+++ Kwiki-Search-0.12/lib/Kwiki/Search.pm	2005-01-12 15:35:08 +0100
++++ Kwiki-Search-0.12/lib/Kwiki/Search.pm	2005-01-13 21:13:39 +0100
 @@ -72,7 +72,7 @@
  
  =cut

+ 62 - 10
kwiki/kwiki.spec

@@ -72,9 +72,12 @@
 %define       V_kwiki_users_remote          0.01
 %define       V_kwiki_pageprivacy           0.10
 %define       V_kwiki_navigationtoolbar     0.02
+%define       V_kwiki_configblocks          0.01
+%define       V_kwiki_infobox               0.01
 %define       V_kwiki_theme_columnlayout    0.06
 %define       V_kwiki_theme_hlb             0.01
 %define       V_kwiki_theme_tabnav          0.01
+%define       V_kwiki_foreignlinkglyphs     0.01
 
 #   package information
 Name:         kwiki
@@ -138,9 +141,12 @@ Source44:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-TimeZone-%{V_kwi
 Source45:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Users-Remote-%{V_kwiki_users_remote}.tar.gz
 Source46:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-PagePrivacy-%{V_kwiki_pageprivacy}.tar.gz
 Source47:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-NavigationToolbar-%{V_kwiki_navigationtoolbar}.tar.gz
-Source48:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-ColumnLayout-%{V_kwiki_theme_columnlayout}.tar.gz
-Source49:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-HLB-%{V_kwiki_theme_hlb}.tar.gz
-Source50:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-TabNav-%{V_kwiki_theme_tabnav}.tar.gz
+Source48:     http://www.cpan.org/authors/id/G/GU/GUGOD/Kwiki-ConfigBlocks-%{V_kwiki_configblocks}.tar.gz
+Source49:     http://www.cpan.org/authors/id/G/GU/GUGOD/Kwiki-Infobox-%{V_kwiki_infobox}.tar.gz
+Source50:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-ColumnLayout-%{V_kwiki_theme_columnlayout}.tar.gz
+Source51:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-HLB-%{V_kwiki_theme_hlb}.tar.gz
+Source52:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-Theme-TabNav-%{V_kwiki_theme_tabnav}.tar.gz
+Source53:     http://www.cpan.org/modules/by-module/Kwiki/Kwiki-ForeignLinkGlyphs-%{V_kwiki_foreignlinkglyphs}.tar.gz
 Source100:    kwiki-apache.conf
 Source101:    kwiki-plugins.txt
 Patch0:       kwiki.patch
@@ -416,6 +422,21 @@ AutoReqProv:  no
         url       = http://www.cpan.org/modules/by-module/Kwiki/
         regex     = Kwiki-Theme-TabNav-(__VER__)\.tar\.gz
     }
+    prog kwiki:Kwiki-ConfigBlocks = {
+        version   = %{V_kwiki_configblocks}
+        url       = http://www.cpan.org/authors/id/G/GU/GUGOD/
+        regex     = Kwiki-ConfigBlocks-(__VER__)\.tar\.gz
+    }
+    prog kwiki:Kwiki-Infobox = {
+        version   = %{V_kwiki_infobox}
+        url       = http://www.cpan.org/authors/id/G/GU/GUGOD/
+        regex     = Kwiki-Infobox-(__VER__)\.tar\.gz
+    }
+    prog kwiki:Kwiki-ForeignLinkGlyphs = {
+        version   = %{V_kwiki_foreignlinkglyphs}
+        url       = http://www.cpan.org/modules/by-module/Kwiki/
+        regex     = Kwiki-ForeignLinkGlyphs-(__VER__)\.tar\.gz
+    }
 
 %prep
     %setup -q -c
@@ -469,6 +490,9 @@ AutoReqProv:  no
     %setup -q -T -D -a 48
     %setup -q -T -D -a 49
     %setup -q -T -D -a 50
+    %setup -q -T -D -a 51
+    %setup -q -T -D -a 52
+    %setup -q -T -D -a 53
     sed <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
 
 %build
@@ -529,6 +553,9 @@ AutoReqProv:  no
     %{l_prefix}/bin/perl-openpkg -d %{SOURCE48} configure build install
     %{l_prefix}/bin/perl-openpkg -d %{SOURCE49} configure build install
     %{l_prefix}/bin/perl-openpkg -d %{SOURCE50} configure build install
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE51} configure build install
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE52} configure build install
+    %{l_prefix}/bin/perl-openpkg -d %{SOURCE53} configure build install
     %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
 
     #   install Apache configuration
@@ -538,6 +565,16 @@ AutoReqProv:  no
         %{SOURCE kwiki-apache.conf} \
         $RPM_BUILD_ROOT%{l_prefix}/etc/kwiki/
 
+    #   install administration helper script
+    ( echo "#!/bin/sh"
+      echo "cd %{l_prefix}/var/kwiki && \\ "
+      echo "%{l_prefix}/bin/kwiki -update_all && \\ "
+      echo "chown -R %{l_nusr}:%{l_ngrp} %{l_prefix}/var/kwiki/*"
+    ) >kwiki-update
+    %{l_shtool} install -c -m 755 \
+        -e 's; $;;' \
+        kwiki-update $RPM_BUILD_ROOT%{l_prefix}/bin/
+
     #   install default plugin list
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/share/kwiki
@@ -572,19 +609,34 @@ AutoReqProv:  no
 
         #   create initial Kwiki
         ( cd $RPM_INSTALL_PREFIX/var/kwiki || exit $?
-          echo "++ Generating new standard Kwiki in $RPM_INSTALL_PREFIX/var/kwiki"
-          $RPM_INSTALL_PREFIX/bin/kwiki -new
-          echo "++ Pre-configuring Kwiki in $RPM_INSTALL_PREFIX/var/kwiki"
+          echo "++ Generating new standard Kwiki in $RPM_INSTALL_PREFIX/var/kwiki/"
+          $RPM_INSTALL_PREFIX/bin/kwiki -quiet -new
+          echo "++ Pre-configuring Kwiki in $RPM_INSTALL_PREFIX/var/kwiki/"
           cp $RPM_INSTALL_PREFIX/share/kwiki/plugins \
              $RPM_INSTALL_PREFIX/var/kwiki/plugins
-          $RPM_INSTALL_PREFIX/bin/kwiki -update
-          echo "++ Creating initial Apache password file $RPM_INSTALL_PREFIX/var/kwiki/passwd"
-          $RPM_INSTALL_PREFIX/bin/htpasswd -b -c passwd admin admin
+          echo "++ Generating administrator view of Kwiki in $RPM_INSTALL_PREFIX/var/kwiki/admin/"
+          $RPM_INSTALL_PREFIX/bin/kwiki -quiet -new_view admin
+          ( echo "+Kwiki::PagePrivacy"
+          ) >>admin/plugins
+          $RPM_INSTALL_PREFIX/bin/htpasswd -b -c admin/passwd admin admin
+          echo "++ Finalizing Kwiki in $RPM_INSTALL_PREFIX/var/kwiki/"
+          $RPM_INSTALL_PREFIX/bin/kwiki-update
         ) || exit $?
 
         #   display information about steps the admin should perform next
-        ( echo "Kwiki was successfully installed. You should now start Apache with"
+        ( echo "Kwiki was successfully installed. You should now start Apache with:"
           echo "  \$ $RPM_INSTALL_PREFIX/etc/rc apache start"
+          echo "Further Kwiki configuration can be done in the files:"
+          echo "  $RPM_INSTALL_PREFIX/var/kwiki/plugins"
+          echo "  $RPM_INSTALL_PREFIX/var/kwiki/config.yaml"
+          echo "To activate your changes run:"
+          echo "  \$ $RPM_INSTALL_PREFIX/bin/kwiki-update"
+          echo "  \$ $RPM_INSTALL_PREFIX/etc/rc apache stop start"
+          echo "The Kwiki Homepage URLs are:"
+          echo "  http://localhost/kwiki/       (user view)"
+          echo "  http://localhost/kwiki/admin/ (administrator view)"
+          echo "Use the username \"admin\" with password \"admin\" to"
+          echo "login to the administrator view."
         ) | %{l_rpmtool} msg -b -t notice
     fi