File xbt-tracker.spec of Package xbt-tracker
#
# spec file for package xbt-tracker
#
# Copyright (c) 2020 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: xbt-tracker
Version: 20200419
Release: %mkrel 1
Summary: XBT Tracker is a BitTorrent tracker written in C++
License: GPL-3.0
Group: Productivity/Networking/Other
Url: https://github.com/OlafvdSpek/xbt
Source0: %{name}-%{version}.tar.xz
Source1: %{name}.logrotate
Source2: %{name}.conf
Source3: %{name}.service
Patch0: xbt_tracker_log.diff
BuildRequires: lib64boost-devel
BuildRequires: cmake >= 3.7
BuildRequires: gcc-c++
BuildRequires: lib64mariadb-devel
BuildRequires: libstdc++-devel
BuildRequires: lib64opencl-devel
BuildRequires: systemd
%if %{distro_release} >= 10
BuildRequires: lib64z-devel
%else
BuildRequires: lib64zlib-devel
%endif
Requires: logrotate
Requires: systemd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
Requires(post): rpm-helper >= %{rpmhelper_required_version}
Requires(preun): rpm-helper >= %{rpmhelper_required_version}
Requires(postun): rpm-helper >= %{rpmhelper_required_version}
%description
XBT Tracker is a BitTorrent tracker written in C++. It's designed to offer high performance
while consuming little resources (CPU and RAM). It's a pure tracker, so it doesn't offer a frontend.
You can use any (PHP) frontend you want.
%global debug_package %{nil}
%prep
%setup -q
%patch -P 0
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
%{__cmake} .
make %{?_smp_mflags}
%install
install -D -s -m 755 Tracker/xbt_tracker %{buildroot}/%{_sbindir}/%{name}
install -d -m 750 %{buildroot}/%{_localstatedir}/log/%{name}
install -D -m 644 Tracker/xbt_tracker.sql %{buildroot}/%{_sysconfdir}/%{name}/%{name}.sql
install -D -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
install -D -m 660 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}/%{name}.conf
install -D -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}/%{name}.service
%post
%_post_service %{name}
%preun
%_preun_service %{name}
%postun
%_postun_userdel %{name}
%files
%defattr(-,root,root)
%{_sbindir}/*
%{_unitdir}/%{name}.service
%dir %attr(0750,root,root) %{_localstatedir}/log/%{name}
%dir %attr(0750,root,root) %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/%{name}.sql
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%doc Tracker/COPYING Tracker/htdocs/*
%changelog