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