File tmate-slave.spec of Package tmate-slave

#
# spec file for package tmate-slave
#
# 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/
#

%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif

Name:           tmate-slave
Version:        1.8~git1432.76ec591e
Release:        0
Summary:        The tmate.io server part
License:        MIT
Group:          Productivity/Networking/Other
Url:            https://github.com/tmate-io/tmate-slave
Source0:        %{name}-%{version}.tar.xz
Source1:        sysconfig.tmate-slave
Source2:        tmate-slave.service
Source3:        tmate-slave-gen-keys.sh
Source4:        tmate-slave.1
# Patch0:		tmate-slave-1.8-disable_setresgid.patch
# Patch1:		tmate-slave-1.8-man-page.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libcap-progs
BuildRequires:  libevent-devel
BuildRequires:  libmsgpack-devel >= 1.1.0
BuildRequires:  libmsgpackc-devel >= 1.1.0
BuildRequires:  libopenssl-devel
BuildRequires:  libssh-devel >= 0.7.0
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig
BuildRequires:  shadow
Requires:       libcap-progs
Requires:       shadow
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Tmate-slave is the server part of tmate.

%prep
%setup -q

%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
./autogen.sh
%configure
make %{?_smp_mflags}

%install
make install DESTDIR="%{buildroot}"

install -d -m 700 %{buildroot}%{_sysconfdir}/tmate-slave/keys/

install -D -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0755 %{SOURCE3} %{buildroot}%{_bindir}/tmate-slave-gen-keys
install -D -m 0644 %{SOURCE4} %{buildroot}%{_mandir}/man1/%{name}.1

install -dD -m 0755 %{buildroot}%{_sbindir}
ln -s /sbin/service %{buildroot}%{_sbindir}/rc%{name}

%pre
%service_add_pre %{name}.service

%post
%fillup_only
%service_add_post %{name}.service

%preun
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%files
%defattr(-,root,root)
%doc README
%{_sbindir}/rc%{name}
%{_bindir}/tmate-slave
%{_bindir}/tmate-slave-gen-keys
%{_mandir}/man1/tmate-slave.1*
%{_unitdir}/tmate-slave.service
%dir %config %attr(700,root,root) %{_sysconfdir}/tmate-slave/keys/
%dir %config %attr(700,root,root) %{_sysconfdir}/tmate-slave/
%{_fillupdir}/sysconfig.tmate-slave

%changelog
openSUSE Build Service is sponsored by