]>
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 |
15f5410b | 20 | Requires: php-common >= 4:%{php_min_version} |
b2d8bea7 SP |
21 | BuildArch: noarch |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
49e13f00 | 24 | %define dokuconf /etc/webapps/dokuwiki |
1eb9b51e | 25 | %define dokudir /usr/share/dokuwiki |
df76dd27 | 26 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
6aa26280 | 27 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
b2d8bea7 | 28 | |
15f5410b ER |
29 | # no pear deps |
30 | %define _noautopear pear | |
31 | ||
32 | # exclude optional php dependencies | |
33 | %define _noautophp php-someext | |
34 | ||
35 | # put it together for rpmbuild | |
36 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
37 | ||
b2d8bea7 SP |
38 | %description |
39 | Plugin for DokuWiki. | |
40 | ||
41 | %description -l pl.UTF-8 | |
42 | Wtyczka dla DokuWiki | |
43 | ||
44 | %prep | |
287c4299 | 45 | %setup -qc |
80d95dc9 | 46 | # for github urls: |
287c4299 ER |
47 | mv *-%{plugin}-*/* . |
48 | # for other zip files: | |
49 | mv %{plugin}/* . | |
50 | ||
8e79ff6a | 51 | version=$(awk '/^date/{print $2}' plugin.info.txt) |
827c2038 | 52 | version=$(cat VERSION) |
d506b490 | 53 | version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php) |
ba215711 | 54 | if [ "$(echo "$version" | tr -d -)" != %{version} ]; then |
6897586a | 55 | : %%{version} mismatch |
1cf391c3 ER |
56 | exit 1 |
57 | fi | |
b2d8bea7 SP |
58 | |
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
df76dd27 ER |
61 | install -d $RPM_BUILD_ROOT%{plugindir} |
62 | cp -a . $RPM_BUILD_ROOT%{plugindir} | |
f945f4ae | 63 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README |
80d95dc9 | 64 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{COPYING,README} |
827c2038 ER |
65 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{CREDITS,changelog} |
66 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/{COPYING,README,VERSION} | |
b2d8bea7 | 67 | |
5c5814f8 | 68 | %find_lang %{name}.lang |
78c74a76 | 69 | |
b2d8bea7 SP |
70 | %clean |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
4d6b11bb | 73 | # use this post section if you package .css or .js files |
49e13f00 | 74 | %post |
4d6b11bb | 75 | # force js/css cache refresh |
49e13f00 ER |
76 | if [ -f %{dokuconf}/local.php ]; then |
77 | touch %{dokuconf}/local.php | |
78 | fi | |
79 | ||
78c74a76 | 80 | %files -f %{name}.lang |
b2d8bea7 SP |
81 | %defattr(644,root,root,755) |
82 | %doc README CREDITS changelog | |
df76dd27 | 83 | %dir %{plugindir} |
df76dd27 | 84 | %{plugindir}/*.css |
827c2038 ER |
85 | %{plugindir}/*.js |
86 | %{plugindir}/*.php | |
87 | %{plugindir}/*.txt | |
df76dd27 ER |
88 | %{plugindir}/conf |
89 | %{plugindir}/images |