]>
Commit | Line | Data |
---|---|---|
1 | %define subver 2022-07-27 | |
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: 2 | |
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: 2a03d1428b83dd279132b8d5772e6e9d | |
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(find_lang) >= 1.41 | |
19 | BuildRequires: rpmbuild(macros) >= 1.520 | |
20 | Requires: dokuwiki >= 20090214b-5 | |
21 | Requires: dokuwiki-plugin-sqlite >= 20130508 | |
22 | Requires: php(core) >= %{php_min_version} | |
23 | Requires: php(pcre) | |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
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 | ||
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 --with-dokuwiki | |
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}/Form | |
101 | %{plugindir}/admin | |
102 | %{plugindir}/conf | |
103 | %{plugindir}/db | |
104 | %{plugindir}/helper | |
105 | %{plugindir}/syntax | |
106 | %attr(660,http,http) %ghost %{metadir}/data.sqlite | |
107 | %attr(660,http,http) %ghost %{metadir}/data.sqlite3 |