File uucp.spec of Package sendmail

# spec file for package uucp
# Copyright (c) 2015 SUSE LINUX 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

Name:           uucp
PreReq:         fileutils %install_info_prereq
Requires:       /usr/bin/rmail
Requires:       filesystem
Requires:       logrotate
Requires:       netcfg
Requires(verify): permissions
Requires(post): permissions
Recommends:     stunnel
Version:        1.07
Release:        0
Summary:        Taylor UUCP
License:        GPL-2.0+
Group:          Productivity/Networking/Other
Source0:        uucp-1.07.tar.bz2
Source1:        uucpcfg.tar.bz2
Source2:        uucp.xinetd
Source3:        suucp.xinetd
Patch0:         uucp-1.07.dif
Patch1:         uucp-1.07-contrib.dif
Patch2:         uucp-1.07-grade.patch
Patch3:         uucp-1.07-cu.patch
Patch4:         uucp-1.07-lockdev.patch
Patch5:         drop_ftime.patch
Patch6:         uucp-texinfo-5.0.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  lockdev-devel
%if 0%{?suse_version} > 1220
BuildRequires:  makeinfo
BuildRequires:  pkg-config

Ian Taylor's Unix to Unix copy: mail and news over modem lines. This is
the standard UUCP package from the Free Software Foundation. It is
configured to use HoneyDanBer or Taylor configuration files. With
version 6.0 of SuSE Linux, the configuration directory has been moved
to %{_sysconfdir}/uucp. Exactly: Taylor config:	    %{_sysconfdir}/uucp HoneyDanBer
config:  %{_sysconfdir}/uucp/hdb_config If you have your own setup under
%{_localstatedir}/lib/uucp, please move it to %{_sysconfdir}/uucp. Example configurations can
be found in /usr/share/doc/packages/uucp.

We did not include a uucp guest account. If you want to create a guest
account, make sure the directory %{_localstatedir}/spool/uucppublic exists.

