]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/blob - dokuwiki-plugin-data.spec
- drop _interwiki and _map patches, can be achieved with type aliases now
[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 Patch2:         separator-style.patch
14 Patch3:         separate-rpmdb.patch
15 BuildRequires:  rpmbuild(macros) >= 1.520
16 BuildRequires:  unzip
17 Requires:       php-common >= 4:%{php_min_version}
18 Requires(triggerun):    sqlite
19 Requires:       dokuwiki >= 20090214b-5
20 Requires:       dokuwiki-plugin-sqlite
21 Requires:       php-pcre
22 BuildArch:      noarch
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %define         dokuconf        /etc/webapps/dokuwiki
26 %define         dokudir         /usr/share/dokuwiki
27 %define         metadir         /var/lib/dokuwiki/meta
28 %define         plugindir       %{dokudir}/lib/plugins/%{plugin}
29 %define         find_lang       %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot}
30
31 # no pear deps
32 %define         _noautopear     pear
33
34 # sqlite is dokuwiki-plugin-sqlite dep, not ours
35 %define         _noautophp      php-sqlite
36
37 # put it together for rpmbuild
38 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
39
40 %description
41 This plugin allows you to add structured data to any DokuWiki page.
42 Think about this data as additional named attributes. Those attributes
43 can then be queried and aggregated. The plugin is similar to what was
44 done here for the repository plugin but its internals are very
45 different to the repository plugin.
46
47 %prep
48 %setup -qc
49 mv *-%{plugin}-*/* .
50 %patch2 -p1
51 %patch3 -p1
52
53 version=$(awk '/date/{print $2}' plugin.info.txt)
54 if [ $(echo "$version" | tr -d -) != %{version} ]; then
55         : %%{version} mismatch
56         exit 1
57 fi
58
59 # cleanup backups after patching
60 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{plugindir},%{metadir}}
65 cp -a . $RPM_BUILD_ROOT%{plugindir}
66 touch $RPM_BUILD_ROOT%{metadir}/data.sqlite
67
68 # find locales
69 %find_lang %{name}.lang
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %post
75 # force css cache refresh
76 if [ -f %{dokuconf}/local.php ]; then
77         touch %{dokuconf}/local.php
78 fi
79
80 %triggerun -- %{name} < 20100322-0.5
81 # move to new location
82 mv /var/lib/dokuwiki/cache/dataplugin.sqlite %{metadir}/data.sqlite
83
84 # perform new indexes add manually
85 sqlite %{metadir}/data.sqlite <<'EOF'
86 CREATE TABLE opts (opt,val);
87 CREATE UNIQUE INDEX idx_opt ON opts(opt);
88 INSERT INTO opts VALUES ('dbversion', 1);
89 EOF
90 chown root:http %{metadir}/data.sqlite
91 chmod 660 %{metadir}/data.sqlite
92
93 %files -f %{name}.lang
94 %defattr(644,root,root,755)
95 %dir %{plugindir}
96 %{plugindir}/admin
97 %{plugindir}/syntax
98 %{plugindir}/conf
99 %{plugindir}/db
100 %{plugindir}/*.js
101 %{plugindir}/*.php
102 %{plugindir}/*.txt
103 %{plugindir}/*.css
104 %attr(660,http,http) %ghost %{metadir}/data.sqlite
This page took 0.040853 seconds and 3 git commands to generate.