File dictd.spec of Package dictd

#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           dictd
Version:        1.12.1
Release:        1
License:        GPL-2.0+
Summary:        Electronic Online Dictionaries
Url:            http://www.dict.org
Group:          Productivity/Office/Dictionary
Source0:        %{name}-%{version}.tar.gz
Source2:        dictd.init
Source3:        colorit.conf
BuildRequires:  libmaa-devel
BuildRequires:  zlib-devel
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gcc
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
Requires(pre):  %insserv_prereq %fillup_prereq
%endif

%description
This package contains two programs. With dict, you have access to
powerful electronic dictionaries on the Internet. With dictd, you can
set up your own dictionary. To look up, for example, the word 'grunt',
just type "dict grunt" at a command line. See the man pages of dict and
dictd for details.

%package devel
Summary:        Development files for dictd
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
Development files for dictd (header files).

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
%make_install
install -D -m 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/dictd
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/colorit.conf
ln -sf /etc/init.d/dictd %{buildroot}%{_sbindir}/rcdictd

%post
%fillup_and_insserv dictd
touch %{_localstatedir}/log/dictd
chown nobody:nogroup %{_localstatedir}/log/dictd
chmod 644 %{_localstatedir}/log/dictd

%preun
%stop_on_removal dictd

%postun
%restart_on_update dictd
%insserv_cleanup
rm -rf %{_localstatedir}/log/dictd

%files
%defattr(-,root,root)
%doc ANNOUNCE COPYING ChangeLog NEWS README TODO example*
%doc doc/dicf.ms doc/rfc.ms doc/rfc2229.txt doc/security.doc
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/man1/*
%{_mandir}/man8/*
%config(noreplace) %{_sysconfdir}/colorit.conf
%config %{_sysconfdir}/init.d/dictd

%files devel
%defattr(-,root,root)
%{_includedir}/dict*

%changelog
openSUSE Build Service is sponsored by