## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pkgname bees %global _version 0.11 %global commit0 cddce845429766561b3eafecdd62ce67cebaa981 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global bumpver 1 # Use -O3 for performance-critical deduplication logic (upstream recommendation) # Replace -O2 in %{optflags} with -O3 %global optflags %(echo %{optflags} | sed -e 's/-O2/-Wextra -O3/') %global debug_package %{nil} Name: %{pkgname} Version: %{_version}%{?bumpver:^%{bumpver}.git%{shortcommit0}} Release: %autorelease -b5 Summary: Best-Effort Extent-Same, a btrfs dedupe agent License: GPL-3.0-only AND MIT AND Zlib URL: https://github.com/Zygo/bees Source: %{url}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz # https://github.com/Zygo/bees/pull/286 #Patch0: 286.patch # https://github.com/Zygo/bees/pull/309 => merged # Patch1: 309.patch BuildRequires: make BuildRequires: gcc-c++ BuildRequires: btrfs-progs-devel BuildRequires: systemd-rpm-macros BuildRequires: libatomic BuildRequires: pkgconfig(systemd) BuildRequires: discount BuildRequires: glibc BuildRequires: libgcc BuildRequires: bash %description bees is a block-oriented userspace deduplication agent designed for large btrfs filesystems. It is an offline dedupe combined with an incremental data scan capability to minimize time data spends on disk from write to dedupe. %prep %autosetup -p1 -n %{name}-%{commit0} # Honor system build flags: patch makeflags to use $RPM_OPT_FLAGS sed -i "s|^CCFLAGS =.*|CCFLAGS = %{optflags}|" makeflags %conf cat < localconf BEES_VERSION=%{version} DEFAULT_MAKE_TARGET=all LIBEXEC_PREFIX=%{_libexecdir}/%{name} LIB_PREFIX=%{_libdir} PREFIX=%{_prefix} BINDIR=bin SYSTEMD_SYSTEM_UNIT_DIR=%{_unitdir} EOF %build %make_build %install %make_install %post %systemd_post 'beesd@*.service' %preun %systemd_preun 'beesd@*.service' %postun %systemd_postun_with_restart 'beesd@*.service' %check make test %files %license COPYING %doc README.md %{_bindir}/beesd %{_libexecdir}/%{name} %{_unitdir}/beesd@.service # %%{_sysconfdir}/%%{name}/ %config %{_sysconfdir}/%{name}/beesd.conf.sample %changelog %autochangelog