From 9f6ad306e5006c2acb6a6e6cc9d4988c47e4bb22 Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Mon, 10 Apr 2023 16:33:48 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: Shawn Wang --- python-slip.spec | 98 ++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/python-slip.spec b/python-slip.spec index 2dd5e5f..5830cb1 100644 --- a/python-slip.spec +++ b/python-slip.spec @@ -1,89 +1,89 @@ -%define anolis_release 1 -Name: python-slip +%define anolis_release 2 +%global pypi_name slip + +Name: python-%{pypi_name} Version: 0.6.5 Release: %{anolis_release}%{?dist} Summary: Convenience, extension and workaround code for Python 2.x - License: GPLv2+ -URL: https://github.com/nphilipp/python-slip -Source0: https://github.com/nphilipp/python-slip/releases/download/python-slip-%{version}/python-slip-%{version}.tar.bz2 - +URL: https://github.com/nphilipp/python-%{pypi_name} +Source0: https://github.com/nphilipp/python-%{pypi_name}/releases/download/python-%{pypi_name}-%{version}/python-%{pypi_name}-%{version}.tar.bz2 BuildArch: noarch -BuildRequires: make -BuildRequires: python3 -BuildRequires: python3-devel +BuildRequires: make python%{python3_pkgversion}-devel -%global _description\ -The Simple Library for Python 2.x packages contain miscellaneous code for\ -convenience, extension and workaround purposes.\ -\ -This package provides the "slip" and the "slip.util" modules. +%description +The Simple Library for Python 2.x packages contain miscellaneous code for +convenience, extension and workaround purposes. -%description %_description +This package provides the "%{pypi_name}" and the "%{pypi_name}.util" modules. -%package -n python3-slip +%package -n python%{python3_pkgversion}-%{pypi_name} Summary: Convenience, extension and workaround code for Python 3.x -Requires: python3-libselinux +Requires: python%{python3_pkgversion}-libselinux -%description -n python3-slip +%description -n python%{python3_pkgversion}-%{pypi_name} The Simple Library for Python 3.x packages contain miscellaneous code for convenience, extension and workaround purposes. -This package provides the "slip" and the "slip.util" modules. +This package provides the "%{pypi_name}" and the "%{pypi_name}.util" modules. -%package -n python3-slip-dbus +%package -n python%{python3_pkgversion}-%{pypi_name}-dbus Summary: Convenience functions for dbus services in Python 3.x -Requires: python3-slip = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: python3-dbus >= 0.80 -# Don't require any of pygobject2/3 because slip.dbus works with either one. In -# theory users of slip.dbus should require one or the other anyway to use the -# main loop. -# -# No hard requirement on polkit to allow minimal installs without polkit and -# its dependencies. +Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release} +Requires: python%{python3_pkgversion}-dbus >= 0.80 Conflicts: PolicyKit < 0.8-3 -Requires: python3-decorator -Requires: python3-six -%{?python_provide:%python_provide python3-slip-dbus} +Requires: python%{python3_pkgversion}-decorator +Requires: python%{python3_pkgversion}-six +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}-dbus} -%description -n python3-slip-dbus +%description -n python%{python3_pkgversion}-%{pypi_name}-dbus The Simple Library for Python 3.x packages contain miscellaneous code for convenience, extension and workaround purposes. -This package provides slip.dbus.service.Object, which is a dbus.service.Object +This package provides %{pypi_name}.dbus.service.Object, which is a dbus.service.Object derivative that ends itself after a certain time without being used and/or if there are no clients anymore on the message bus, as well as convenience functions and decorators for integrating a dbus service with PolicyKit. -%prep -%autosetup -p1 +%package -n python%{python3_pkgversion}-%{pypi_name}-doc +Summary: Documentation files for python%{python3_pkgversion}-%{pypi_name} +Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release} +BuildArch: noarch -find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' +%description -n python%{python3_pkgversion}-%{pypi_name}-doc +Documentation files for python%{python3_pkgversion}-%{pypi_name} and python%{python3_pkgversion}-%{pypi_name}-dbus. +%prep +%autosetup -p1 -n python-%{pypi_name}-%{version} +find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' %build - make PYTHON=%{__python3} %{?_smp_mflags} %install - make install PYTHON=%{__python3} DESTDIR=%buildroot -%files -n python3-slip -%doc COPYING doc/dbus -%dir %{python3_sitelib}/slip/ -%{python3_sitelib}/slip/__pycache__ -%{python3_sitelib}/slip/__init__.py* -%{python3_sitelib}/slip/util -%{python3_sitelib}/slip/_wrappers -%{python3_sitelib}/slip-%{version}-py%{python3_version}.egg-info +%files -n python%{python3_pkgversion}-%{pypi_name} +%license COPYING +%dir %{python3_sitelib}/%{pypi_name}/ +%{python3_sitelib}/%{pypi_name}/__pycache__ +%{python3_sitelib}/%{pypi_name}/__init__.py* +%{python3_sitelib}/%{pypi_name}/util +%{python3_sitelib}/%{pypi_name}/_wrappers +%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info + +%files -n python%{python3_pkgversion}-%{pypi_name}-dbus +%{python3_sitelib}/%{pypi_name}/dbus +%{python3_sitelib}/%{pypi_name}.dbus-%{version}-py%{python3_version}.egg-info -%files -n python3-slip-dbus +%files -n python%{python3_pkgversion}-%{pypi_name}-doc %doc doc/dbus/* -%{python3_sitelib}/slip/dbus -%{python3_sitelib}/slip.dbus-%{version}-py%{python3_version}.egg-info +%doc AUTHORS %changelog +* Mon Apr 10 2023 Shawn Wang - 0.6.5-2 +- Optimize the spec file + * Thu Mar 10 2022 Liwei Ge - 0.6.5-1 - Init version from upstream v0.6.5 -- Gitee