File dropbear.spec of Package dropbear

#
# spec file for package dropbear
#
# Copyright (c) 2019 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:           dropbear
Version:        2020.81
Release:        0
Summary:        A relatively small SSH 2 server and client
License:        MIT
Group:          Productivity/Networking/SSH
Url:            https://matt.ucc.asn.au/dropbear/dropbear.html
Source0:        https://matt.ucc.asn.au/dropbear/%{name}-%{version}.tar.bz2
Source1:        https://matt.ucc.asn.au/dropbear/%{name}-%{version}.tar.bz2.asc
# https://matt.ucc.asn.au/dropbear/releases/dropbear-key-2015.asc
Source2:        %{name}.keyring
Source3:        dropbear.service
Source4:        dropbear-keygen.service
Source5:        dropbear.sysconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  zlib-devel
%{?systemd_requires}
Requires(pre):	%fillup_prereq

%description
Dropbear is a SSH 2 server and client designed to be small enough to be used in small memory environments, while still being functional and secure enough for general use.

It implements most required features of the SSH 2 protocol, and other features such as X11 and authentication agent forwarding.

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}
install -d %{buildroot}%{_sysconfdir}/%{name}
%if 0%{?suse_version} >= 1500
  install -D -m 0644 %{SOURCE5} "%{buildroot}%{_fillupdir}/sysconfig.%{name}"
%else
  install -D -m 0644 %{SOURCE5} "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
%endif
install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}-keygen.service
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}-keygen

%pre
%service_add_pre %{name}.service
%service_add_pre %{name}-keygen.service

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

%preun
%service_del_preun %{name}.service
%service_del_preun %{name}-keygen.service

%postun
%service_del_postun %{name}.service
%service_del_postun %{name}-keygen.service

%files
%defattr(-,root,root)
%{_bindir}/dbclient
%{_bindir}/dropbearconvert
%{_bindir}/dropbearkey
%{_sbindir}/dropbear
%{_sbindir}/rcdropbear
%{_unitdir}/%{name}.service
%{_unitdir}/dropbear-keygen.service
%{_sbindir}/rcdropbear-keygen
%dir %{_sysconfdir}/%{name}
%if  0%{?suse_version} >= 1500
  %{_fillupdir}/sysconfig.%{name}
%else
  %{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
%endif
%{_mandir}/man8/dropbear.8.gz
%{_mandir}/man1/dbclient.1.gz
%{_mandir}/man1/dropbearkey.1.gz
%{_mandir}/man1/dropbearconvert.1.gz

%changelog
openSUSE Build Service is sponsored by