File EnvyControl.spec of Package EnvyControl
#
# spec file for package EnvyControl
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pkgname envycontrol
%define pkgver 3.5.2
%define pkgrel 1
%define pkgext .tar.gz
Name: EnvyControl
Version: %{pkgver}
Release: %{pkgrel}
Summary: CLI tool for Nvidia Optimus graphics mode switching on Linux
License: MIT
Group: System/X11/Utilities
URL: https://github.com/bayasdev/envycontrol
Source0: https://github.com/bayasdev/envycontrol/archive/refs/tags/v%{version}.tar.gz#/%{pkgname}-%{pkgver}%{pkgext}
BuildRequires: python3-devel
BuildRequires: libXrandr-devel
BuildRequires: python3-setuptools
BuildRequires: fdupes
BuildArch: noarch
%description
CLI tool for Nvidia Optimus graphics mode switching on Linux
%prep
%autosetup -n %{pkgname}-%{pkgver}
sed -i '1{/^#!\/usr\/bin\/env python3/d}' envycontrol.py
%check
%build
# Nothing to build
%install
python3 setup.py install --root=%{buildroot} --optimize=1 --prefix=%{_prefix}
install -D -m 644 LICENSE %{buildroot}%{_datadir}/licenses/%{pkgname}/LICENSE
%fdupes %{buildroot}%{python3_sitelib}
%files
%{_bindir}/%{pkgname}
%{_datadir}/licenses/%{pkgname}
%{python3_sitelib}/envycontrol.py
%{python3_sitelib}/__pycache__/
%{python3_sitelib}/envycontrol-*.egg-info/
%changelog
* Tue Nov 08 2023 Jonata Gonçalves <jonatas.sgoncalves@gmail.com> - 3.3.0
- Initial package release