File dictd.spec of Package dictd

#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

%define libmaa_soname 3

Name:           dictd
Version:        1.12.1
Release:        1
License:        GPLv2+
Summary:        Electronic Online Dictionaries
Url:            http://www.dict.org
Group:          Productivity/Office/Dictionary
Source0:        %{name}-%{version}.tar.bz2
Source1:        dictd.init
Source2:        colorit.conf
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  libtool
BuildRequires:  libmaa-devel
BuildRequires:  pam-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(pre):  %insserv_prereq %fillup_prereq

%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 -n %{name}-devel
Summary:        Development files for dictd
Group:          Development/Libraries/C and C++
Requires:       libmaa%{libmaa_soname} = %{version}

%description -n %{name}-devel
This RPM contains the development files for dictd


%prep
%setup -q

%build
%configure
make %{?_smp_mflags}


%install
%make_install
install -D -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/dictd
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/colorit.conf
ln -sf /etc/init.d/dictd %{buildroot}%{_sbindir}/rcdictd
echo "server dict.org" > %{buildroot}%{_sysconfdir}/dict.conf

%clean
rm -rf %{buildroot}

%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
%config %{_sysconfdir}/dict.conf

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

%changelog
openSUSE Build Service is sponsored by