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