File dictd.spec of Package dictd
#
# spec file for package dictd
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define maa_ver 1.1.1
Name: dictd
BuildRequires: bison flex pam-devel zlib-devel
Url: http://www.dict.org
License: GPL v2 or later
Group: Productivity/Office/Dictionary
AutoReqProv: on
Summary: Electronic Online Dictionaries
Version: 1.11.1
Release: 1
Source0: %{name}-%{version}.tar.bz2
Source1: libmaa-%{maa_ver}.tar.bz2
Source2: dictd.init
Source3: colorit.conf
Patch0: %{name}-%{version}.patch
Patch1: libmaa-%{maa_ver}.patch
PreReq: %insserv_prereq %fillup_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define separate_maa 0
%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.
%if %{separate_maa}
%package -n libmaa1
Summary: Library providing many low-level data structures
Group: System/Libraries/C and C++
Version: %{maa_ver}
%description -n libmaa1
The libmaa library provides many low-level data structures which are
helpful for writing compilers, including hash tables, sets, lists,
debugging support, and memory management. Although libmaa was designed
and implemented as a foundation for the kheperalong, the data structures
are generally applicable to a wide range of programming problems.
The memory management routines are especially helpful for improving the
performance of memory-intensive applications.
%package -n libmaa-devel
Summary: Development files for libmaa
Group: Development/Libraries/C and C++
Version: %{maa_ver}
Requires: libmaa1 = %{maa_ver}
%description -n libmaa-devel
Development files for libmaa
%endif
%prep
%setup -q -a 1
%patch0
cd libmaa-%{maa_ver}
%patch1
%build
cd libmaa-%{maa_ver}
%configure \
--enable-dictorg
make %{?jobs:-j%jobs}
cd ..
export CFLAGS="$RPM_OPT_FLAGS -Ilibmaa-%{maa_ver}"
export LDFLAGS="$LDFLAGS -L./libmaa-%{maa_ver}/.libs"
%configure
make %{?jobs:-j%jobs}
%install
%makeinstall
install -D -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/dictd
install -D -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/colorit.conf
ln -sf /etc/init.d/dictd $RPM_BUILD_ROOT%{_sbindir}/rcdictd
%if %{separate_maa}
cd libmaa-%{maa_ver}
%makeinstall
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%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
%if %{separate_maa}
%post -n libmaa1 -p /sbin/ldconfig
%postun -n libmaa1 -p /sbin/ldconfig
%endif
%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
%{_includedir}/dict*
%if %{separate_maa}
%files -n libmaa1
%defattr(-,root,root)
%{_libdir}/*.so.*
%files -n libmaa-devel
%defattr(-,root,root)
%{_includedir}/maa*
%{_libdir}/*.so
%endif
%changelog