]>
Commit | Line | Data |
---|---|---|
d045a0a5 | 1 | %define plugin data |
4f0d4331 ER |
2 | %define php_min_version 5.0.0 |
3 | %include /usr/lib/rpm/macros.php | |
d045a0a5 ER |
4 | Summary: DokuWiki Structured Data Plugin |
5 | Name: dokuwiki-plugin-%{plugin} | |
b0216a62 | 6 | Version: 20100608 |
cb5e42ad | 7 | Release: 1 |
d045a0a5 ER |
8 | License: GPL v2 |
9 | Group: Applications/WWW | |
4f0d4331 | 10 | Source0: http://github.com/splitbrain/dokuwiki-plugin-%{plugin}/zipball/master#/%{plugin}-%{version}.zip |
14319ec4 | 11 | # Source0-md5: 28a601cf6e20c7e8624db8113627a5af |
d045a0a5 | 12 | URL: http://wiki.splitbrain.org/plugin:data |
87d1921d | 13 | Patch0: interwiki.patch |
a9553456 | 14 | Patch1: helper-map.patch |
58e46b85 | 15 | Patch2: separator-style.patch |
d045a0a5 | 16 | BuildRequires: rpmbuild(macros) >= 1.520 |
5caf09b4 | 17 | BuildRequires: unzip |
4f0d4331 | 18 | Requires: php-common >= 4:%{php_min_version} |
860b9ced | 19 | Requires(triggerun): sqlite |
87d1921d | 20 | Requires: dokuwiki >= 20090214b-5 |
860b9ced | 21 | Requires: dokuwiki-plugin-sqlite |
4f0d4331 | 22 | Requires: php-pcre |
d045a0a5 ER |
23 | BuildArch: noarch |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %define dokuconf /etc/webapps/dokuwiki | |
69e06802 | 27 | %define dokudir /usr/share/dokuwiki |
860b9ced | 28 | %define metadir /var/lib/dokuwiki/meta |
d045a0a5 | 29 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
711f0ba6 | 30 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
d045a0a5 | 31 | |
4f0d4331 ER |
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 | ||
d045a0a5 ER |
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 | |
860b9ced ER |
49 | %setup -qc |
50 | mv *-%{plugin}-*/* . | |
87d1921d | 51 | %patch0 -p1 |
a9553456 | 52 | %patch1 -p1 |
58e46b85 | 53 | %patch2 -p1 |
87d1921d | 54 | |
ab0be40f | 55 | version=$(awk '/date/{print $2}' plugin.info.txt) |
4978bd8e ER |
56 | if [ $(echo "$version" | tr -d -) != %{version} ]; then |
57 | : %%{version} mismatch | |
b0216a62 | 58 | exit 1 |
4978bd8e ER |
59 | fi |
60 | ||
ab0be40f ER |
61 | # cleanup backups after patching |
62 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
63 | ||
d045a0a5 ER |
64 | %install |
65 | rm -rf $RPM_BUILD_ROOT | |
860b9ced | 66 | install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}} |
d045a0a5 | 67 | cp -a . $RPM_BUILD_ROOT%{plugindir} |
860b9ced | 68 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite |
69e06802 | 69 | |
d045a0a5 ER |
70 | # find locales |
71 | %find_lang %{name}.lang | |
72 | ||
73 | %clean | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %post | |
77 | # force css cache refresh | |
78 | if [ -f %{dokuconf}/local.php ]; then | |
79 | touch %{dokuconf}/local.php | |
80 | fi | |
81 | ||
860b9ced ER |
82 | %triggerun -- %{name} < 20100322-0.5 |
83 | # move to new location | |
84 | mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite | |
85 | ||
86 | # perform new indexes add manually | |
87 | sqlite %{metadir}/data.sqlite <<'EOF' | |
88 | CREATE TABLE opts (opt,val); | |
89 | CREATE UNIQUE INDEX idx_opt ON opts(opt); | |
90 | INSERT INTO opts VALUES ('dbversion', 1); | |
91 | EOF | |
92 | chown root:http %{metadir}/data.sqlite | |
93 | chmod 660 %{metadir}/data.sqlite | |
94 | ||
d045a0a5 ER |
95 | %files -f %{name}.lang |
96 | %defattr(644,root,root,755) | |
97 | %dir %{plugindir} | |
b0216a62 | 98 | %{plugindir}/admin |
d045a0a5 | 99 | %{plugindir}/syntax |
860b9ced ER |
100 | %{plugindir}/conf |
101 | %{plugindir}/db | |
102 | %{plugindir}/*.js | |
d045a0a5 | 103 | %{plugindir}/*.php |
ab0be40f | 104 | %{plugindir}/*.txt |
d045a0a5 | 105 | %{plugindir}/*.css |
860b9ced | 106 | %attr(660,http,http) %ghost %{metadir}/data.sqlite |