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