]>
Commit | Line | Data |
---|---|---|
1 | %define subver 2017-02-25 | |
2 | %define ver %(echo %{subver} | tr -d -) | |
3 | %define plugin sqlite | |
4 | %define php_min_version 5.3.0 | |
5 | %include /usr/lib/rpm/macros.php | |
6 | Summary: DokuWiki helper plugin to easily access a SQLite database | |
7 | Name: dokuwiki-plugin-%{plugin} | |
8 | Version: %{ver} | |
9 | Release: 1 | |
10 | License: GPL v2 | |
11 | Group: Applications/WWW | |
12 | Source0: https://github.com/cosmocode/sqlite/archive/%{subver}/%{plugin}-%{version}.tar.gz | |
13 | # Source0-md5: 8eee1dac5d244a237ebbf225e5c82fcf | |
14 | URL: https://www.dokuwiki.org/plugin:sqlite | |
15 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
16 | BuildRequires: rpmbuild(macros) >= 1.520 | |
17 | BuildRequires: unzip | |
18 | Requires: dokuwiki >= 20140505 | |
19 | Requires: php(core) >= %{php_min_version} | |
20 | Requires: php(date) | |
21 | Requires: php(pcre) | |
22 | # you should pick one: | |
23 | Suggests: php(pdo-sqlite) | |
24 | Suggests: php(sqlite) | |
25 | Conflicts: dokuwiki-plugin-data < 20120624 | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %define dokuconf /etc/webapps/dokuwiki | |
30 | %define dokudir /usr/share/dokuwiki | |
31 | %define plugindir %{dokudir}/lib/plugins/%{plugin} | |
32 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} | |
33 | ||
34 | %description | |
35 | DokuWiki helper plugin to easily access a SQLite database for other | |
36 | DokuWiki plugins. | |
37 | ||
38 | The plugin comes with a simple admin interface where you can run your | |
39 | own SQL queries against any of the available databases. | |
40 | ||
41 | %prep | |
42 | %setup -qc | |
43 | mv %{plugin}-*/{.??*,*} . | |
44 | ||
45 | rm .travis.yml | |
46 | ||
47 | %build | |
48 | version=$(awk '/date/{print $2}' plugin.info.txt) | |
49 | if [ "$(echo "$version" | tr -d -)" != %{version} ]; then | |
50 | : %%{version} mismatch | |
51 | exit 1 | |
52 | fi | |
53 | ||
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | install -d $RPM_BUILD_ROOT%{plugindir} | |
57 | cp -a . $RPM_BUILD_ROOT%{plugindir} | |
58 | %{__rm} -r $RPM_BUILD_ROOT%{plugindir}/_test | |
59 | %{__rm} $RPM_BUILD_ROOT%{plugindir}/README | |
60 | ||
61 | # find locales | |
62 | %find_lang %{name}.lang | |
63 | ||
64 | %clean | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %post | |
68 | # force css cache refresh | |
69 | if [ -f %{dokuconf}/local.php ]; then | |
70 | touch %{dokuconf}/local.php | |
71 | fi | |
72 | ||
73 | %files -f %{name}.lang | |
74 | %defattr(644,root,root,755) | |
75 | %doc README | |
76 | %dir %{plugindir} | |
77 | %{plugindir}/*.txt | |
78 | %{plugindir}/*.css | |
79 | %{plugindir}/*.php | |
80 | %{plugindir}/db.sql | |
81 | %{plugindir}/classes |