]>
Commit | Line | Data |
---|---|---|
b2d8bea7 | 1 | %define plugin PLUGIN_NAME |
15f5410b ER |
2 | %define php_min_version 5.0.0 |
3 | %include /usr/lib/rpm/macros.php | |
b2d8bea7 SP |
4 | Summary: DokuWiki PLUGIN_NAME plugin |
5 | Summary(pl.UTF-8): Wtyczka PLUGIN_NAME dla DokuWiki | |
6 | Name: dokuwiki-plugin-%{plugin} | |
7 | Version: - | |
8 | Release: 0.1 | |
9 | License: GPL v2 | |
10 | Group: Applications/WWW | |
f945f4ae ER |
11 | Source0: http://github.com/splitbrain/%{name}/tarball/master#/%{plugin}-%{version}.tgz |
12 | Source0: https://github.com/dokufreaks/plugin-%{plugin}/tarball/master#/%{plugin}-%{version}.tgz | |
78c74a76 | 13 | # Source0-md5: - |
e97a75d5 | 14 | URL: http://www.dokuwiki.org/plugin:PLUGIN_NAME |
15f5410b | 15 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
5c5814f8 | 16 | BuildRequires: rpmbuild(macros) >= 1.520 |
4d6b11bb ER |
17 | # for %%undos macro |
18 | BuildRequires: rpmbuild(macros) >= 1.553 | |
b2d8bea7 | 19 | Requires: dokuwiki >= 20061106 |
f5615cba ER |
20 | # See https://www.dokuwiki.org/changes for detailed changed features |
21 | # plugin with .less support (Binky) | |
22 | Requires: dokuwiki >= 20131208 | |
15f5410b | 23 | Requires: php-common >= 4:%{php_min_version} |
b2d8bea7 SP |
24 | BuildArch: noarch |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
49e13f00 | 27 | %define dokuconf /etc/webapps/dokuwiki |
1eb9b51e | 28 | %define dokudir /usr/share/dokuwiki |
df76dd27 | 29 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
6aa26280 | 30 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
b2d8bea7 | 31 | |
15f5410b ER |
32 | # no pear deps |
33 | %define _noautopear pear | |
34 | ||
35 | # exclude optional php dependencies | |
36 | %define _noautophp php-someext | |
37 | ||
38 | # put it together for rpmbuild | |
39 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
40 | ||
b2d8bea7 SP |
41 | %description |
42 | Plugin for DokuWiki. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Wtyczka dla DokuWiki | |
46 | ||
47 | %prep | |
287c4299 | 48 | %setup -qc |
80d95dc9 | 49 | # for github urls: |
287c4299 ER |
50 | mv *-%{plugin}-*/* . |
51 | # for other zip files: | |
52 | mv %{plugin}/* . | |
53 | ||
8e79ff6a | 54 | version=$(awk '/^date/{print $2}' plugin.info.txt) |
827c2038 | 55 | version=$(cat VERSION) |
d506b490 | 56 | version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php) |
ba215711 | 57 | if [ "$(echo "$version" | tr -d -)" != %{version} ]; then |
6897586a | 58 | : %%{version} mismatch |
1cf391c3 ER |
59 | exit 1 |
60 | fi | |
b2d8bea7 SP |
61 | |
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
df76dd27 ER |
64 | install -d $RPM_BUILD_ROOT%{plugindir} |
65 | cp -a . $RPM_BUILD_ROOT%{plugindir} | |
f945f4ae | 66 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README |
80d95dc9 | 67 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{COPYING,README} |
827c2038 ER |
68 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{CREDITS,changelog} |
69 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{COPYING,README,VERSION} | |
b2d8bea7 | 70 | |
5c5814f8 | 71 | %find_lang %{name}.lang |
78c74a76 | 72 | |
b2d8bea7 SP |
73 | %clean |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
4d6b11bb | 76 | # use this post section if you package .css or .js files |
49e13f00 | 77 | %post |
4d6b11bb | 78 | # force js/css cache refresh |
49e13f00 ER |
79 | if [ -f %{dokuconf}/local.php ]; then |
80 | touch %{dokuconf}/local.php | |
81 | fi | |
82 | ||
78c74a76 | 83 | %files -f %{name}.lang |
b2d8bea7 SP |
84 | %defattr(644,root,root,755) |
85 | %doc README CREDITS changelog | |
df76dd27 | 86 | %dir %{plugindir} |
df76dd27 | 87 | %{plugindir}/*.css |
827c2038 ER |
88 | %{plugindir}/*.js |
89 | %{plugindir}/*.php | |
90 | %{plugindir}/*.txt | |
df76dd27 ER |
91 | %{plugindir}/conf |
92 | %{plugindir}/images |