Skip to content

Instantly share code, notes, and snippets.

@akdev1l
Created February 6, 2021 19:03
Show Gist options
  • Save akdev1l/1fce17b30b583e57c4f1410fb0d1c52a to your computer and use it in GitHub Desktop.
Save akdev1l/1fce17b30b583e57c4f1410fb0d1c52a to your computer and use it in GitHub Desktop.

Revisions

  1. akdev1l created this gist Feb 6, 2021.
    59 changes: 59 additions & 0 deletions mouse_m908.spec
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    # 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