]> git.pld-linux.org Git - packages/dict-dalf.git/blob - dict-dalf.spec
8cf7e0ae7adf7256ae6e7ec4f4e2284171e7302d
[packages/dict-dalf.git] / dict-dalf.spec
1 %define         dictname dalf
2 Summary:        Russian monolingual dictionary dalf for dictd
3 Summary(pl):    S³ownik rosyjsko-rosyjski dalf dla dictd
4 Name:           dict-%{dictname}
5 Version:        1.0
6 Release:        1
7 License:        unknown
8 Group:          Applications/Dictionaries
9 Source0:        http://www.chat.ru/~muller_dic/dalf.gz
10 Patch0:         %{dictname}.patch
11 URL:            http://www.chat.ru/~muller_dic/
12 BuildRequires:  dictfmt
13 BuildRequires:  dictzip
14 Requires:       dictd
15 Requires:       %{_sysconfdir}/dictd
16 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17
18 %description
19 Russian monolingual dictionary for dictd encoded in koi8-r. Start
20 server with --locale ru_RU.KOI8-R option in order to use it.
21
22 %description -l pl
23 S³ownik rosyjsko-rosyjski dla dictd kodowany w koi8-r. Uruchom serwer
24 z opcj± --locale ru_RU.KOI8-R, ¿eby móc go u¿ywaæ.
25
26 %description -l ru
27 óÌÏ×ÁÒØ äÁÌÑ, ÐÅÒÅÒÁÂÏÔÁÎÎÙÊ ÉÚ CD ÉÓÔÏÞÎÉËÁ "âÉÂÌÉÏÔÅËÁ × ëÁÒÍÁÎÅ".
28
29 %prep
30 %setup -c -T
31 %{__gzip} -dc %{SOURCE0} > dalf
32 %patch0 -p0
33
34 %build
35 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 | \
36         dictfmt -j -u http://www.chat.ru/~muller_dic/ -s %{dictname} --locale ru_RU.KOI8-R --headword-separator \| %{dictname}
37 dictzip %{dictname}.dict
38
39 %install
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_datadir}/dictd,%{_sysconfdir}/dictd}
42
43 dictprefix=%{_datadir}/dictd/%{dictname}
44 echo "# dalf russian monolingual dictionary
45 database %{dictname} {
46         data  \"$dictprefix.dict.dz\"
47         index \"$dictprefix.index\"
48 }" > $RPM_BUILD_ROOT%{_sysconfdir}/dictd/%{dictname}.dictconf
49 mv %{dictname}.* $RPM_BUILD_ROOT%{_datadir}/dictd
50
51 %clean
52 rm -rf $RPM_BUILD_ROOT
53
54 %post
55 if [ -f /var/lock/subsys/dictd ]; then
56         /etc/rc.d/init.d/dictd restart 1>&2
57 fi
58
59 %postun
60 if [ -f /var/lock/subsys/dictd ]; then
61         /etc/rc.d/init.d/dictd restart 1>&2 || true
62 fi
63
64 %files
65 %defattr(644,root,root,755)
66 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/dictd/%{dictname}.dictconf
67 %{_datadir}/dictd/%{dictname}.*
This page took 0.059056 seconds and 2 git commands to generate.