]> git.pld-linux.org Git - packages/dict-dalf.git/blob - dict-dalf.spec
- release 4
[packages/dict-dalf.git] / dict-dalf.spec
1 %define         dictname dalf
2 Summary:        Russian monolingual dictionary dalf for dictd
3 Summary(pl.UTF-8):      Słownik rosyjsko-rosyjski dalf dla dictd
4 Name:           dict-%{dictname}
5 Version:        1.0
6 Release:        4
7 License:        unknown
8 Group:          Applications/Dictionaries
9 Source0:        http://www.chat.ru/~muller_dic/dalf.gz
10 # Source0-md5:  395ca06b4e38399e1a91bf89d51ae289
11 Patch0:         %{dictname}.patch
12 URL:            http://www.chat.ru/~muller_dic/
13 BuildRequires:  dictfmt
14 BuildRequires:  dictzip
15 BuildRequires:  rpmbuild(macros) >= 1.268
16 Requires:       %{_sysconfdir}/dictd
17 Requires:       dictd
18 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19
20 %description
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.
23
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ć.
27
28 %description -l ru.UTF-8
29 Словарь Даля, переработанный из CD источника "Библиотека в Кармане".
30
31 %prep
32 %setup -q -c -T
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 | \
38         dictfmt -j -u http://www.chat.ru/~muller_dic/ -s %{dictname} --locale ru_RU.KOI8-R --headword-separator \| %{dictname}
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
57 %service -q dictd restart
58
59 %postun
60 if [ "$1" = 0 ]; then
61         %service -q dictd restart
62 fi
63
64 %files
65 %defattr(644,root,root,755)
66 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dictd/%{dictname}.dictconf
67 %{_datadir}/dictd/%{dictname}.*
This page took 0.062761 seconds and 3 git commands to generate.