File daemontools.spec of Package daemontools

#
# spec file for package daemontools
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#


Name:           daemontools
Version:        0.76
Release:        0
Summary:        Tools for managing UNIX services
License:        SUSE-Public-Domain
Group:          System/Base
URL:            http://cr.yp.to/daemontools.html
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}-%{version}-man.tar.bz2
Patch0:         %{name}-errno.patch
Patch1:         %{name}-no-return.patch
Patch2:         fix_includes_prototypes.patch
Obsoletes:      %{name}-toaster < %{version}
Obsoletes:      %{name}-toaster-doc
Provides:       %{name}-toaster = %{version}

%description
Supervise monitors a service. It starts the service and restarts the
service if it dies.  The companion  svc program  stops,  pauses,  or
restarts the service on sysadmin request.  The svstat program prints
a one-line status report.

Multilog saves error  messages to  one or more  logs.  It optionally
timestamps each line and,  for each log,  includes or excludes lines
matching specified patterns.  It automatically rotates logs to limit
the amount of disk space used.   If the disk fills up, it pauses and
tries again, without losing any data.

%prep
%setup -q -a 1
%patch0
%patch1
%patch2

echo 'cc %{optflags}' > src/conf-cc
echo %{buildroot}/%{_prefix} > src/home

%build
pushd src
make %{?_smp_mflags}

%install
mkdir -p \
	%{buildroot}%{_bindir} \
	%{buildroot}%{_mandir}/man8
pushd src
    for BFILE in envdir envuidgid fghack multilog pgrphack readproctitle setlock setuidgid softlimit supervise svc svok svscan svscanboot svstat tai64n tai64nlocal
    do
        install -m 755 $BFILE %{buildroot}%{_bindir}
    done
popd

install -m 644 %{name}-%{version}-man/*8 %{buildroot}%{_mandir}/man8

%files
%{_bindir}/*

%doc src/CHANGES package/README src/TODO
%{_mandir}/man8/*

%changelog
openSUSE Build Service is sponsored by