diff --git a/pathtools-0.1.2-version_imp.patch b/pathtools-0.1.2-version_imp.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6f00146e3216b7fee345940115ba7b0db0c5588 --- /dev/null +++ b/pathtools-0.1.2-version_imp.patch @@ -0,0 +1,25 @@ +--- pathtools-0.1.2/setup.py 2011-08-25 02:25:25.000000000 -0700 ++++ pathtools-0.1.2/setup.py.new 2023-08-25 18:37:49.654134759 -0700 +@@ -22,12 +22,10 @@ + # THE SOFTWARE. + + import os +-import imp + from setuptools import setup + + PKG_DIR = 'pathtools' +-version = imp.load_source('version', +- os.path.join(PKG_DIR, 'version.py')) ++version = ||VERSION|| + + def read_file(filename): + """ +@@ -40,7 +38,7 @@ + return open(os.path.join(os.path.dirname(__file__), filename)).read() + + setup(name='pathtools', +- version=version.VERSION_STRING, ++ version=version, + description='File system general utilities', + long_description=read_file('README'), + author="Yesudeep Mangalapilly", diff --git a/pathtools-0.1.2.tar.gz b/pathtools-0.1.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..859d99f9729e4d0c7fb490f3800d02178e37d30f Binary files /dev/null and b/pathtools-0.1.2.tar.gz differ diff --git a/python-pathtools.spec b/python-pathtools.spec new file mode 100644 index 0000000000000000000000000000000000000000..7a65c3f1f65243f603aa047cb435b22cda364a46 --- /dev/null +++ b/python-pathtools.spec @@ -0,0 +1,75 @@ +%global upname pathtools + +Name: python-%{upname} +Version: 0.1.2 +Release: 1 +Summary: Pattern matching and various utilities for file systems paths + +License: MIT +URL: https://github.com/gorakhargosh/%{upname} +Source0: %{pypi_source %{upname}} +# This is hacky, but I don't feel like writing a real fix for this +# silly upstream approach. imp is retired in python 3.12, so we need +# to not use it. This replaces the use of it with a marker string +# we'll sub out with the real version in %prep +# not upstreamable, upstream would need to do the mess recommended at +# https://docs.python.org/3.12/whatsnew/3.12.html#removed , or just +# use a less silly way of getting version numbers into setup.py... +Patch: pathtools-0.1.2-version_imp.patch + +BuildArch: noarch +BuildRequires: make +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-sphinx + +%global _description\ +%{name} is a Python API library for common path\ +and pattern functionality.\ + + +%description %_description + +%package -n python3-%{upname} +Summary: %summary +%{?python_provide:%python_provide python3-%{upname}} + +%description -n python3-%{upname} %_description + + +%prep +%autosetup -n %{upname}-%{version} -p1 + +# remove hashbang from lib's files +sed -i -e '/#!\//d' pathtools/*.py + +# Use the default sphinx theme +# python-flask-sphinx-themes is orphaned +sed -i "s/html_theme = 'flask'/html_theme = 'default'/" ./docs/source/conf.py + +# replace the marker from the imp-removal patch with the real version +sed -i -e "s,||VERSION||,'%{version}',g" setup.py + +%build +%py3_build + +pushd docs +make SPHINXBUILD=sphinx-build-3 html +rm -rf build/html/.build* +popd + + +%install +%py3_install + + +%files -n python3-%{upname} +%license LICENSE +%doc AUTHORS LICENSE README +%doc docs/build/html +%{python3_sitelib}/pathtools*/ + + +%changelog +* Sun Apr 14 2024 Han Jinpeng - 0.1.2-1 +- Package init diff --git a/python-pathtools.yaml b/python-pathtools.yaml new file mode 100644 index 0000000000000000000000000000000000000000..25f6fcec7c79fb285ccf2d00a7efe5a613148503 --- /dev/null +++ b/python-pathtools.yaml @@ -0,0 +1,4 @@ +version_control: pypi +src_repo: pathtools +tag_pattern: ^v +seperator: .