]>
Commit | Line | Data |
---|---|---|
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 | %include /usr/lib/rpm/macros.php | |
6 | Summary: DokuWiki Structured Data Plugin | |
7 | Name: dokuwiki-plugin-%{plugin} | |
8 | Version: %{ver} | |
9 | Release: 1 | |
10 | License: GPL v2 | |
11 | Group: Applications/WWW | |
12 | Source0: https://github.com/splitbrain/dokuwiki-plugin-%{plugin}/archive/%{subver}/%{plugin}-%{subver}.tar.gz | |
13 | # Source0-md5: 26a8dc7c282c88e9dc3c2b3df0d8315e | |
14 | URL: https://www.dokuwiki.org/plugin:data | |
15 | Patch2: separator-style.patch | |
16 | Patch3: separate-rpmdb.patch | |
17 | Patch4: cache-enable.patch | |
18 | BuildRequires: rpm-php-pearprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.520 | |
20 | Requires: php(core) >= %{php_min_version} | |
21 | Requires(triggerun): sqlite | |
22 | Requires(triggerun): sqlite3 | |
23 | Requires: dokuwiki >= 20090214b-5 | |
24 | Requires: dokuwiki-plugin-sqlite >= 20130508 | |
25 | Requires: php(pcre) | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %define dokuconf /etc/webapps/dokuwiki | |
30 | %define dokudir /usr/share/dokuwiki | |
31 | %define metadir /var/lib/dokuwiki/meta | |
32 | %define plugindir %{dokudir}/lib/plugins/%{plugin} | |
33 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} | |
34 | ||
35 | # no pear deps | |
36 | %define _noautopear pear | |
37 | ||
38 | # sqlite is dokuwiki-plugin-sqlite dep, not ours | |
39 | %define _noautophp php-sqlite | |
40 | ||
41 | # put it together for rpmbuild | |
42 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
43 | ||
44 | %description | |
45 | This plugin allows you to add structured data to any DokuWiki page. | |
46 | Think about this data as additional named attributes. Those attributes | |
47 | can then be queried and aggregated. The plugin is similar to what was | |
48 | done here for the repository plugin but its internals are very | |
49 | different to the repository plugin. | |
50 | ||
51 | %prep | |
52 | %setup -qc | |
53 | mv *-%{plugin}-*/{.??*,*} . | |
54 | %patch2 -p1 | |
55 | %patch3 -p1 | |
56 | %patch4 -p1 | |
57 | ||
58 | # nothing to do with tests | |
59 | rm -rf _test | |
60 | rm .travis.yml | |
61 | ||
62 | # cleanup backups after patching | |
63 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
64 | ||
65 | %build | |
66 | version=$(awk '/date/{print $2}' plugin.info.txt) | |
67 | if [ $(echo "$version" | tr -d -) != %{version} ]; then | |
68 | : %%{version} mismatch | |
69 | exit 1 | |
70 | fi | |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}} | |
75 | cp -a . $RPM_BUILD_ROOT%{plugindir} | |
76 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README | |
77 | # sqlite2: php-sqlite | |
78 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite | |
79 | # sqlite3: php-pdo-sqlite | |
80 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite3 | |
81 | ||
82 | # find locales | |
83 | %find_lang %{name}.lang | |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %post | |
89 | # force css cache refresh | |
90 | if [ -f %{dokuconf}/local.php ]; then | |
91 | touch %{dokuconf}/local.php | |
92 | fi | |
93 | ||
94 | %files -f %{name}.lang | |
95 | %defattr(644,root,root,755) | |
96 | %doc README | |
97 | %dir %{plugindir} | |
98 | %{plugindir}/*.css | |
99 | %{plugindir}/*.js | |
100 | %{plugindir}/*.php | |
101 | %{plugindir}/*.svg | |
102 | %{plugindir}/*.txt | |
103 | %{plugindir}/admin | |
104 | %{plugindir}/conf | |
105 | %{plugindir}/db | |
106 | %{plugindir}/helper | |
107 | %{plugindir}/syntax | |
108 | %attr(660,http,http) %ghost %{metadir}/data.sqlite | |
109 | %attr(660,http,http) %ghost %{metadir}/data.sqlite3 |