%patch -P 1     -b .cont
%patch -P 2 -p0 -b .grad
%patch -P 3 -p0 -b .cu
%patch -P 4 -p0 -b .lockdev
%patch -P 0
%patch5 -p1
%patch6 -p1

    ID=$(id -u)
    RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -fPIE"
    CFLAGS="-Wall ${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE" \
    ./configure \
	--with-newconfigdir=%{_sysconfdir}/uucp \
	--with-oldconfigdir=%{_sysconfdir}/uucp/hdb_config \
	--prefix=/usr --mandir=%{_mandir} --infodir=%{_infodir}
    make CFLAGS="-Wall ${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE" LDFLAGS="-pie" MAKEINFO="makeinfo --force"

    ID=$(id -u)
    if test "$ID" -ne 0 ; then
	mkdir bin
	(cat > bin/install)<<-EOF
	while test \$# -gt 0; do
	    case "\$1" in
	    -o) shift 2;;
	    -g) shift 2;;
	    *)  argv="\${argv:+"\$argv "}\$1"
	set -- \$(echo \${argv})
	exec -a install %{_bindir}/install \${1+"\$@"}
	chmod 755 bin/install
	type -p install
    mkdir -p -m 755 %{buildroot}%{_sysconfdir}/uucp/hdb_config
    mkdir -p -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
    install -m 644 logrotate %{buildroot}%{_sysconfdir}/logrotate.d/uucp
    make DESTDIR=%{buildroot} install install-info
    mkdir -p -m 755 %{buildroot}%{_localstatedir}/spool/uucp %{buildroot}%{_localstatedir}/spool/uucppublic
    test "$ID" -ne 0 || \
    chown uucp:uucp %{buildroot}%{_localstatedir}/spool/uucp
    install -m 644 README.suse %{buildroot}%{_localstatedir}/spool/uucppublic/README
    mkdir -p -m 755 %{buildroot}%{_libexecdir}/uucp
    mv %{buildroot}%{_sbindir}/uu* %{buildroot}%{_libexecdir}/uucp/
    for x in %{buildroot}%{_libexecdir}/uucp/* ; do
	echo ${x##*/}
	ln -fs %{_libexecdir}/uucp/${x##*/} %{buildroot}%{_sbindir}/
    rm -rf %{buildroot}%{_defaultdocdir}/uucp
    mkdir -p %{buildroot}%{_defaultdocdir}/uucp
    mkdir -p %{buildroot}%{_localstatedir}/log/uucp
    test "$ID" -ne 0 || \
    chown root:root %{buildroot}%{_localstatedir}/log/uucp
    chmod 1755      %{buildroot}%{_localstatedir}/log/uucp
    tar jxvfpC %{SOURCE1} %{buildroot}%{_defaultdocdir}/uucp
    chmod -R u+r,o+r,g+r %{buildroot}%{_defaultdocdir}/uucp/
    mkdir -p -m 755 %{buildroot}%{_sysconfdir}/xinetd.d
    install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/xinetd.d/uucp
    install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/xinetd.d/suucp

%if %{defined verify_permissions}
%verify_permissions -e %{_localstatedir}/spool/uucp/
%verify_permissions -e %{_localstatedir}/spool/uucppublic/
%verify_permissions -e %{_bindir}/uucp
%verify_permissions -e %{_bindir}/uuname
%verify_permissions -e %{_bindir}/uustat
%verify_permissions -e %{_bindir}/uux
%verify_permissions -e %{_libexecdir}/uucp/uucico
%verify_permissions -e %{_libexecdir}/uucp/uuxqt

%install_info --info-dir=%{_infodir} %{_infodir}/
for log in Log Stats Debug ; do
    if test -e %{_localstatedir}/log/uucp/$log ; then
    touch %{_localstatedir}/log/uucp/$log
    chown uucp:uucp %{_localstatedir}/log/uucp/$log
    chmod 0640      %{_localstatedir}/log/uucp/$log
chown root:root var/log/uucp
chmod 1755      var/log/uucp
%if %{defined set_permissions}
%set_permissions %{_localstatedir}/spool/uucp/
%set_permissions %{_localstatedir}/spool/uucppublic/
%set_permissions %{_bindir}/uucp
%set_permissions %{_bindir}/uuname
%set_permissions %{_bindir}/uustat
%set_permissions %{_bindir}/uux
%set_permissions %{_libexecdir}/uucp/uucico
%set_permissions %{_libexecdir}/uucp/uuxqt

%install_info_delete --info-dir=%{_infodir} %{_infodir}/

%config(noreplace) %{_sysconfdir}/logrotate.d/uucp
%config(noreplace) %{_sysconfdir}/xinetd.d/uucp
%config(noreplace) %{_sysconfdir}/xinetd.d/suucp
#%dir %attr(0750,uucp,uucp) %{_sysconfdir}/uucp
%dir %attr(0750,uucp,uucp) %{_sysconfdir}/uucp/hdb_config
%dir %{_libexecdir}/uucp
%dir %attr(1755,root,root) %{_localstatedir}/log/uucp
%verify(not mode group) %dir %attr(1770,root,uucp) %{_localstatedir}/spool/uucppublic
#%dir %attr(0700,uucp,uucp) %{_localstatedir}/spool/uucp
%attr(755,root,root) %{_bindir}/cu
%verify(not mode) %attr(6555,uucp,uucp) %{_bindir}/uucp
%verify(not mode) %attr(6555,uucp,uucp) %{_bindir}/uuname
%verify(not mode) %attr(6555,uucp,uucp) %{_bindir}/uustat
%verify(not mode) %attr(6555,uucp,uucp) %{_bindir}/uux
%doc %{_infodir}/*.gz
%verify(not mode) %attr(6555,uucp,uucp) %{_libexecdir}/uucp/uucico
%verify(not mode) %attr(6555,uucp,uucp) %{_libexecdir}/uucp/uuxqt
%doc %{_mandir}/man1/cu.1.gz
%doc %{_mandir}/man1/uucp.1.gz
%doc %{_mandir}/man1/uustat.1.gz
%doc %{_mandir}/man1/uux.1.gz
%doc %{_mandir}/man8/uucico.8.gz
%doc %{_mandir}/man8/uuxqt.8.gz
%doc %{_defaultdocdir}/uucp
%attr(0640,root,uucp) %{_defaultdocdir}/uucp/cfg_example/taylor_config/call
%attr(0640,root,uucp) %{_defaultdocdir}/uucp/cfg_example/taylor_config/passwd

openSUSE Build Service is sponsored by