]>
Commit | Line | Data |
---|---|---|
1 | %define subver 2017-03-08 | |
2 | %define ver %(echo %{subver} | tr -d -) | |
3 | %define plugin redirect | |
4 | %define php_min_version 5.3.0 | |
5 | %include /usr/lib/rpm/macros.php | |
6 | Summary: DokuWiki redirect plugin | |
7 | Name: dokuwiki-plugin-%{plugin} | |
8 | Version: %{ver} | |
9 | Release: 1 | |
10 | License: GPL v2 | |
11 | Group: Applications/WWW | |
12 | Source0: https://github.com/splitbrain/dokuwiki-plugin-redirect/archive/%{subver}/%{plugin}-%{subver}.tar.gz | |
13 | # Source0-md5: 99a8d76dc828f9f0b6bf4b91d7bb0ab2 | |
14 | Patch0: confdir.patch | |
15 | URL: https://www.dokuwiki.org/plugin:redirect | |
16 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
17 | BuildRequires: rpmbuild(macros) >= 1.520 | |
18 | Requires: dokuwiki >= 20131208 | |
19 | Requires: php(core) >= %{php_min_version} | |
20 | Requires: php(pcre) | |
21 | BuildArch: noarch | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %define dokuconf /etc/webapps/dokuwiki | |
25 | %define dokudir /usr/share/dokuwiki | |
26 | %define plugindir %{dokudir}/lib/plugins/%{plugin} | |
27 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} | |
28 | ||
29 | %description | |
30 | Redirects page accesses to other pages or external sites using a | |
31 | central configuration file. | |
32 | ||
33 | %prep | |
34 | %setup -qc | |
35 | mv *-%{plugin}-*/* . | |
36 | %patch0 -p1 | |
37 | ||
38 | %build | |
39 | version=$(awk '/^date/{print $2}' plugin.info.txt) | |
40 | if [ "$(echo "$version" | tr -d -)" != %{version} ]; then | |
41 | : %%{version} mismatch | |
42 | exit 1 | |
43 | fi | |
44 | ||
45 | %install | |
46 | rm -rf $RPM_BUILD_ROOT | |
47 | install -d $RPM_BUILD_ROOT%{plugindir} | |
48 | cp -a . $RPM_BUILD_ROOT%{plugindir} | |
49 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README | |
50 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/*/.gitignore | |
51 | ||
52 | install -d $RPM_BUILD_ROOT%{dokuconf} | |
53 | touch $RPM_BUILD_ROOT%{dokuconf}/%{plugin}.conf | |
54 | ||
55 | %find_lang %{name}.lang | |
56 | ||
57 | %clean | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | ||
60 | %files -f %{name}.lang | |
61 | %defattr(644,root,root,755) | |
62 | %doc README | |
63 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{dokuconf}/%{plugin}.conf | |
64 | %dir %{plugindir} | |
65 | %{plugindir}/*.php | |
66 | %{plugindir}/*.svg | |
67 | %{plugindir}/*.txt | |
68 | %{plugindir}/conf |