]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/blob - dokuwiki-plugin-data.spec
990a8426d5374af0d9b8c610a17e3d0e61dec8e7
[packages/dokuwiki-plugin-data.git] / dokuwiki-plugin-data.spec
1 %define         plugin          data
2 %define         php_min_version 5.0.0
3 %include        /usr/lib/rpm/macros.php
4 Summary:        DokuWiki Structured Data Plugin
5 Name:           dokuwiki-plugin-%{plugin}
6 Version:        20100608
7 Release:        3
8 License:        GPL v2
9 Group:          Applications/WWW
10 Source0:        http://github.com/splitbrain/dokuwiki-plugin-%{plugin}/zipball/master#/%{plugin}-%{version}.zip
11 # Source0-md5:  28a601cf6e20c7e8624db8113627a5af
12 URL:            http://wiki.splitbrain.org/plugin:data
13 Patch0:         interwiki.patch
14 Patch1:         helper-map.patch
15 Patch2:         separator-style.patch
16 Patch3:         separate-rpmdb.patch
17 BuildRequires:  rpmbuild(macros) >= 1.520
18 BuildRequires:  unzip
19 Requires:       php-common >= 4:%{php_min_version}
20 Requires(triggerun):    sqlite
21 Requires:       dokuwiki >= 20090214b-5
22 Requires:       dokuwiki-plugin-sqlite
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 %define         find_lang       %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
32
33 # no pear deps
34 %define         _noautopear     pear
35
36 # sqlite is dokuwiki-plugin-sqlite dep, not ours
37 %define         _noautophp      php-sqlite
38
39 # put it together for rpmbuild
40 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
41
42 %description
43 This plugin allows you to add structured data to any DokuWiki page.
44 Think about this data as additional named attributes. Those attributes
45 can then be queried and aggregated. The plugin is similar to what was
46 done here for the repository plugin but its internals are very
47 different to the repository plugin.
48
49 %prep
50 %setup -qc
51 mv *-%{plugin}-*/* .
52 %patch0 -p1
53 %patch1 -p1
54 %patch2 -p1
55 %patch3 -p1
56
57 version=$(awk '/date/{print $2}' plugin.info.txt)
58 if [ $(echo "$version" | tr -d -) != %{version} ]; then
59         : %%{version} mismatch
60         exit 1
61 fi
62
63 # cleanup backups after patching
64 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
69 cp -a . $RPM_BUILD_ROOT%{plugindir}
70 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
71
72 # find locales
73 %find_lang %{name}.lang
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %post
79 # force css cache refresh
80 if [ -f %{dokuconf}/local.php ]; then
81         touch %{dokuconf}/local.php
82 fi
83
84 %triggerun -- %{name} < 20100322-0.5
85 # move to new location
86 mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite
87
88 # perform new indexes add manually
89 sqlite %{metadir}/data.sqlite <<'EOF'
90 CREATE TABLE opts (opt,val);
91 CREATE UNIQUE INDEX idx_opt ON opts(opt);
92 INSERT INTO opts VALUES ('dbversion', 1);
93 EOF
94 chown root:http %{metadir}/data.sqlite
95 chmod 660 %{metadir}/data.sqlite
96
97 %files -f %{name}.lang
98 %defattr(644,root,root,755)
99 %dir %{plugindir}
100 %{plugindir}/admin
101 %{plugindir}/syntax
102 %{plugindir}/conf
103 %{plugindir}/db
104 %{plugindir}/*.js
105 %{plugindir}/*.php
106 %{plugindir}/*.txt
107 %{plugindir}/*.css
108 %attr(660,http,http) %ghost %{metadir}/data.sqlite
This page took 0.10983 seconds and 2 git commands to generate.