]>
Commit | Line | Data |
---|---|---|
0be7a20a TP |
1 | %define dictname dalf |
2 | Summary: Russian monolingual dictionary dalf for dictd | |
fbce6b72 | 3 | Summary(pl.UTF-8): Słownik rosyjsko-rosyjski dalf dla dictd |
0be7a20a TP |
4 | Name: dict-%{dictname} |
5 | Version: 1.0 | |
2b470b9a | 6 | Release: 4 |
0be7a20a TP |
7 | License: unknown |
8 | Group: Applications/Dictionaries | |
9 | Source0: http://www.chat.ru/~muller_dic/dalf.gz | |
9939714c | 10 | # Source0-md5: 395ca06b4e38399e1a91bf89d51ae289 |
0be7a20a TP |
11 | Patch0: %{dictname}.patch |
12 | URL: http://www.chat.ru/~muller_dic/ | |
13 | BuildRequires: dictfmt | |
14 | BuildRequires: dictzip | |
29869526 | 15 | BuildRequires: rpmbuild(macros) >= 1.268 |
0be7a20a | 16 | Requires: %{_sysconfdir}/dictd |
18f92dcb | 17 | Requires: dictd |
0be7a20a TP |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
19 | ||
20 | %description | |
a8f718ff TP |
21 | Russian monolingual dictionary for dictd encoded in koi8-r. Start |
22 | server with --locale ru_RU.KOI8-R option in order to use it. | |
0be7a20a | 23 | |
dfdcbc70 JR |
24 | %description -l pl.UTF-8 |
25 | Słownik rosyjsko-rosyjski dla dictd kodowany w koi8-r. Uruchom serwer | |
26 | z opcją --locale ru_RU.KOI8-R, żeby móc go używać. | |
0be7a20a | 27 | |
dfdcbc70 JR |
28 | %description -l ru.UTF-8 |
29 | Словарь Даля, переработанный из CD источника "Библиотека в Кармане". | |
0be7a20a TP |
30 | |
31 | %prep | |
3f166420 | 32 | %setup -q -c -T |
0be7a20a TP |
33 | %{__gzip} -dc %{SOURCE0} > dalf |
34 | %patch0 -p0 | |
35 | ||
36 | %build | |
37 | LC_ALL=ru_RU.KOI8-R perl -ne 'use locale; /^(.*?)[\.,;\?]* (.*)\n/; $def=$2; $word=$1; $word=~s/[\?,]+ /|/g; print ":".lc($word).":\n$def\n"' < dalf | \ | |
a8f718ff | 38 | dictfmt -j -u http://www.chat.ru/~muller_dic/ -s %{dictname} --locale ru_RU.KOI8-R --headword-separator \| %{dictname} |
0be7a20a TP |
39 | dictzip %{dictname}.dict |
40 | ||
41 | %install | |
42 | rm -rf $RPM_BUILD_ROOT | |
43 | install -d $RPM_BUILD_ROOT{%{_datadir}/dictd,%{_sysconfdir}/dictd} | |
44 | ||
45 | dictprefix=%{_datadir}/dictd/%{dictname} | |
46 | echo "# dalf russian monolingual dictionary | |
47 | database %{dictname} { | |
48 | data \"$dictprefix.dict.dz\" | |
49 | index \"$dictprefix.index\" | |
50 | }" > $RPM_BUILD_ROOT%{_sysconfdir}/dictd/%{dictname}.dictconf | |
51 | mv %{dictname}.* $RPM_BUILD_ROOT%{_datadir}/dictd | |
52 | ||
53 | %clean | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | ||
56 | %post | |
29869526 | 57 | %service -q dictd restart |
0be7a20a TP |
58 | |
59 | %postun | |
29869526 ER |
60 | if [ "$1" = 0 ]; then |
61 | %service -q dictd restart | |
0be7a20a TP |
62 | fi |
63 | ||
64 | %files | |
65 | %defattr(644,root,root,755) | |
18f92dcb | 66 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dictd/%{dictname}.dictconf |
0be7a20a | 67 | %{_datadir}/dictd/%{dictname}.* |