1 %define subver 2019-03-20
2 %define ver %(echo %{subver} | tr -d -)
4 %define php_min_version 5.6.0
5 Summary: DokuWiki Structured Data Plugin
6 Name: dokuwiki-plugin-%{plugin}
10 Group: Applications/WWW
11 Source0: https://github.com/splitbrain/dokuwiki-plugin-%{plugin}/archive/%{subver}/%{plugin}-%{subver}.tar.gz
12 # Source0-md5: 26a8dc7c282c88e9dc3c2b3df0d8315e
13 URL: https://www.dokuwiki.org/plugin:data
14 Patch2: separator-style.patch
15 Patch3: separate-rpmdb.patch
16 Patch4: cache-enable.patch
17 BuildRequires: rpm-php-pearprov
18 BuildRequires: rpmbuild(macros) >= 1.520
19 Requires: php(core) >= %{php_min_version}
20 Requires(triggerun): sqlite
21 Requires(triggerun): sqlite3
22 Requires: dokuwiki >= 20090214b-5
23 Requires: dokuwiki-plugin-sqlite >= 20130508
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define dokuconf /etc/webapps/dokuwiki
29 %define dokudir /usr/share/dokuwiki
30 %define metadir /var/lib/dokuwiki/meta
31 %define plugindir %{dokudir}/lib/plugins/%{plugin}
32 %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
35 %define _noautopear pear
37 # sqlite is dokuwiki-plugin-sqlite dep, not ours
38 %define _noautophp php-sqlite
40 # put it together for rpmbuild
41 %define _noautoreq %{?_noautophp} %{?_noautopear}
44 This plugin allows you to add structured data to any DokuWiki page.
45 Think about this data as additional named attributes. Those attributes
46 can then be queried and aggregated. The plugin is similar to what was
47 done here for the repository plugin but its internals are very
48 different to the repository plugin.
52 mv *-%{plugin}-*/{.??*,*} .
57 # nothing to do with tests
61 # cleanup backups after patching
62 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
65 version=$(awk '/date/{print $2}' plugin.info.txt)
66 if [ $(echo "$version" | tr -d -) != %{version} ]; then
67 : %%{version} mismatch
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
74 cp -a . $RPM_BUILD_ROOT%{plugindir}
75 %{__rm} $RPM_BUILD_ROOT%{plugindir}/README
77 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
78 # sqlite3: php-pdo-sqlite
79 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite3
82 %find_lang %{name}.lang
85 rm -rf $RPM_BUILD_ROOT
88 # force css cache refresh
89 if [ -f %{dokuconf}/local.php ]; then
90 touch %{dokuconf}/local.php
93 %files -f %{name}.lang
94 %defattr(644,root,root,755)
107 %attr(660,http,http) %ghost %{metadir}/data.sqlite
108 %attr(660,http,http) %ghost %{metadir}/data.sqlite3