]> git.pld-linux.org Git - packages/dokuwiki-plugin-nssize.git/commitdiff
- new
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 28 Jul 2010 20:15:33 +0000 (20:15 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    doku-conf.patch -> 1.1
    dokuwiki-plugin-nssize.spec -> 1.1

doku-conf.patch [new file with mode: 0644]
dokuwiki-plugin-nssize.spec [new file with mode: 0644]

diff --git a/doku-conf.patch b/doku-conf.patch
new file mode 100644 (file)
index 0000000..4c328c2
--- /dev/null
@@ -0,0 +1,70 @@
+--- dokuwiki-plugin-nssize-20080322/syntax.php 2010-07-28 23:10:41.962402125 +0300
++++ dokuwiki-plugin-nssize/syntax.php  2010-07-28 23:10:39.131984609 +0300
+@@ -28,45 +28,40 @@
+   function getSort(){    return 150;  }
+   function connectTo($mode) { $this->Lexer->addSpecialPattern('{{nssize>[^}]+}}',$mode,'plugin_nssize'); }
+   function handle($match, $state, $pos, &$handler) {
++    global $conf;
++
+     $subdir = substr($match,9,-2);
+     $subdir = str_replace(":","/",$subdir);
+-    $base = $this->getPwd();
+-    $base .= "/data/";
+     $message.= '<ul class="nssize">';
+     $message.= '<li class="nssize_title">'.$subdir.'</li>'.NL;
+     $total = 0;
+-    $pageDir   = $base.'pages/'.$subdir;
+-    $pageSize  = $this->getSize($pageDir);
++    $pageSize  = $this->getSize($conf['datadir'], $subdir);
+     $total    += $pageSize;
+     if ($this->getConf('display_pages')){
+       $message  .= $this->getFormatted("Pages",$pageSize);
+     }
+     
+-    $mediaDir  = $base.'media/'.$subdir;
+-    $mediaSize = $this->getSize($mediaDir);
++    $mediaSize = $this->getSize($conf['mediadir'], $subdir);
+     $total    += $mediaSize;
+     if ($this->getConf('display_media')==true){
+       $message  .= $this->getFormatted("Media",$mediaSize);
+     }
+-    $cacheDir  = $base.'cache/'.$subdir;
+-    $cacheSize = $this->getSize($cacheDir);
++    $cacheSize = $this->getSize($conf['cachedir'], $subdir);
+     $total    += $cacheSize;
+     if ($this->getConf('display_cache')==true){
+       $message  .= $this->getFormatted("Cache",$cacheSize);
+     }
+     
+-    $metaDir  = $base.'meta/'.$subdir;
+-    $metaSize = $this->getSize($metaDir);
++    $metaSize = $this->getSize($conf['metadir'], $subdir);
+     $total   += $metaSize;
+     if ($this->getConf('display_meta')==true){
+       $message .= $this->getFormatted("Meta",$metaSize);
+     }
+-    $atticDir  = $base.'attic/'.$subdir;
+-    $atticSize = $this->getSize($atticDir);
++    $atticSize = $this->getSize($conf['olddir'], $subdir);
+     $total    += $atticSize;    
+     if ($this->getConf('display_attic')==true){
+       $message  .= $this->getFormatted("Attic",$atticSize);
+@@ -86,12 +81,9 @@
+     }
+     return false;
+   }
+-  function getPwd(){
+-    $value = exec("pwd");
+-    return $value;
+-  }
+   
+-  function getSize($fullpath){
++  function getSize($basedir, $subdir) {
++    $fullpath = $basedir.'/'.$subdir;
+     $values = explode(" ",exec("du -k ".$fullpath));
+     $size = $values[0]/1024;
+     return $size;
diff --git a/dokuwiki-plugin-nssize.spec b/dokuwiki-plugin-nssize.spec
new file mode 100644 (file)
index 0000000..63d03fb
--- /dev/null
@@ -0,0 +1,58 @@
+%define                plugin          nssize
+Summary:       DokuWiki plugin to Show disk usage of a namespace
+Name:          dokuwiki-plugin-%{plugin}
+Version:       20080322
+Release:       0.2
+License:       GPL v2
+Group:         Applications/WWW
+Source0:       http://wiki.symplus.com/_media/computer/source/nssize.zip
+# Source0-md5: 288b06bc6765f9b51e5a3aa11b99b3b7
+URL:           http://www.dokuwiki.org/plugin:nssize
+Patch0:                doku-conf.patch
+BuildRequires: rpmbuild(macros) >= 1.553
+Requires:      dokuwiki >= 20061106
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                dokuconf        /etc/webapps/dokuwiki
+%define                dokudir         /usr/share/dokuwiki
+%define                plugindir       %{dokudir}/lib/plugins/%{plugin}
+%define                find_lang       %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
+
+%description
+NSsize DokuWiki plugin calculates and displays the disk usage of a
+particular namespace.
+
+This plugin can display the disk space of the 'pages', 'media',
+'meta', 'cache', 'attic' directories. These displaying items are
+selectable in the plugin-configuration page.
+
+%prep
+%setup -qc
+mv %{plugin}/* .
+%undos *.css *.php
+%patch0 -p1
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{plugindir}
+cp -a . $RPM_BUILD_ROOT%{plugindir}
+
+# find locales
+%find_lang %{name}.lang
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+# force css cache refresh
+if [ -f %{dokuconf}/local.php ]; then
+       touch %{dokuconf}/local.php
+fi
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%dir %{plugindir}
+%{plugindir}/*.php
+%{plugindir}/*.css
+%{plugindir}/conf
This page took 0.122559 seconds and 4 git commands to generate.