File ksmbd-tools.spec of Package ksmbd-tools

#
# spec file for package ksmbd-tools
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#

Name:           ksmbd-tools
Version:        3.5.3
Release:        9
Summary:        ksmbd kernel server userspace utilities
License:        GPL-2.0-or-later
Group:          System/Filesystems
Url:            https://github.com/cifsd-team/ksmbd-tools
Source:         https://github.com/cifsd-team/ksmbd-tools/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires:  automake
BuildRequires:  glib2-devel
# ksmbd kernel module was only added in kernel 5.15
BuildRequires:  kernel-default >= 5.15
BuildRequires:  libnl3-devel
Requires(pre):  kernel-default >= 5.15

%description
Collection of userspace utilities for the ksmbd kernel server.

%prep
%setup -q

%build
export CFLAGS="-O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -flto=auto -pie -fPIE"
%configure --runstatedir=/run --with-systemdsystemunitdir=%{_unitdir}
%make_build

%install
%make_install

# add a systemd service
ln -sf service %{buildroot}%{_sbindir}/rcksmbd

%files
%{_sbindir}/ksmbd.addshare
%{_sbindir}/ksmbd.adduser
%{_sbindir}/ksmbd.control
%{_sbindir}/ksmbd.mountd
%{_libexecdir}/ksmbd.tools
%{_mandir}/man8/ksmbd.addshare.8.gz
%{_mandir}/man8/ksmbd.adduser.8.gz
%{_mandir}/man8/ksmbd.control.8.gz
%{_mandir}/man8/ksmbd.mountd.8.gz
%{_mandir}/man5/ksmbd.conf.5.gz
%{_mandir}/man5/ksmbdpwd.db.5.gz
%dir %{_sysconfdir}/ksmbd
%config %{_sysconfdir}/ksmbd/ksmbd.conf.example
%{_unitdir}/ksmbd.service
%{_sbindir}/rcksmbd

%pre
%service_add_pre ksmbd.service

%post
%service_add_post ksmbd.service

%preun
%service_del_preun ksmbd.service

%postun
%service_del_postun ksmbd.service

%changelog
openSUSE Build Service is sponsored by