File uucp.spec of Package sendmail

#
# spec file for package uucp (Version 1.07)
#
# Copyright (c) 2010 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


Name:           uucp
License:        GPL v2 or later
Group:          Productivity/Networking/Other
PreReq:         fileutils %install_info_prereq
Requires:       /usr/bin/rmail filesystem netcfg
Recommends:     stunnel
AutoReqProv:    on
Version:        1.07
Release:        50.<RELEASE15>
Summary:        Taylor UUCP
Source0:        uucp-1.07.tar.bz2
Source1:        uucpcfg.tar.bz2
Source2:        uucp.xinetd
Source3:        suucp.xinetd
Source4:        uucpman.sh
Patch0:         uucp-1.07.dif
Patch1:         uucp-1.07-contrib.dif
Patch2:         uucp-1.07-grade.patch
Patch3:         uucp-1.07-cu.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
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 /etc/uucp. Exactly: Taylor config:	    /etc/uucp HoneyDanBer
config:  /etc/uucp/hdb_config If you have your own setup under
/var/lib/uucp, please move it to /etc/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 /var/spool/uucppublic exists.



Authors:
--------
    Ian Lance Taylor <ian@cygnus.com>

%prep
%setup
%patch -P 1     -b .cont
%patch -P 2 -p0 -b .grad
%patch -P 3 -p0 -b .cu
%patch -P 0

%build
    #
    ID=$(id -u)
    RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
    #
    %{?suse_update_config:%{suse_update_config -f}}
    aclocal
    automake
    autoconf
    CFLAGS="-Wall ${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE" \
    ./configure \
	--with-newconfigdir=/etc/uucp \
	--with-oldconfigdir=/etc/uucp/hdb_config \
	--prefix=/usr --mandir=%{_mandir} --infodir=%{_infodir}
    make CFLAGS="-Wall ${RPM_OPT_FLAGS} -pipe -D_GNU_SOURCE"

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

%post
%install_info --info-dir=%{_infodir} %{_infodir}/uucp.info.gz
%run_permissions

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/uucp.info.gz
%verifyscript
%verify_permissions -e /var/spool/uucppublic

%files
%defattr(-,root,root)
%config(noreplace) /etc/logrotate.d/uucp
%config(noreplace) /etc/xinetd.d/uucp
%config(noreplace) /etc/xinetd.d/suucp
#%dir %attr(0750,uucp,uucp) /etc/uucp
%dir %attr(0750,uucp,uucp) /etc/uucp/hdb_config
%dir /usr/lib/uucp
%dir %attr(0755,uucp,uucp) /var/log/uucp
%verify(not mode group) %dir %attr(1770,root,uucp) /var/spool/uucppublic
#%dir %attr(0700,uucp,uucp) /var/spool/uucp
%attr(755,root,root) /usr/bin/cu
%attr(6555,uucp,uucp) /usr/bin/uucp
/usr/bin/uulog
%attr(6555,uucp,uucp) /usr/bin/uuname
/usr/bin/uupick
%attr(6555,uucp,uucp) /usr/bin/uustat
/usr/bin/uuto
%attr(6555,uucp,uucp) /usr/bin/uux
%doc %{_infodir}/uucp.info*.gz
/usr/lib/uucp/uuchk
%attr(6555,uucp,uucp) /usr/lib/uucp/uucico
/usr/lib/uucp/uuconv
/usr/lib/uucp/uusched
%attr(6555,uucp,uucp) /usr/lib/uucp/uuxqt
/usr/sbin/uuchk
/usr/sbin/uucico
/usr/sbin/uuconv
/usr/sbin/uusched
/usr/sbin/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
/var/spool/uucppublic/README
%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

%changelog