%global commit 5dc8e00a83bf8884220e459d5b725f17aea1c6f3 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: ch341prog Version: 1.0 Release: 1.git%{shortcommit}%{?dist} Summary: CH341 programmer tool License: GPLv3 URL: https://github.com/setarcos/ch341prog Source0: https://github.com/setarcos/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: gcc BuildRequires: libusbx-devel BuildRequires: systemd-devel %description %prep %autosetup -n %{name}-%{commit} # switch to uaccess control sed -i -e 's/MODE="0666"/MODE="0664", TAG+="uaccess"/g' 99-ch341a-prog.rules %build gcc %{build_cflags} %{build_ldflags} ch341a.c main.c -o %{name} -lusb-1.0 %install mkdir -p %{buildroot}%{_bindir} install -p -m 755 %{name} %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_udevrulesdir} install -p -m 644 *.rules %{buildroot}%{_udevrulesdir} %files %license COPYING %doc README.md %{_bindir}/%{name} %{_udevrulesdir}/*.rules %changelog * Sat Sep 7 2019 Dan HorĂ¡k - 1.0-1.git5dc8e00 - initial Fedora version