diff --git a/deploy/build_deb_rpm.sh b/deploy/build_deb_rpm.sh index 28c8f04..08b806b 100755 --- a/deploy/build_deb_rpm.sh +++ b/deploy/build_deb_rpm.sh @@ -66,7 +66,13 @@ sudo EDITOR=/bin/true dpkg-source -q --commit . p1 sudo dpkg-buildpackage -uc -us cp ../python3-legion-linux_1.0.0-1_all.deb ${BUILD_DIR}/python3-legion-linux_1.0.0-1_amd64.deb -#Convert to RPM +#Build to RPM cd ${BUILD_DIR} -sudo alien -r -c -v ./python3-legion-linux_1.0.0-1_amd64.deb -mv ./python3-legion-linux-1.0.0-2.noarch.rpm ./python3-legion-linux-1.0.0-1.amd64.rpm \ No newline at end of file +mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} +cp ${REPODIR}/deploy/lenovolegionlinux.spec rpmbuild/SPECS +cp -r ${REPODIR}/python/legion_linux lenovolegionlinux-1.0.0 +tar --create --file lenovolegionlinux-1.0.0.tar.gz lenovolegionlinux-1.0.0 +mv lenovolegionlinux-1.0.0.tar.gz rpmbuild/SOURCES +cd rpmbuild +rpmbuild --define "_topdir `pwd`" -bs SPECS/lenovolegionlinux-1.0.0 +mv SRPMS/lenovolegionlinux-1.0.0-1.src.rpm ${BUILD_DIR}/ \ No newline at end of file diff --git a/deploy/lenovolegionlinux.spec b/deploy/lenovolegionlinux.spec new file mode 100644 index 0000000..39da7bd --- /dev/null +++ b/deploy/lenovolegionlinux.spec @@ -0,0 +1,53 @@ +%global python3_pkgversion 3.11 + +Name: lenovolegionlinux +Version: 1.0.0 +Release: 1%{?dist} +Summary: lenovolegionlinux Python library + +License: Custom License +URL: https://github.com/albertosottile/lenovolegionlinux +Source0: lenovolegionlinux-1.0.0.tar.gz + +BuildArch: noarch +BuildRequires: python%{python3_pkgversion}-devel + +# Build dependencies needed to be specified manually +BuildRequires: python%{python3_pkgversion}-setuptools + + +%global _description %{expand: +Driver and tools for controlling Lenovo Legion laptops in Linux including fan control and power mode.} + +%description %_description + +%package -n python%{python3_pkgversion}-lenovolegionlinux +Summary: %{summary} + +%description -n python%{python3_pkgversion}-lenovolegionlinux %_description + + +%prep +%autosetup -p1 -n lenovolegionlinux-%{version} + + +%build +# The macro only supported projects with setup.py +%py3_build + + +%install +# The macro only supported projects with setup.py +%py3_install +install -D -m 0644 %{_sourcedir}/extra/service/legion-linux.service %{_unitdir}/legion-linux.service +install -D -m 0644 %{_sourcedir}/extra/service/legion-linux.path %{_unitdir}/legion-linux.path + + +%check +%{pytest} + + +# Note that there is no %%files section for the unversioned python module +%files -n python%{python3_pkgversion}-lenovolegionlinux +%doc README.md +%license LICENSE \ No newline at end of file