Name:           clipboard-files
Version:        1.0
Release:        %autorelease
Summary:        Cut, copy and paste files from the clipboard in a Linux terminal
License:        MIT
URL:            https://github.com/larspontoppidan/clipboard-files
Source:         https://github.com/larspontoppidan/clipboard-files/archive/refs/heads/master.zip
Requires:       xclip

%description
Clipboard-files provides a series of command line operations to cut, copy and paste
files from the desktop environment clipboard with a Linux terminal. Files and folders can be
copied and moved, to and from file manager applications, as well as between terminal instances.
The usage commands: ccopy, ccut, cpaste, cshow and cclear are symbolic links
to the main script named clipboard-files in order to have short and concise command names.

%prep
%autosetup

%build

%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 -p clipboard-files "%{buildroot}%{_bindir}/%{name}"

%files
%{_bindir}/%{name}

%post
ln -s "%{_bindir}/%{name}" "%{_bindir}/ccopy"
ln -s "%{_bindir}/%{name}" "%{_bindir}/ccut"
ln -s "%{_bindir}/%{name}" "%{_bindir}/cpaste"
ln -s "%{_bindir}/%{name}" "%{_bindir}/cshow"
ln -s "%{_bindir}/%{name}" "%{_bindir}/cclear"
ln -s "%{_bindir}/%{name}" "%{_bindir}/ccd"

%preun
rm "%{_bindir}/ccopy"
rm "%{_bindir}/ccut"
rm "%{_bindir}/cpaste"
rm "%{_bindir}/cshow"
rm "%{_bindir}/cclear"
rm "%{_bindir}/ccd"

%changelog
%autochangelog
