]> git.pld-linux.org Git - packages/dictd.git/blob - dictd.spec
- /etc/dictd.conf is autogenerated from /etc/dictd/* files
[packages/dictd.git] / dictd.spec
1 Summary:        Dictionary database server
2 Name:           dictd
3 Version:        1.5.0
4 Release:        3
5 License:        GPL
6 Group:          Daemons
7 Group(pl):      Serwery
8 URL:            http://www.dict.org/
9 Source0:        ftp://ftp.dict.org/pub/dict/%{name}-%{version}.tar.gz
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 Requires:       /bin/cat
13 Requires:       /bin/ls
14 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15
16 %description 
17 Server for the Dictionary Server Protocol (DICT), a TCP transaction
18 based query/response protocol that allows a client to access
19 dictionary definitions from a set of natural language dictionary
20 databases.
21
22 %package        -n dict
23 Summary:        DICT Protocol Client
24 Group:          Applications/Networking
25 Group(pl):      Aplikacje/Sieciowe
26
27 %description -n dict
28 Client for the Dictionary Server Protocol (DICT), a TCP transaction
29 based query/response protocol that provides access to dictionary
30 definitions from a set of natural language dictionary databases.
31
32 %package        -n dictzip
33 Summary:        Compress (or expand) files, allowing random access
34 Group:          Utilities/Archiving
35 Group(pl):      Narzêdzia/Archiwizacja
36
37 %description -n dictzip
38 dictzip compresses files using the gzip(1) algorithm (LZ77) in a
39 manner which is completely compatible with the gzip file format. An
40 extension to the gzip file format (Extra Field, described in 2.3.1.1
41 of RFC 1952) allows extra data to be stored in the header of a
42 compressed file. Dictd, the DICT protocol dictionary server will make
43 use of this data to perform pseudo-random access on the file.
44
45 %prep
46 %setup -q -n %{name}-%{version}
47
48 %build
49 # --without-local-zlib option gives no effect. Usage of zlib from dictd tarball 
50 # is hardcoded in configure. 
51
52 # TODO: 
53 # - patch needed instead of use -DUID_NOBODY=`id -u nobody`
54 #
55 %configure --with-cflags="-DUID_NOBODY=`id -u nobody` $RPM_OPT_FLAGS"
56 %{__make}
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_bindir},%{_sbindir}} \
61            $RPM_BUILD_ROOT{%{_datadir}/dictd,%{_mandir}/man{1,8}}
62
63 for f in dict dictzip; do
64         install -s $f $RPM_BUILD_ROOT/%{_bindir}
65         gzip -9nf $f.1
66         install $f.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1
67 done 
68
69 install -s dictd $RPM_BUILD_ROOT/%{_sbindir}
70 gzip -9nf dictd.8
71 install dictd.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8
72
73 echo "server localhost" > dict.conf
74 echo -e "access {\n\tallow localhost\n\tdeny *\n}\n" > dictd.conf 
75 install dict.conf dictd.conf $RPM_BUILD_ROOT%{_sysconfdir}
76
77 mkdir $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
78 install %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}-main.conf
79 touch %{buildroot}%{_sysconfdir}/%{name}.conf
80 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
81 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
82
83 mv -f doc/security.doc security.txt
84 gzip -9nf {ANNOUNCE,ChangeLog,README,TODO,%{name}.conf,example*.conf,example.site,security.txt}
85 gzip -9nf example.dictrc
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %post
91 /sbin/chkconfig --add %{name}
92 if [ -f /var/lock/subsystem/%{name} ]; then
93         /etc/rc.d/init.d/%{name} restart >&2
94 else
95         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
96 fi
97     
98 %preun
99 if [ $1 = 0 ]; then
100         /sbin/chkconfig --del %{name}
101         /etc/rc.d/init.d/%{name} stop >&2 || true
102 fi
103
104 %files
105 %defattr(644,root,root,755)
106 %attr(750,root,root) %dir %{_sysconfdir}/%{name}
107 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/%{name}-main.conf
108 %attr(640,root,root) %verify(not size mtime md5) %{_sysconfdir}/%{name}.conf
109 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/%{name}
110 %attr(754,root,root) /etc/rc.d/init.d/%{name}
111 %attr(755,root,root) %{_sbindir}/%{name}
112 %dir %{_datadir}/dictd
113 %{_mandir}/man8/%{name}*
114 %doc {ANNOUNCE,ChangeLog,README,TODO,%{name}.conf,example*.conf,example.site,security.txt}.gz
115
116 %files -n dict
117 %defattr(644,root,root,755)
118 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/dict.conf
119 %attr(755,root,root) %{_bindir}/dict
120 %{_mandir}/man1/dict.1.gz
121
122 %files -n dictzip
123 %defattr(644,root,root,755)
124 %attr(755,root,root) %{_bindir}/dictzip
125 %{_mandir}/man1/dictzip.1.gz
This page took 0.11938 seconds and 4 git commands to generate.