]>
Commit | Line | Data |
---|---|---|
d045a0a5 ER |
1 | %define plugin data |
2 | Summary: DokuWiki Structured Data Plugin | |
3 | Name: dokuwiki-plugin-%{plugin} | |
b0216a62 ER |
4 | Version: 20100608 |
5 | Release: 0.1 | |
d045a0a5 ER |
6 | License: GPL v2 |
7 | Group: Applications/WWW | |
b0216a62 ER |
8 | Source0: http://github.com/splitbrain/%{name}/zipball/master#/%{plugin}-%{version}.zip |
9 | # Source0-md5: f79901b38df2205eb13720b996336e9c | |
d045a0a5 | 10 | URL: http://wiki.splitbrain.org/plugin:data |
87d1921d | 11 | Patch0: interwiki.patch |
a9553456 | 12 | Patch1: helper-map.patch |
58e46b85 | 13 | Patch2: separator-style.patch |
d045a0a5 | 14 | BuildRequires: rpmbuild(macros) >= 1.520 |
5caf09b4 | 15 | BuildRequires: unzip |
860b9ced | 16 | Requires(triggerun): sqlite |
87d1921d | 17 | Requires: dokuwiki >= 20090214b-5 |
860b9ced | 18 | Requires: dokuwiki-plugin-sqlite |
d045a0a5 ER |
19 | BuildArch: noarch |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %define dokuconf /etc/webapps/dokuwiki | |
69e06802 | 23 | %define dokudir /usr/share/dokuwiki |
860b9ced | 24 | %define metadir /var/lib/dokuwiki/meta |
d045a0a5 | 25 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
711f0ba6 | 26 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
d045a0a5 ER |
27 | |
28 | %description | |
29 | This plugin allows you to add structured data to any DokuWiki page. | |
30 | Think about this data as additional named attributes. Those attributes | |
31 | can then be queried and aggregated. The plugin is similar to what was | |
32 | done here for the repository plugin but its internals are very | |
33 | different to the repository plugin. | |
34 | ||
35 | %prep | |
860b9ced ER |
36 | %setup -qc |
37 | mv *-%{plugin}-*/* . | |
87d1921d | 38 | %patch0 -p1 |
a9553456 | 39 | %patch1 -p1 |
58e46b85 | 40 | %patch2 -p1 |
87d1921d | 41 | |
ab0be40f | 42 | version=$(awk '/date/{print $2}' plugin.info.txt) |
4978bd8e ER |
43 | if [ $(echo "$version" | tr -d -) != %{version} ]; then |
44 | : %%{version} mismatch | |
b0216a62 | 45 | exit 1 |
4978bd8e ER |
46 | fi |
47 | ||
ab0be40f ER |
48 | # cleanup backups after patching |
49 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
50 | ||
d045a0a5 ER |
51 | %install |
52 | rm -rf $RPM_BUILD_ROOT | |
860b9ced | 53 | install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}} |
d045a0a5 | 54 | cp -a . $RPM_BUILD_ROOT%{plugindir} |
860b9ced | 55 | touch $RPM_BUILD_ROOT%{metadir}/data.sqlite |
69e06802 | 56 | |
d045a0a5 ER |
57 | # find locales |
58 | %find_lang %{name}.lang | |
59 | ||
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %post | |
64 | # force css cache refresh | |
65 | if [ -f %{dokuconf}/local.php ]; then | |
66 | touch %{dokuconf}/local.php | |
67 | fi | |
68 | ||
860b9ced ER |
69 | %triggerun -- %{name} < 20100322-0.5 |
70 | # move to new location | |
71 | mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite | |
72 | ||
73 | # perform new indexes add manually | |
74 | sqlite %{metadir}/data.sqlite <<'EOF' | |
75 | CREATE TABLE opts (opt,val); | |
76 | CREATE UNIQUE INDEX idx_opt ON opts(opt); | |
77 | INSERT INTO opts VALUES ('dbversion', 1); | |
78 | EOF | |
79 | chown root:http %{metadir}/data.sqlite | |
80 | chmod 660 %{metadir}/data.sqlite | |
81 | ||
d045a0a5 ER |
82 | %files -f %{name}.lang |
83 | %defattr(644,root,root,755) | |
84 | %dir %{plugindir} | |
b0216a62 | 85 | %{plugindir}/admin |
d045a0a5 | 86 | %{plugindir}/syntax |
860b9ced ER |
87 | %{plugindir}/conf |
88 | %{plugindir}/db | |
89 | %{plugindir}/*.js | |
d045a0a5 | 90 | %{plugindir}/*.php |
ab0be40f | 91 | %{plugindir}/*.txt |
d045a0a5 | 92 | %{plugindir}/*.css |
860b9ced | 93 | %attr(660,http,http) %ghost %{metadir}/data.sqlite |