Name:           grub-btrfs-timeshift
Version:        0.0.git.275.8c61d8ef
Release:        1%{?dist}
Summary:        Improves grub by adding "btrfs snapshots" to the grub menu.

License:        GPLv3
URL:            https://github.com/KyleGospo/grub-btrfs

VCS:            git+https://github.com/KyleGospo/grub-btrfs.git#8c61d8ef7f7488b3a47870b3037582f7c543389d:
Source:        	grub-btrfs-8c61d8ef.tar.gz
BuildArch:      noarch

Patch0:         no_root.patch
Patch1:         fedora.patch
Patch2:         timeshift.patch

Requires:       grub2-common
Requires:       timeshift

BuildRequires:  make
BuildRequires:  systemd-rpm-macros

# Don't allow this package to be used along-side the snapshot/snapper package.
Conflicts:      grub-btrfs

%description
Improves grub by adding "btrfs snapshots" to the grub menu.

You can boot your system on a "snapshot" from the grub menu.
Supports snapshots created with Timeshift

# Disable debug packages
%define debug_package %{nil}

%prep
%setup -T -b 0 -q -n grub-btrfs
%patch -P 0
%patch -P 1
%patch -P 2

# This will copy the files generated by the `make` command above into
# the installable rpm package.
%install
make DESTDIR=%buildroot PKGNAME=%{name} install

# Do post-installation
%post
%systemd_post grub-btrfs.path

# Do before uninstallation
%preun
%systemd_preun grub-btrfs.path

# Do after uninstallation
%postun
%systemd_postun_with_restart grub-btrfs.path

# This lists all the files that are included in the rpm package and that
# are going to be installed into target system where the rpm is installed.
%files
%license LICENSE
%doc README.md initramfs-overlayfs.md
%{_sysconfdir}/grub.d/41_snapshots-btrfs
%config(noreplace) %{_sysconfdir}/default/grub-btrfs/config
%{_unitdir}/grub-btrfs.path
%{_unitdir}/grub-btrfs.service

# Finally, changes from the latest release of your application are generated from
# your project's Git history. It will be empty until you make first annotated Git tag.
%changelog