Created
February 6, 2021 19:03
-
-
Save akdev1l/1fce17b30b583e57c4f1410fb0d1c52a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't put rpm package in subdir see: https://stackoverflow.com/questions/2565509/rpmbuild-generates-rpm-in-which-subdirectory | |
%define _build_name_fmt %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm | |
# Drop the RPM in PWD | |
%define _rpmdir %{getenv:PWD} | |
%define _srcrpmdir %{getenv:PWD} | |
%define _disable_source_fetch %{nil} | |
%define _sourcedir %{getenv:PWD} | |
Name: mouse_m908 | |
Version: 3.1 | |
Release: 1%{?dist} | |
Summary: Control Redragon gaming mice from Linux, BSD and Haiku | |
License: GPL v3 | |
URL: https://github.com/dokutan/mouse_m908 | |
Source0: https://github.com/dokutan/%{name}/archive/v%{version}.tar.gz | |
BuildRequires: gcc-c++ libusb libusb-devel | |
Requires: libusb | |
ExclusiveArch: x86_64 | |
%description | |
Control Redragon gaming mice from Linux, BSD and Haiku | |
%prep | |
%setup | |
%build | |
make | |
%install | |
# prepare directory structure | |
mkdir -p %{buildroot}%{_bindir} | |
mkdir -p %{buildroot}%{_docdir} | |
mkdir -p %{buildroot}%{_mandir}/man1 | |
mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d | |
# Install to %{buildroot} | |
make PREFIX=%{buildroot} \ | |
BIN_DIR=%{buildroot}/%{_bindir} \ | |
ETC_DIR=%{buildroot}/%{_sysconfdir} \ | |
MAN_DIR=$%{buildroot}/%{_docdir} \ | |
install | |
%clean | |
rm -rf %{buildroot} | |
%pre | |
%post | |
%files | |
%{_bindir}/%{name} | |
%{_docdir}/%{name} | |
%{_mandir}/man1/%{name}.1 | |
%{_sysconfdir}/udev/rules.d/%{name}.rules | |
%changelog | |
* Sat Feb 06 2021 Alex - 3.1-1 | |
- first RPM release | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment