ferdnyc / rpms / dictd

Forked from rpms/dictd 5 years ago
Clone
584868b
%if 0%{?rhel} > 6 || 0%{?fedora} >= 16
584868b
%bcond_with         fedora
584868b
%bcond_without      systemd
584868b
%else
584868b
%bcond_without      fedora
584868b
%bcond_with         systemd
584868b
%endif
667ca66
%global _hardened_build 1
3383e32
# Do no change username -- hardcoded in dictd.c
3383e32
%global username    dictd
3383e32
%global homedir     %{_datadir}/dict/dictd
54de9ca
%global selinux_variants mls targeted
775ee60
%define libmaaVersion 1.3.2
8695de5
4ecd3ce
Summary:   DICT protocol (RFC 2229) server and command-line client
6e04226
Name:      dictd
775ee60
Version:   1.12.1
5b81aa8
Release:   15%{?dist}
1f381d5
License:   GPL+ and zlib and MIT
6e04226
Group:     Applications/Internet
39a2f81
Source0:   http://downloads.sourceforge.net/dict/%{name}-%{version}.tar.gz
0f15cec
Source1:   dictd.service
77e962c
Source2:   libmaa-%{libmaaVersion}.tar.gz
54de9ca
Source3:   dictd2.te
54de9ca
Source4:   dictd3.te
54de9ca
Source5:   dictd4.te
54de9ca
Source6:   dictd5.te
54de9ca
Source7:   dictd6.te
54de9ca
Source8:   dictd7.te
584868b
Source9:   dictd.init
667ca66
Patch0:    dictd-1.12.1-unused-return.patch
6e04226
URL:       http://www.dict.org/
8695de5
8695de5
BuildRequires:  flex bison libtool libtool-ltdl-devel byacc
584868b
BuildRequires:  libdbi-devel, zlib-devel, gawk
584868b
%if %{with systemd}
584868b
BuildRequires:  systemd
584868b
%endif
54de9ca
BuildRequires:	checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp
55d9acc
Requires(pre):  shadow-utils
cvsdist 5a11386
cvsdist 5a11386
%description
cvsdist 5a11386
Command-line client for the DICT protocol.  The Dictionary Server
cvsdist 5a11386
Protocol (DICT) is a TCP transaction based query/response protocol that
cvsdist 5a11386
allows a client to access dictionary definitions from a set of natural
cvsdist 5a11386
language dictionary databases.
cvsdist 5a11386
4ecd3ce
%package server
4ecd3ce
Summary: Server for the Dictionary Server Protocol (DICT)
4ecd3ce
Group: System Environment/Daemons
584868b
%if %{with systemd}
8695de5
Requires(post): systemd
8695de5
Requires(preun): systemd
8695de5
Requires(postun): systemd
584868b
%else
584868b
Requires(post):  chkconfig
584868b
Requires(preun): chkconfig
584868b
Requires(postun): initscripts
584868b
%endif
54de9ca
%if "%{_selinux_policy_version}" != ""
54de9ca
Requires:       selinux-policy >= %{_selinux_policy_version}
54de9ca
%endif
54de9ca
4ecd3ce
%description server
4ecd3ce
A server for the DICT protocol. You need to install dictd-usable databases
584868b
before you can use this server. Those can be found p.e. at
4ecd3ce
ftp://ftp.dict.org/pub/dict/pre/
4ecd3ce
More information can be found in the INSTALL file in this package.
4ecd3ce
cvsdist 5a11386
%prep
cvsdist 5a11386
%setup -q
77e962c
tar xzf %{SOURCE2}
77e962c
mv libmaa-%{libmaaVersion} libmaa
667ca66
%patch0 -p1
54de9ca
mkdir SELinux
54de9ca
cp -p %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} SELinux
cvsdist 5a11386
cvsdist 5a11386
%build
667ca66
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
667ca66
export LDFLAGS="%{?__global_ldflags}" CPPFLAGS="$RPM_OPT_FLAGS -fPIC"
4ecd3ce
pushd libmaa
775ee60
# Required for aarch64 support:
8695de5
%configure
8695de5
make %{?_smp_mflags}
4ecd3ce
popd
4ecd3ce
54de9ca
cd SELinux
54de9ca
for selinuxvariant in %{selinux_variants}
54de9ca
do
54de9ca
  make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
54de9ca
  mv dictd2.pp dictd2.pp.${selinuxvariant}
54de9ca
  mv dictd3.pp dictd3.pp.${selinuxvariant}
54de9ca
  mv dictd4.pp dictd4.pp.${selinuxvariant}
54de9ca
  mv dictd5.pp dictd5.pp.${selinuxvariant}
54de9ca
  mv dictd6.pp dictd6.pp.${selinuxvariant}
54de9ca
  mv dictd7.pp dictd7.pp.${selinuxvariant}
54de9ca
  make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
54de9ca
done
54de9ca
cd -
54de9ca
667ca66
export LDFLAGS="%{?__global_ldflags} -Llibmaa/.libs" CPPFLAGS="-Ilibmaa $RPM_OPT_FLAGS -fPIC"
4ecd3ce
%configure --enable-dictorg --disable-plugin
6e04226
make %{?_smp_mflags}
cvsdist 5a11386
cvsdist 5a11386
%install
cvsdist c258fc5
make install DESTDIR=$RPM_BUILD_ROOT
938b420
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
3383e32
mkdir -p $RPM_BUILD_ROOT%{homedir}
584868b
%if %{with systemd}
584868b
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
0f15cec
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_unitdir}/dictd.service
584868b
%else
584868b
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
584868b
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/dictd
584868b
%endif
8695de5
3383e32
cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/dictd.conf
3383e32
global {
3383e32
    #syslog
3383e32
    #syslog_facility daemon
3383e32
}
3383e32
3383e32
# Add database definitions here...
3383e32
3383e32
# We stop the search here
3383e32
database_exit
3383e32
3383e32
# Add hidden database definitions here...
3383e32
3383e32
EOF
3383e32
54de9ca
for selinuxvariant in %{selinux_variants}
54de9ca
do
54de9ca
  install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
584868b
  for i in dictd2 dictd3 dictd4 dictd5 dictd6 dictd7; do
54de9ca
     install -p -m 644 SELinux/$i.pp.${selinuxvariant} \
54de9ca
       %{buildroot}%{_datadir}/selinux/${selinuxvariant}/$i.pp
54de9ca
  done
54de9ca
done
54de9ca
cvsdist 5a11386
3383e32
%post server
584868b
%if %{with systemd}
8695de5
%systemd_post dictd.service
584868b
%else
584868b
if [ $1 = 1 ]; then
584868b
   /sbin/chkconfig --add dictd
584868b
fi
584868b
%endif
0f15cec
3383e32
%preun server
584868b
%if %{with systemd}
8695de5
%systemd_preun dictd.service
584868b
%else
584868b
if [ $1 = 0 ]; then
584868b
   # Stop the service (otherwise userdel will fail)
584868b
   /etc/rc.d/init.d/dictd stop &>/dev/null || :
584868b
   /sbin/chkconfig --del dictd
584868b
fi
584868b
%endif
0f15cec
3383e32
%postun server
584868b
%if %{with systemd}
584868b
%systemd_postun_with_restart dictd.service
584868b
%else
584868b
if [ $1 -ge 1 ] ; then
584868b
   /sbin/service dictd condrestart > /dev/null 2>&1 || :
584868b
fi
584868b
%endif
3383e32
3383e32
%pre
ee301d1
getent group %{username} >/dev/null || groupadd -r %{username}
55d9acc
getent passwd %{username} >/dev/null || \
ee301d1
    useradd -r -g %{username} -d %{homedir} -s /sbin/nologin \
ee301d1
    -c "dictd dictionary server" %{username}
55d9acc
exit 0
55d9acc
cvsdist 5a11386
%files
cvsdist c258fc5
%doc ANNOUNCE COPYING ChangeLog README doc/rfc2229.txt doc/security.doc
3383e32
%doc examples/dict1.conf
3383e32
%{_bindir}/dict
3383e32
%{_mandir}/man1/dict.1*
3383e32
cvsdist 5a11386
4ecd3ce
%files server
4ecd3ce
%doc ANNOUNCE COPYING INSTALL ChangeLog README doc/rfc2229.txt doc/security.doc
3383e32
%doc examples/dictd*
3383e32
%exclude %{_mandir}/man1/dict.1*
3383e32
%exclude %{_bindir}/dict
3383e32
%{_bindir}/*
4ecd3ce
%{_sbindir}/*
3383e32
%{_mandir}/man?/*
584868b
%if %{with systemd}
a4ed487
%attr(0644,root,root) %{_unitdir}/dictd.service
584868b
%else
584868b
%{_sysconfdir}/rc.d/init.d/*
584868b
%endif
3383e32
%{homedir}
3383e32
%config(noreplace) %{_sysconfdir}/dictd.conf
54de9ca
%doc SELinux
54de9ca
%{_datadir}/selinux/*/*.pp
4ecd3ce
cvsdist 5a11386
%changelog
5b81aa8
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-15
5b81aa8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5b81aa8
584868b
* Wed Apr 05 2017 Matěj Cepl <mcepl@redhat.com> - 1.12.1-14
584868b
- Add conditionals to build on EPEL-6 (#1116553)
584868b
53490c1
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-13
53490c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
53490c1
ee301d1
* Tue May 24 2016 Karsten Hopp <karsten@redhat.com> - 1.12.1-12
ee301d1
- solve uid 52 conflict with puppet package. use dynamic uid allocation
ee301d1
  (rhbz#1337978)
ee301d1
a11b5b3
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-11
a11b5b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a11b5b3
9dc7ecc
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.1-10
9dc7ecc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9dc7ecc
a4ed487
* Mon Jun 15 2015 Karsten Hopp <karsten@redhat.com> 1.12.1-9
a4ed487
- fix dictd.service permissions (rhbz#1192228)
ae5a777
- drop unused /etc/sysconfig/dictd (rhbz#1165413)
584868b
- add SELinux policies (rhbz#1148302)
a4ed487
7f07e82
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.1-8
7f07e82
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
7f07e82
8695de5
* Wed Jun 18 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1.12.1-7
8695de5
- %%configure macro updates config.guess/sub for new arches (aarch64/ppc64le)
8695de5
- Update systemd scriptlets to latest standard
8695de5
- General cleanups
8695de5
51c9c91
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.1-6
51c9c91
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
51c9c91
f07b892
* Tue Feb 25 2014 Karsten Hopp <karsten@redhat.com> 1.12.1-5
f07b892
- used hardened build flag to enable PIE (rhbz 955198)
f07b892
cb4a318
* Mon Aug 05 2013 Karsten Hopp <karsten@redhat.com> 1.12.1-3
cb4a318
- add BR: systemd-units for the _unitdir macro
cb4a318
a28226a
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.1-2
a28226a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a28226a
775ee60
* Mon Apr 22 2013 Karsten Hopp <karsten@redhat.com> 1.12.1-1
775ee60
- update to 1.12.1
775ee60
- add support for aarch64 (#925252)
775ee60
55d9acc
* Wed Apr 10 2013 Jon Ciesla <limburgher@gmail.com> - 1.12.0-6
55d9acc
- Migrate from fedora-usermgmt to guideline scriptlets.
55d9acc
f75a33b
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.0-5
f75a33b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f75a33b
b192718
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.0-4
b192718
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b192718
0f15cec
* Tue Feb 14 2012 Jon Ciesla <limburgher@gmail.com> - 1.12.0-3
0f15cec
- Migrate to systemd, BZ 772085.
0f15cec
5cd2a16
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.0-2
5cd2a16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
5cd2a16
4ecd3ce
* Mon Jul 04 2011 Karsten Hopp <karsten@redhat.com> 1.12.0-1
4ecd3ce
- update to version 1.12.0
4ecd3ce
- split into server and client packages
584868b
- add most of Oron Peled's <oron@actcom.co.il> changes from
3383e32
  https://bugzilla.redhat.com/attachment.cgi?id=381332
3383e32
  - The daemon now runs as 'dictd' user. This user is added/remove
3383e32
    during install/uninstall.
3383e32
  - Create and own a default configuration file
3383e32
  - By default listen only on 127.0.0.1 (secure by default)
3383e32
  - Default directory for dictionaries (datadir) is
3383e32
    now /usr/share/dict/dictd and not /usr/share
3383e32
  - Add the examples directory to the documentation
4ecd3ce
fcd2e02
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.0-6
fcd2e02
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
fcd2e02
b8946de
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.0-5
b8946de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
b8946de
8a6c5f1
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.0-4
8a6c5f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
8a6c5f1
6af35b8
* Wed Jan 28 2009 Karsten Hopp <karsten@redhat.com> 1.11.0-3
6af35b8
- add disttag
6af35b8
e09f981
* Thu Jan 22 2009 Karsten Hopp <karsten@redhat.com> 1.11.0-2
e09f981
- add postun script (#225694)
e09f981
- fix file permissions (defattr)
e09f981
77e962c
* Wed Jan 14 2009 Karsten Hopp <karsten@redhat.com> 1.11.0-1
77e962c
- update
77e962c
1f381d5
* Wed Jul 16 2008 Tom "spot" Callaway <tcallawa@redhat.com> 1.10.11-3
1f381d5
- fix license tag
1f381d5
8df3ed4
* Wed May 07 2008 Karsten Hopp <karsten@redhat.com> 1.10.11-2
f3762b4
- update to 1.10.11
f3762b4
f3762b4
* Tue Apr 01 2008 Karsten Hopp <karsten@redhat.com> 1.10.10-1
f3762b4
- fix typo (#281981)
f3762b4
- update
f3762b4
9a962e9
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.10.9-2
9a962e9
- Autorebuild for GCC 4.3
9a962e9
39a2f81
* Wed Aug 22 2007 Karsten Hopp <karsten@redhat.com> 1.10.9-1
39a2f81
- new upstream version
39a2f81
f4da1e5
* Wed Aug 22 2007 Karsten Hopp <karsten@redhat.com> 1.9.15-11
f4da1e5
- update license tag and rebuild
f4da1e5
8e5e9ea
* Mon Aug 13 2007 Karsten Hopp <karsten@redhat.com> 1.9.15-10
8e5e9ea
- add LSB stuff (#246910)
8e5e9ea
6e04226
* Wed Feb 21 2007 Karsten Hopp <karsten@redhat.com> 1.9.15-9
6e04226
- misc. merge review fixes
6e04226
7a88569
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.9.15-8.1
7a88569
- rebuild
7a88569
a58a755
* Mon May 22 2006 Karsten Hopp <karsten@redhat.de> 1.9.15-8
a58a755
- buildrequires zlib-devel
a58a755
ce728d0
* Thu May 18 2006 Karsten Hopp <karsten@redhat.de> 1.9.15-7
ce728d0
- Buildrequires: libdbi-devel
ce728d0
1054a2b
* Mon Feb 20 2006 Karsten Hopp <karsten@redhat.de> 1.9.15-6
1054a2b
- BuildRequires: byacc
1054a2b
277b199
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.9.15-5.2
277b199
- bump again for double-long bug on ppc(64)
277b199
d7fd066
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.9.15-5.1
d7fd066
- rebuilt for new gcc4.1 snapshot and glibc changes
d7fd066
9985dc8
* Mon Jan 02 2006 Karsten Hopp <karsten@redhat.de> 1.9.15-5
9985dc8
- add BuildRequires libtool-ltdl-devel (#176505)
9985dc8
83d94fd
* Tue Dec 20 2005 Karsten Hopp <karsten@redhat.de> 1.9.15-4
83d94fd
- consult dict.org if no server is specified on the commandline
83d94fd
  (#176038)
83d94fd
66b9dfc
* Mon Dec 12 2005 Karsten Hopp <karsten@redhat.de> 1.9.15-3
66b9dfc
- rebuild with gcc-4.1
66b9dfc
f55585b
* Tue Jul 12 2005 Karsten Hopp <karsten@redhat.de> 1.9.15-2
f55585b
- Buildrequires libtool (ltdl.h)
f55585b
75b2b02
* Wed Jul 06 2005 Karsten Hopp <karsten@redhat.de> 1.9.15-1
75b2b02
- update to dictd-1.9.15
75b2b02
- drop gcc34 patch
75b2b02
9d07761
* Mon May 02 2005 Karsten Hopp <karsten@redhat.de> 1.9.7-9
9d07761
- use _bindir / _sysconfdir macros
9d07761
Florian La Roche dabe04d
* Sat Apr 02 2005 Florian La Roche <laroche@redhat.com>
Florian La Roche dabe04d
- /etc/init.d -> /etc/rc.d/init.d
Florian La Roche dabe04d
9d07761
b7dd3e6
* Thu Mar 10 2005 Bill Nottingham <notting@redhat.com> 1.9.7-7
b7dd3e6
- prereq chkconfig
b7dd3e6
f15e028
* Wed Mar 02 2005 Karsten Hopp <karsten@redhat.de> 1.9.7-6
f15e028
- build with gcc-4
f15e028
584868b
* Tue Jan 25 2005 Karsten Hopp <karsten@redhat.de> 1.9.7-5
e8bd9b3
- don't install config file, leave it to the dictionary packages to
e8bd9b3
  populate it. (#135920)
e8bd9b3
584868b
* Mon Oct 04 2004 Karsten Hopp <karsten@redhat.de> 1.9.7-4
6dcd58c
- add initscript
6dcd58c
584868b
* Sat Jun 19 2004 Karsten Hopp <karsten@redhat.de> 1.9.7-3
cvsdist 0045a33
- fix build with gcc34
cvsdist 0045a33
cvsdist 0045a33
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
cvsdist 0045a33
- rebuilt
cvsdist 0045a33
584868b
* Wed Jun 02 2004 Karsten Hopp <karsten@redhat.de> 1.9.7-1
cvsdist c258fc5
- update
cvsdist c258fc5
cvsdist ac2d5b1
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
cvsdist ac2d5b1
- rebuilt
cvsdist ac2d5b1
cvsdist 803d11b
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
cvsdist 803d11b
- rebuilt
cvsdist 803d11b
cvsdist 5a11386
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
cvsdist 5a11386
- rebuilt
cvsdist 5a11386
cvsdist 5a11386
* Mon Nov 18 2002 Tim Powers <timp@redhat.com>
cvsdist 5a11386
- build on all arches
cvsdist 5a11386
cvsdist 5a11386
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
cvsdist 5a11386
- automated rebuild
cvsdist 5a11386
cvsdist 5a11386
* Thu May 23 2002 Tim Powers <timp@redhat.com>
cvsdist 5a11386
- automated rebuild
cvsdist 5a11386
667ca66
* Sun Mar 26 2000 Philip Copeland <bryce@redhat.com> 1.5.5-1
cvsdist 5a11386
- initial rpm version