]>
Commit | Line | Data |
---|---|---|
c18f0e32 | 1 | %define subver 2019-03-20 |
3c32c275 | 2 | %define ver %(echo %{subver} | tr -d -) |
d045a0a5 | 3 | %define plugin data |
93a728bd | 4 | %define php_min_version 5.6.0 |
4f0d4331 | 5 | %include /usr/lib/rpm/macros.php |
d045a0a5 ER |
6 | Summary: DokuWiki Structured Data Plugin |
7 | Name: dokuwiki-plugin-%{plugin} | |
3c32c275 | 8 | Version: %{ver} |
93a728bd | 9 | Release: 1 |
d045a0a5 ER |
10 | License: GPL v2 |
11 | Group: Applications/WWW | |
2225cb3b | 12 | Source0: https://github.com/splitbrain/dokuwiki-plugin-%{plugin}/archive/%{subver}/%{plugin}-%{subver}.tar.gz |
c18f0e32 | 13 | # Source0-md5: 26a8dc7c282c88e9dc3c2b3df0d8315e |
3c32c275 | 14 | URL: https://www.dokuwiki.org/plugin:data |
58e46b85 | 15 | Patch2: separator-style.patch |
ce3f39eb | 16 | Patch3: separate-rpmdb.patch |
147d6c0c | 17 | Patch4: cache-enable.patch |
dca91af3 | 18 | BuildRequires: rpm-php-pearprov |
d045a0a5 | 19 | BuildRequires: rpmbuild(macros) >= 1.520 |
272501f6 | 20 | Requires: php(core) >= %{php_min_version} |
860b9ced | 21 | Requires(triggerun): sqlite |
0b4d4d8b | 22 | Requires(triggerun): sqlite3 |
87d1921d | 23 | Requires: dokuwiki >= 20090214b-5 |
49046ef8 | 24 | Requires: dokuwiki-plugin-sqlite >= 20130508 |
f4bb0314 | 25 | Requires: php(pcre) |
d045a0a5 ER |
26 | BuildArch: noarch |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %define dokuconf /etc/webapps/dokuwiki | |
69e06802 | 30 | %define dokudir /usr/share/dokuwiki |
860b9ced | 31 | %define metadir /var/lib/dokuwiki/meta |
d045a0a5 | 32 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
711f0ba6 | 33 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
d045a0a5 | 34 | |
4f0d4331 ER |
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 | ||
d045a0a5 ER |
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 | |
860b9ced | 52 | %setup -qc |
90ea78de | 53 | mv *-%{plugin}-*/{.??*,*} . |
58e46b85 | 54 | %patch2 -p1 |
ce3f39eb | 55 | %patch3 -p1 |
a4d4cd54 | 56 | %patch4 -p1 |
4978bd8e | 57 | |
1d83f60d ER |
58 | # nothing to do with tests |
59 | rm -rf _test | |
90ea78de | 60 | rm .travis.yml |
1d83f60d | 61 | |
ab0be40f ER |
62 | # cleanup backups after patching |
63 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
64 | ||
a4d4cd54 ER |
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 | ||
d045a0a5 ER |
72 | %install |
73 | rm -rf $RPM_BUILD_ROOT | |
860b9ced | 74 | install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}} |
d045a0a5 | 75 | cp -a . $RPM_BUILD_ROOT%{plugindir} |
58185fea | 76 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README |
0b4d4d8b | 77 | # sqlite2: php-sqlite |
860b9ced | 78 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite |
0b4d4d8b ER |
79 | # sqlite3: php-pdo-sqlite |
80 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite3 | |
69e06802 | 81 | |
d045a0a5 ER |
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) | |
58185fea | 96 | %doc README |
d045a0a5 | 97 | %dir %{plugindir} |
93a728bd | 98 | %{plugindir}/*.css |
860b9ced | 99 | %{plugindir}/*.js |
d045a0a5 | 100 | %{plugindir}/*.php |
93a728bd | 101 | %{plugindir}/*.svg |
ab0be40f | 102 | %{plugindir}/*.txt |
90ea78de ER |
103 | %{plugindir}/admin |
104 | %{plugindir}/conf | |
105 | %{plugindir}/db | |
106 | %{plugindir}/helper | |
107 | %{plugindir}/syntax | |
860b9ced | 108 | %attr(660,http,http) %ghost %{metadir}/data.sqlite |
0b4d4d8b | 109 | %attr(660,http,http) %ghost %{metadir}/data.sqlite3 |