[packages/dokuwiki-plugin-nssize] up to 2013-02-03

glen glen at pld-linux.org
Sat Dec 22 15:15:37 CET 2018


commit f94b52b24018a3923815dd3f0727745213f9c1e9
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Dec 22 16:15:30 2018 +0200

    up to 2013-02-03

 doku-conf.patch             | 70 ---------------------------------------------
 dokuwiki-plugin-nssize.spec | 37 +++++++++++++-----------
 2 files changed, 21 insertions(+), 86 deletions(-)
---
diff --git a/dokuwiki-plugin-nssize.spec b/dokuwiki-plugin-nssize.spec
index b5cf25b..6e9b8b9 100644
--- a/dokuwiki-plugin-nssize.spec
+++ b/dokuwiki-plugin-nssize.spec
@@ -1,17 +1,21 @@
+%define		subver	2013-02-03
+%define		ver		%(echo %{subver} | tr -d -)
 %define		plugin		nssize
+%define		php_min_version 5.3.0
+%include	/usr/lib/rpm/macros.php
 Summary:	DokuWiki plugin to Show disk usage of a namespace
 Name:		dokuwiki-plugin-%{plugin}
-Version:	20080322
-Release:	0.2
+Version:	%{ver}
+Release:	1
 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
+Source0:	https://github.com/iobataya/dokuwiki-plugin-nssize/archive/6bccd121/%{plugin}-%{subver}.tar.gz
+# Source0-md5:	8b3d5f57c2e2045e92a593464bd08022
+URL:		https://www.dokuwiki.org/plugin:nssize
 BuildRequires:	rpmbuild(macros) >= 1.553
 BuildRequires:	unzip
 Requires:	dokuwiki >= 20061106
+Requires:	php(core) >= %{php_min_version}
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -30,14 +34,20 @@ selectable in the plugin-configuration page.
 
 %prep
 %setup -qc
-mv %{plugin}/* .
-%undos *.css *.php
-%patch0 -p1
+mv *-%{plugin}-*/* .
+
+%build
+version=$(awk '/^date/{print $2}' plugin.info.txt)
+if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
+	: %%{version} mismatch
+	exit 1
+fi
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{plugindir}
 cp -a . $RPM_BUILD_ROOT%{plugindir}
+%{__rm} $RPM_BUILD_ROOT%{plugindir}/README
 
 # find locales
 %find_lang %{name}.lang
@@ -45,15 +55,10 @@ cp -a . $RPM_BUILD_ROOT%{plugindir}
 %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)
+%doc README
 %dir %{plugindir}
 %{plugindir}/*.php
-%{plugindir}/*.css
+%{plugindir}/*.txt
 %{plugindir}/conf
diff --git a/doku-conf.patch b/doku-conf.patch
deleted file mode 100644
index 4c328c2..0000000
--- a/doku-conf.patch
+++ /dev/null
@@ -1,70 +0,0 @@
---- 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;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dokuwiki-plugin-nssize.git/commitdiff/f94b52b24018a3923815dd3f0727745213f9c1e9



More information about the pld-cvs-commit mailing list