2 Summary: DokuWiki Structured Data Plugin
3 Name: dokuwiki-plugin-%{plugin}
7 Group: Applications/WWW
8 Source0: http://download.github.com/splitbrain-dokuwiki-plugin-data-3c96821.zip
9 # Source0-md5: 65014382f5c12628561b674cdee129ee
10 URL: http://wiki.splitbrain.org/plugin:data
11 Patch0: interwiki.patch
12 Patch1: helper-map.patch
13 Patch2: separator-style.patch
14 BuildRequires: rpmbuild(macros) >= 1.520
15 Requires(triggerun): sqlite
16 Requires: dokuwiki >= 20090214b-5
17 Requires: dokuwiki-plugin-sqlite
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define dokuconf /etc/webapps/dokuwiki
22 %define dokudir /usr/share/dokuwiki
23 %define metadir /var/lib/dokuwiki/meta
24 %define plugindir %{dokudir}/lib/plugins/%{plugin}
25 %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
28 This plugin allows you to add structured data to any DokuWiki page.
29 Think about this data as additional named attributes. Those attributes
30 can then be queried and aggregated. The plugin is similar to what was
31 done here for the repository plugin but its internals are very
32 different to the repository plugin.
41 version=$(awk '/date/{print $2}' plugin.info.txt)
42 if [ $(echo "$version" | tr -d -) != %{version} ]; then
43 : %%{version} mismatch
47 # cleanup backups after patching
48 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
53 cp -a . $RPM_BUILD_ROOT%{plugindir}
54 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
57 %find_lang %{name}.lang
60 rm -rf $RPM_BUILD_ROOT
63 # force css cache refresh
64 if [ -f %{dokuconf}/local.php ]; then
65 touch %{dokuconf}/local.php
68 %triggerun -- %{name} < 20100322-0.5
69 # move to new location
70 mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite
72 # perform new indexes add manually
73 sqlite %{metadir}/data.sqlite <<'EOF'
74 CREATE TABLE opts (opt,val);
75 CREATE UNIQUE INDEX idx_opt ON opts(opt);
76 INSERT INTO opts VALUES ('dbversion', 1);
78 chown root:http %{metadir}/data.sqlite
79 chmod 660 %{metadir}/data.sqlite
81 %files -f %{name}.lang
82 %defattr(644,root,root,755)
91 %attr(660,http,http) %ghost %{metadir}/data.sqlite