]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/blob - dokuwiki-plugin-data.spec
3e67285ac2a4c2e71855dc075514c5fc39041f98
[packages/dokuwiki-plugin-data.git] / dokuwiki-plugin-data.spec
1 %define         subver  2019-03-20
2 %define         ver             %(echo %{subver} | tr -d -)
3 %define         plugin          data
4 %define         php_min_version 5.6.0
5 Summary:        DokuWiki Structured Data Plugin
6 Name:           dokuwiki-plugin-%{plugin}
7 Version:        %{ver}
8 Release:        1
9 License:        GPL v2
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:       dokuwiki >= 20090214b-5
21 Requires:       dokuwiki-plugin-sqlite >= 20130508
22 Requires:       php(pcre)
23 BuildArch:      noarch
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
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}
31
32 # no pear deps
33 %define         _noautopear     pear
34
35 # sqlite is dokuwiki-plugin-sqlite dep, not ours
36 %define         _noautophp      php-sqlite
37
38 # put it together for rpmbuild
39 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
40
41 %description
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.
47
48 %prep
49 %setup -qc
50 mv *-%{plugin}-*/{.??*,*} .
51 %patch2 -p1
52 %patch3 -p1
53 %patch4 -p1
54
55 # nothing to do with tests
56 rm -rf _test
57 rm .travis.yml
58
59 # cleanup backups after patching
60 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
61
62 %build
63 version=$(awk '/date/{print $2}' plugin.info.txt)
64 if [ $(echo "$version" | tr -d -) != %{version} ]; then
65         : %%{version} mismatch
66         exit 1
67 fi
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
72 cp -a . $RPM_BUILD_ROOT%{plugindir}
73 %{__rm} $RPM_BUILD_ROOT%{plugindir}/README
74 # sqlite2: php-sqlite
75 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
76 # sqlite3: php-pdo-sqlite
77 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite3
78
79 # find locales
80 %find_lang %{name}.lang
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %post
86 # force css cache refresh
87 if [ -f %{dokuconf}/local.php ]; then
88         touch %{dokuconf}/local.php
89 fi
90
91 %files -f %{name}.lang
92 %defattr(644,root,root,755)
93 %doc README
94 %dir %{plugindir}
95 %{plugindir}/*.css
96 %{plugindir}/*.js
97 %{plugindir}/*.php
98 %{plugindir}/*.svg
99 %{plugindir}/*.txt
100 %{plugindir}/admin
101 %{plugindir}/conf
102 %{plugindir}/db
103 %{plugindir}/helper
104 %{plugindir}/syntax
105 %attr(660,http,http) %ghost %{metadir}/data.sqlite
106 %attr(660,http,http) %ghost %{metadir}/data.sqlite3
This page took 0.163927 seconds and 2 git commands to generate.