1 # $Revision: 1.26 $, $Date: 2012/06/12 21:19:39 $
3 %define php_min_version 5.0.0
4 %include /usr/lib/rpm/macros.php
5 Summary: DokuWiki Structured Data Plugin
6 Name: dokuwiki-plugin-%{plugin}
10 Group: Applications/WWW
11 #Source0: http://github.com/splitbrain/dokuwiki-plugin-%{plugin}/tarball/master#/%{plugin}-%{version}.tgz
12 Source0: https://github.com/Klap-in/dokuwiki-plugin-data/tarball/pdo#/%{plugin}-pdo-%{version}.tgz
13 # Source0-md5: 6b5d2b8df3e458efe70cea3076eb852a
14 URL: http://wiki.splitbrain.org/plugin:data
15 Patch2: separator-style.patch
16 Patch3: separate-rpmdb.patch
17 BuildRequires: rpm-php-pearprov
18 BuildRequires: rpmbuild(macros) >= 1.520
19 Requires: php-common >= 4:%{php_min_version}
20 Requires(triggerun): sqlite
21 Requires: dokuwiki >= 20090214b-5
22 Requires: dokuwiki-plugin-sqlite >= 20120619
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define dokuconf /etc/webapps/dokuwiki
28 %define dokudir /usr/share/dokuwiki
29 %define metadir /var/lib/dokuwiki/meta
30 %define plugindir %{dokudir}/lib/plugins/%{plugin}
31 %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
34 %define _noautopear pear
36 # sqlite is dokuwiki-plugin-sqlite dep, not ours
37 %define _noautophp php-sqlite
39 # put it together for rpmbuild
40 %define _noautoreq %{?_noautophp} %{?_noautopear}
43 This plugin allows you to add structured data to any DokuWiki page.
44 Think about this data as additional named attributes. Those attributes
45 can then be queried and aggregated. The plugin is similar to what was
46 done here for the repository plugin but its internals are very
47 different to the repository plugin.
55 version=$(awk '/date/{print $2}' plugin.info.txt)
56 if [ $(echo "$version" | tr -d -) != %{version} ]; then
57 : %%{version} mismatch
61 # nothing to do with tests
64 # cleanup backups after patching
65 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
70 cp -a . $RPM_BUILD_ROOT%{plugindir}
71 %{__rm} $RPM_BUILD_ROOT%{plugindir}/README
72 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
75 %find_lang %{name}.lang
78 rm -rf $RPM_BUILD_ROOT
81 # force css cache refresh
82 if [ -f %{dokuconf}/local.php ]; then
83 touch %{dokuconf}/local.php
86 %triggerun -- %{name} < 20100322-0.5
87 # move to new location
88 mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite
90 # perform new indexes add manually
91 sqlite %{metadir}/data.sqlite <<'EOF'
92 CREATE TABLE opts (opt,val);
93 CREATE UNIQUE INDEX idx_opt ON opts(opt);
94 INSERT INTO opts VALUES ('dbversion', 1);
96 chown root:http %{metadir}/data.sqlite
97 chmod 660 %{metadir}/data.sqlite
99 %files -f %{name}.lang
100 %defattr(644,root,root,755)
111 %attr(660,http,http) %ghost %{metadir}/data.sqlite