From e9324b9384250f0699de642d96ad36484eb12be8 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 13:09:38 +0100 Subject: [PATCH 1/7] Changes for building fakeredis and Flor rpm --- data/projects.ini | 7 ++-- data/rpm_templates/Flor.spec | 9 +++--- data/rpm_templates/fakeredis.spec | 44 ++++++++++++++++++++++++++ l2tdevtools/build_helpers/dpkg.py | 12 +++---- l2tdevtools/build_helpers/factory.py | 4 +++ l2tdevtools/build_helpers/interface.py | 2 +- l2tdevtools/build_helpers/rpm.py | 4 +-- 7 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 data/rpm_templates/fakeredis.spec diff --git a/data/projects.ini b/data/projects.ini index 16931f73..1733ca79 100644 --- a/data/projects.ini +++ b/data/projects.ini @@ -416,10 +416,11 @@ description_long: Discover and load entry points from installed packages version: >=1.1.0 dpkg_build_dependencies: python3-poetry-core build_system: poetry -maintainer: Bruce Merry -homepage_url: https://github.com/jamesls/fakeredis +rpm_template_spec: fakeredis.spec +maintainer: Daniel Moran +homepage_url: https://github.com/cunla/fakeredis-py download_url: https://pypi.org/project/fakeredis -git_url: https://github.com/jamesls/fakeredis.git +git_url: https://github.com/cunla/fakeredis-py.git description_short: A fake version of a redis-py description_long: Fake implementation of redis API (redis-py) for testing purposes diff --git a/data/rpm_templates/Flor.spec b/data/rpm_templates/Flor.spec index f9fc1564..3d74bc80 100644 --- a/data/rpm_templates/Flor.spec +++ b/data/rpm_templates/Flor.spec @@ -19,10 +19,10 @@ BuildRequires: python3-devel, python3-setuptools %description A Bloom filter implementation in Python -%package -n python3-%{{name}} +%package -n python3-flor Summary: Python 3 module of Flor - An efficient Bloom filter implementation in Python -%description -n python3-%{{name}} +%description -n python3-flor A Bloom filter implementation in Python %prep @@ -39,9 +39,8 @@ rm -rf %{{buildroot}}/usr/share/doc/%{{name}}/ %clean rm -rf %{{buildroot}} -%files -n python3-%{{name}} - - +%files -n python3-flor +%doc README.md %{{python3_sitelib}}/flor %{{python3_sitelib}}/Flor*.egg-info diff --git a/data/rpm_templates/fakeredis.spec b/data/rpm_templates/fakeredis.spec new file mode 100644 index 00000000..e2db305f --- /dev/null +++ b/data/rpm_templates/fakeredis.spec @@ -0,0 +1,44 @@ +%define name fakeredis +%define version {version} +%define release 1 + +Name: %{{name}} +Version: %{{version}} +Release: %{{release}} +Summary: A fake version of a redis-py +License: BSD-3-Clause +URL: https://github.com/cunla/fakeredis-py +Source: %{{name}}-%{{version}}.tar.gz +BuildArch: noarch +BuildRequires: python3-devel, python3-poetry-core, python3-tox-current-env + +%description +Fake implementation of redis API (redis-py) for testing purposes + +%package -n python3-%{{name}} +Summary: A fake version of a redis-py + +%description -n python3-%{{name}} +Fake implementation of redis API (redis-py) for testing purposes + +%prep +%autosetup -p1 -n %{{name}}-%{{version}} + +%generate_buildrequires +%pyproject_buildrequires -t + +%build +%pyproject_wheel + +%install +%pyproject_install + +%files -n python3-%{{name}} +%license LICENSE +%doc README.md +%{{python3_sitelib}}/fakeredis +%{{python3_sitelib}}/fakeredis*.dist-info + +%changelog +* {date_time} log2timeline development team {version}-1 +- Auto-generated diff --git a/l2tdevtools/build_helpers/dpkg.py b/l2tdevtools/build_helpers/dpkg.py index 29716fd4..a834b457 100644 --- a/l2tdevtools/build_helpers/dpkg.py +++ b/l2tdevtools/build_helpers/dpkg.py @@ -232,7 +232,7 @@ def _CreatePackagingFiles(self, source_directory, project_version): # the dpkg directory. if os.path.exists(debian_directory): logging.info('Removing: {0:s}'.format(debian_directory)) - shutil.rmtree(debian_directory) + shutil.rmtree(debian_directory, ignore_errors=True) dpkg_directory = os.path.join(source_directory, 'dpkg') @@ -580,7 +580,7 @@ def Build(self, source_helper_object): temporary_directory = os.path.join(source_directory, 'tmp') if os.path.exists(temporary_directory): logging.info('Removing: {0:s}'.format(temporary_directory)) - shutil.rmtree(temporary_directory) + shutil.rmtree(temporary_directory, ignore_errors=True) if not self._BuildPrepare( source_directory, source_helper_object.project_name, project_version, @@ -698,7 +698,7 @@ def Build(self, source_helper_object): temporary_directory = os.path.join(source_directory, 'tmp') if os.path.exists(temporary_directory): logging.info('Removing: {0:s}'.format(temporary_directory)) - shutil.rmtree(temporary_directory) + shutil.rmtree(temporary_directory, ignore_errors=True) if not self._BuildPrepare( source_directory, source_helper_object.project_name, project_version, @@ -832,7 +832,7 @@ def _DetermineBuildConfiguration(self, source_directory): build_configuration.has_bin_directory = True if os.path.exists(installroot_path): - shutil.rmtree(installroot_path) + shutil.rmtree(installroot_path, ignore_errors=True) return build_configuration @@ -929,7 +929,7 @@ def Build(self, source_helper_object): temporary_directory = os.path.join(source_directory, 'tmp') if os.path.exists(temporary_directory): logging.info('Removing: {0:s}'.format(temporary_directory)) - shutil.rmtree(temporary_directory) + shutil.rmtree(temporary_directory, ignore_errors=True) if not self._BuildPrepare( source_directory, project_name, project_version, self.version_suffix, @@ -1086,7 +1086,7 @@ def Build(self, source_helper_object): temporary_directory = os.path.join(source_directory, 'tmp') if os.path.exists(temporary_directory): logging.info('Removing: {0:s}'.format(temporary_directory)) - shutil.rmtree(temporary_directory) + shutil.rmtree(temporary_directory, ignore_errors=True) if not self._BuildPrepare( source_directory, project_name, project_version, self.version_suffix, diff --git a/l2tdevtools/build_helpers/factory.py b/l2tdevtools/build_helpers/factory.py index 17a459d9..3550f35d 100644 --- a/l2tdevtools/build_helpers/factory.py +++ b/l2tdevtools/build_helpers/factory.py @@ -23,9 +23,13 @@ class BuildHelperFactory(object): 'wheel': wheel.FlitWheelBuildHelper, } + # Note that the rpm and srpm setup.py build helpers are used to build + # projects that use poetry. _POETRY_BUILD_HELPER_CLASSES = { 'dpkg': dpkg.PybuildDPKGBuildHelper, 'dpkg-source': dpkg.PybuildSourceDPKGBuildHelper, + 'rpm': rpm.SetupPyRPMBuildHelper, + 'srpm': rpm.SetupPySRPMBuildHelper, 'wheel': wheel.PoetryWheelBuildHelper, } diff --git a/l2tdevtools/build_helpers/interface.py b/l2tdevtools/build_helpers/interface.py index 6201864a..342413b6 100644 --- a/l2tdevtools/build_helpers/interface.py +++ b/l2tdevtools/build_helpers/interface.py @@ -45,7 +45,7 @@ def _RemoveOlderSourceDirectories(self, project_name, project_version): for filename in filenames: if os.path.isdir(filename) and not filenames_to_ignore.match(filename): logging.info('Removing: {0:s}'.format(filename)) - shutil.rmtree(filename) + shutil.rmtree(filename, ignore_errors=True) def _RemoveOlderSourcePackages(self, project_name, project_version): """Removes previous versions of source packages. diff --git a/l2tdevtools/build_helpers/rpm.py b/l2tdevtools/build_helpers/rpm.py index 7c8a25f6..c22c3809 100644 --- a/l2tdevtools/build_helpers/rpm.py +++ b/l2tdevtools/build_helpers/rpm.py @@ -293,7 +293,7 @@ def _RemoveOlderBuildDirectory(self, project_name, project_version): for filename in filenames: if not filenames_to_ignore.match(filename): logging.info('Removing: {0:s}'.format(filename)) - shutil.rmtree(filename) + shutil.rmtree(filename, ignore_errors=True) def _RemoveOlderRPMs(self, project_name, project_version): """Removes previous versions of .rpm files. @@ -557,7 +557,7 @@ def Clean(self, source_helper_object): for filename in ('build', 'dist'): if os.path.exists(filename): logging.info('Removing: {0:s}'.format(filename)) - shutil.rmtree(filename, True) + shutil.rmtree(filename, ignore_errors=True) # Remove previous versions of rpms. project_name, project_version = self._GetFilenameSafeProjectInformation( From 78445355b4517957d51f2960d450e15f157af80d Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 14:00:48 +0100 Subject: [PATCH 2/7] Changes for building fakeredis and Flor rpm --- tests/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/update.py b/tests/update.py index 5890bfef..4ccd7fb2 100644 --- a/tests/update.py +++ b/tests/update.py @@ -20,7 +20,7 @@ class GithubRepoDownloadHelperTest(test_lib.BaseTestCase): _DOWNLOAD_URL = 'https://github.com/ForensicArtifacts/artifacts/releases' _PROJECT_NAME = 'artifacts' - _PROJECT_VERSION = '20240112' + _PROJECT_VERSION = '20240303' def testGetPackageDownloadURLs(self): """Tests the GetPackageDownloadURLs function.""" From 32e294c803eae1395bbd47e1aaef1ed0d892cd39 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 14:28:42 +0100 Subject: [PATCH 3/7] Changes for building fakeredis, Flor and xattr rpm --- data/projects.ini | 4 ++-- data/rpm_templates/xattr.spec | 29 +++++++++++++++------------- l2tdevtools/build_helpers/factory.py | 11 +++++++++++ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/data/projects.ini b/data/projects.ini index 1733ca79..bdd3495b 100644 --- a/data/projects.ini +++ b/data/projects.ini @@ -414,7 +414,7 @@ description_long: Discover and load entry points from installed packages [fakeredis] version: >=1.1.0 -dpkg_build_dependencies: python3-poetry-core +dpkg_build_dependencies: python3-poetry-core,python3-tox-current-env build_system: poetry rpm_template_spec: fakeredis.spec maintainer: Daniel Moran @@ -2174,7 +2174,7 @@ disabled: windows version: >=0.9.7 dpkg_build_dependencies: python3-cffi,python3-toml,python3-wheel dpkg_name: python-xattr -rpm_build_dependencies: python3-cffi +rpm_build_dependencies: python3-cffi,python3-pip,python3-setuptools,python3-tox-current-env,python3-wheel rpm_name: python-xattr rpm_template_spec: xattr.spec maintainer: John Machin diff --git a/data/rpm_templates/xattr.spec b/data/rpm_templates/xattr.spec index 0281fff1..607b21d2 100644 --- a/data/rpm_templates/xattr.spec +++ b/data/rpm_templates/xattr.spec @@ -2,18 +2,17 @@ %define version {version} %define release 1 -Summary: Python wrapper for extended filesystem attributes Name: %{{name}} Version: %{{version}} Release: %{{release}} -Source0: %{{name}}-%{{version}}.tar.gz +Summary: Python wrapper for extended filesystem attributes License: MIT License -Group: Development/Libraries -BuildRoot: %{{_tmppath}}/%{{name}}-%{{version}}-%{{release}}-buildroot -Prefix: %{{_prefix}} Vendor: Bob Ippolito Url: http://github.com/xattr/xattr -BuildRequires: gcc, python3-devel, python3-setuptools, python3-cffi +Source0: %{{name}}-%{{version}}.tar.gz +Group: Development/Libraries +BuildRoot: %{{_tmppath}}/%{{name}}-%{{version}}-%{{release}}-buildroot +BuildRequires: gcc, python3-cffi, python3-devel, python3-pip, python3-setuptools, python3-tox-current-env, python3-wheel %description Extended attributes extend the basic attributes of files @@ -23,10 +22,10 @@ Extended attributes are currently only available on Darwin 8.0+ (Mac OS X 10.4) and Linux 2.6+. Experimental support is included for Solaris and FreeBSD. -%package -n python3-py%{{name}} +%package -n python3-%{{name}} Summary: Python 3 module of Python wrapper for extended filesystem attributes -%description -n python3-py%{{name}} +%description -n python3-%{{name}} Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc). @@ -35,14 +34,18 @@ Extended attributes are currently only available on Darwin 8.0+ Solaris and FreeBSD. %prep -%autosetup -n %{{name}}-%{{version}} +%autosetup -p1 -n %{{name}}-%{{version}} + +# The requirement versions are too recent for Fedora 39 but don't seem to +# the necessary minimum versions. +# %generate_buildrequires +# %pyproject_buildrequires -t %build -%py3_build +%pyproject_wheel %install -%py3_install -rm -rf %{{buildroot}}/usr/lib/python*/site-packages/*.egg-info/requires.txt +%pyproject_install rm -rf %{{buildroot}}/usr/share/doc/%{{name}}/ %clean @@ -52,7 +55,7 @@ rm -rf %{{buildroot}} %license LICENSE.txt %doc CHANGES.txt %{{_libdir}}/python3*/site-packages/xattr -%{{_libdir}}/python3*/site-packages/xattr*.egg-info +%{{_libdir}}/python3*/site-packages/xattr*.dist-info %exclude %{{_bindir}}/xattr diff --git a/l2tdevtools/build_helpers/factory.py b/l2tdevtools/build_helpers/factory.py index 3550f35d..100098ce 100644 --- a/l2tdevtools/build_helpers/factory.py +++ b/l2tdevtools/build_helpers/factory.py @@ -47,6 +47,13 @@ class BuildHelperFactory(object): 'wheel': wheel.SetupPyWheelBuildHelper, } + # Note that the rpm and srpm setup.py build helpers are used to build + # projects that use setuptools. + _SETUPTOOLS_BUILD_HELPER_CLASSES = { + 'rpm': rpm.SetupPyRPMBuildHelper, + 'srpm': rpm.SetupPySRPMBuildHelper, + } + @classmethod def NewBuildHelper( cls, project_definition, build_target, l2tdevtools_path, @@ -84,6 +91,10 @@ def NewBuildHelper( build_helper_class = cls._SETUP_PY_BUILD_HELPER_CLASSES.get( build_target, None) + elif project_definition.build_system == 'setuptools': + build_helper_class = cls._SETUPTOOLS_BUILD_HELPER_CLASSES.get( + build_target, None) + else: build_helper_class = None From bb4f4bbfcb1cf1a85bd76a6b8cf4cf882517508d Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 14:39:55 +0100 Subject: [PATCH 4/7] Changes for building fakeredis, Flor and xattr rpm --- l2tdevtools/build_helpers/factory.py | 3 ++- l2tdevtools/build_helpers/wheel.py | 24 ++++++++++++------------ tests/build_helpers/wheel.py | 14 +++++++------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/l2tdevtools/build_helpers/factory.py b/l2tdevtools/build_helpers/factory.py index 100098ce..9f7c3bee 100644 --- a/l2tdevtools/build_helpers/factory.py +++ b/l2tdevtools/build_helpers/factory.py @@ -44,7 +44,7 @@ class BuildHelperFactory(object): 'rpm': rpm.SetupPyRPMBuildHelper, 'source': source.SetupPySourceBuildHelper, 'srpm': rpm.SetupPySRPMBuildHelper, - 'wheel': wheel.SetupPyWheelBuildHelper, + 'wheel': wheel.SetuptoolsWheelBuildHelper, } # Note that the rpm and srpm setup.py build helpers are used to build @@ -52,6 +52,7 @@ class BuildHelperFactory(object): _SETUPTOOLS_BUILD_HELPER_CLASSES = { 'rpm': rpm.SetupPyRPMBuildHelper, 'srpm': rpm.SetupPySRPMBuildHelper, + 'wheel': wheel.SetuptoolsWheelBuildHelper, } @classmethod diff --git a/l2tdevtools/build_helpers/wheel.py b/l2tdevtools/build_helpers/wheel.py index 9671fe47..75d85ee8 100644 --- a/l2tdevtools/build_helpers/wheel.py +++ b/l2tdevtools/build_helpers/wheel.py @@ -203,11 +203,8 @@ def Build(self, source_helper_object): return self._MoveWheel(source_helper_object) -class SetupPyWheelBuildHelper(WheelBuildHelper): - """Helper to build Python wheel packages (.whl). - - Builds wheel packages for projects that use setup.py as their build system. - """ +class FlitWheelBuildHelper(WheelBuildHelper): + """Helper to build Python wheel packages (.whl) using flit.""" def Build(self, source_helper_object): """Builds the wheel. @@ -234,7 +231,7 @@ def Build(self, source_helper_object): logging.info('Building wheel of: {0:s}'.format(source_package_filename)) log_file_path = os.path.join('..', self.LOG_FILENAME) - command = '\"{0:s}\" -m build --wheel > {1:s} 2>&1'.format( + command = '\"{0:s}\" -m flit build --format wheel > {1:s} 2>&1'.format( sys.executable, log_file_path) exit_code = subprocess.call('(cd {0:s} && {1:s})'.format( source_directory, command), shell=True) @@ -245,8 +242,8 @@ def Build(self, source_helper_object): return self._MoveWheel(source_helper_object) -class FlitWheelBuildHelper(WheelBuildHelper): - """Helper to build Python wheel packages (.whl) using flit.""" +class PoetryWheelBuildHelper(WheelBuildHelper): + """Helper to build Python wheel packages (.whl) using poetry.""" def Build(self, source_helper_object): """Builds the wheel. @@ -273,7 +270,7 @@ def Build(self, source_helper_object): logging.info('Building wheel of: {0:s}'.format(source_package_filename)) log_file_path = os.path.join('..', self.LOG_FILENAME) - command = '\"{0:s}\" -m flit build --format wheel > {1:s} 2>&1'.format( + command = '\"{0:s}\" -m poetry build --format wheel > {1:s} 2>&1'.format( sys.executable, log_file_path) exit_code = subprocess.call('(cd {0:s} && {1:s})'.format( source_directory, command), shell=True) @@ -284,8 +281,11 @@ def Build(self, source_helper_object): return self._MoveWheel(source_helper_object) -class PoetryWheelBuildHelper(WheelBuildHelper): - """Helper to build Python wheel packages (.whl) using poetry.""" +class SetuptoolsWheelBuildHelper(WheelBuildHelper): + """Helper to build Python wheel packages (.whl) using setuptools. + + Builds wheel packages for projects that use setup.py as their build system. + """ def Build(self, source_helper_object): """Builds the wheel. @@ -312,7 +312,7 @@ def Build(self, source_helper_object): logging.info('Building wheel of: {0:s}'.format(source_package_filename)) log_file_path = os.path.join('..', self.LOG_FILENAME) - command = '\"{0:s}\" -m poetry build --format wheel > {1:s} 2>&1'.format( + command = '\"{0:s}\" -m build --wheel > {1:s} 2>&1'.format( sys.executable, log_file_path) exit_code = subprocess.call('(cd {0:s} && {1:s})'.format( source_directory, command), shell=True) diff --git a/tests/build_helpers/wheel.py b/tests/build_helpers/wheel.py index 30b7fb9b..3a79f6f0 100644 --- a/tests/build_helpers/wheel.py +++ b/tests/build_helpers/wheel.py @@ -41,7 +41,7 @@ def testGetWheelFilenameProjectInformation(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.WheelBuildHelper( project_definition, l2tdevtools_path, {}) source_helper_object = test_lib.TestSourceHelper( @@ -63,7 +63,7 @@ def testCheckBuildDependencies(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.WheelBuildHelper( project_definition, l2tdevtools_path, {}) missing_packages = test_build_helper.CheckBuildDependencies() @@ -77,7 +77,7 @@ def testCheckBuildRequired(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.WheelBuildHelper( project_definition, l2tdevtools_path, {}) source_helper_object = test_lib.TestSourceHelper( @@ -94,7 +94,7 @@ def testClean(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.WheelBuildHelper( project_definition, l2tdevtools_path, {}) source_helper_object = test_lib.TestSourceHelper( @@ -144,7 +144,7 @@ def testBuild(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.ConfigureMakeWheelBuildHelper( project_definition, l2tdevtools_path, {}) source_helper_object = test_lib.TestSourceHelper( @@ -178,7 +178,7 @@ def testBuild(self): self.assertEqual(len(directory_entries), 4) -class SetupPyWheelBuildHelperTest(shared_test_lib.BaseTestCase): +class SetuptoolsWheelBuildHelperTest(shared_test_lib.BaseTestCase): """Tests for the helper to build Python wheel packages (.whl).""" _TEST_PROJECT_NAME = 'dfdatetime' @@ -196,7 +196,7 @@ def testBuild(self): l2tdevtools_path = os.path.dirname(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) - test_build_helper = wheel.SetupPyWheelBuildHelper( + test_build_helper = wheel.SetuptoolsWheelBuildHelper( project_definition, l2tdevtools_path, {}) source_helper_object = test_lib.TestSourceHelper( From f6884da966d0b3582d7cb6398f12a8ed150eaa2f Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 14:51:15 +0100 Subject: [PATCH 5/7] Changes for building fakeredis, Flor, pyparsing and xattr rpm --- data/projects.ini | 1 + data/rpm_templates/pyparsing.spec | 32 +++++++++++----------------- data/rpm_templates/xattr.spec | 2 -- l2tdevtools/build_helpers/factory.py | 4 ++++ 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/data/projects.ini b/data/projects.ini index bdd3495b..763ecfee 100644 --- a/data/projects.ini +++ b/data/projects.ini @@ -1740,6 +1740,7 @@ dpkg_build_dependencies: flit build_system: flit dpkg_name: python-pyparsing dpkg_template_install_python3: python3-pyparsing.install +rpm_build_dependencies: python3-flit-core rpm_template_spec: pyparsing.spec maintainer: Paul McGuire homepage_url: https://pyparsing-docs.readthedocs.io/en/latest diff --git a/data/rpm_templates/pyparsing.spec b/data/rpm_templates/pyparsing.spec index 1dd7a2af..5a1b2e96 100644 --- a/data/rpm_templates/pyparsing.spec +++ b/data/rpm_templates/pyparsing.spec @@ -2,19 +2,16 @@ %define version {version} %define release 1 -Summary: Python parsing module Name: %{{name}} Version: %{{version}} Release: %{{release}} -Source0: %{{name}}-%{{version}}.tar.gz License: MIT License -Group: Development/Libraries -BuildRoot: %{{_tmppath}}/%{{name}}-%{{version}}-%{{release}}-buildroot -Prefix: %{{_prefix}} -BuildArch: noarch -Vendor: Paul McGuire +Summary: Python parsing module Url: https://github.com/pyparsing/pyparsing/ -BuildRequires: python3-devel, python3-setuptools +Vendor: Paul McGuire +Source0: %{{name}}-%{{version}}.tar.gz +BuildArch: noarch +BuildRequires: python3-devel, python3-flit-core, python3-setuptools %description The parsing module is an alternative approach to creating @@ -34,26 +31,23 @@ of classes that client code uses to construct the grammar directly in Python code. %prep -%autosetup -n %{{name}}-%{{version}} +%autosetup -p1 -n %{{name}}-%{{version}} + +# This will try to include project.optional-dependencies +# %generate_buildrequires +# %pyproject_buildrequires -t %build -%py3_build +%pyproject_wheel %install -%py3_install -rm -rf %{{buildroot}}/usr/lib/python*/site-packages/*.egg-info/requires.txt -rm -rf %{{buildroot}}/usr/share/doc/%{{name}}/ - -%clean -rm -rf %{{buildroot}} +%pyproject_install %files -n python3-%{{name}} %license LICENSE %doc CHANGES README.rst %{{python3_sitelib}}/pyparsing -%{{python3_sitelib}}/pyparsing*.egg-info - -%exclude %{{python3_sitelib}}/__pycache__/ +%{{python3_sitelib}}/pyparsing*.dist-info %changelog * {date_time} log2timeline development team {version}-1 diff --git a/data/rpm_templates/xattr.spec b/data/rpm_templates/xattr.spec index 607b21d2..15a27885 100644 --- a/data/rpm_templates/xattr.spec +++ b/data/rpm_templates/xattr.spec @@ -10,8 +10,6 @@ License: MIT License Vendor: Bob Ippolito Url: http://github.com/xattr/xattr Source0: %{{name}}-%{{version}}.tar.gz -Group: Development/Libraries -BuildRoot: %{{_tmppath}}/%{{name}}-%{{version}}-%{{release}}-buildroot BuildRequires: gcc, python3-cffi, python3-devel, python3-pip, python3-setuptools, python3-tox-current-env, python3-wheel %description diff --git a/l2tdevtools/build_helpers/factory.py b/l2tdevtools/build_helpers/factory.py index 9f7c3bee..4472c82f 100644 --- a/l2tdevtools/build_helpers/factory.py +++ b/l2tdevtools/build_helpers/factory.py @@ -19,7 +19,11 @@ class BuildHelperFactory(object): 'wheel': wheel.ConfigureMakeWheelBuildHelper, } + # Note that the rpm and srpm setup.py build helpers are used to build + # projects that use flit. _FLIT_BUILD_HELPER_CLASSES = { + 'rpm': rpm.SetupPyRPMBuildHelper, + 'srpm': rpm.SetupPySRPMBuildHelper, 'wheel': wheel.FlitWheelBuildHelper, } From a34d1206a56fdf67a983bdef7794bc63e29be6cb Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 15:02:47 +0100 Subject: [PATCH 6/7] Changes for building fakeredis, Flor, pyparsing and xattr rpm --- data/projects.ini | 2 +- data/rpm_templates/fakeredis.spec | 4 ++-- data/rpm_templates/pyparsing.spec | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/projects.ini b/data/projects.ini index 763ecfee..0685126b 100644 --- a/data/projects.ini +++ b/data/projects.ini @@ -1740,7 +1740,7 @@ dpkg_build_dependencies: flit build_system: flit dpkg_name: python-pyparsing dpkg_template_install_python3: python3-pyparsing.install -rpm_build_dependencies: python3-flit-core +rpm_build_dependencies: python3-flit-core,python3-pip rpm_template_spec: pyparsing.spec maintainer: Paul McGuire homepage_url: https://pyparsing-docs.readthedocs.io/en/latest diff --git a/data/rpm_templates/fakeredis.spec b/data/rpm_templates/fakeredis.spec index e2db305f..8c1a1fe3 100644 --- a/data/rpm_templates/fakeredis.spec +++ b/data/rpm_templates/fakeredis.spec @@ -24,8 +24,8 @@ Fake implementation of redis API (redis-py) for testing purposes %prep %autosetup -p1 -n %{{name}}-%{{version}} -%generate_buildrequires -%pyproject_buildrequires -t +# %generate_buildrequires +# %pyproject_buildrequires -t %build %pyproject_wheel diff --git a/data/rpm_templates/pyparsing.spec b/data/rpm_templates/pyparsing.spec index 5a1b2e96..08204362 100644 --- a/data/rpm_templates/pyparsing.spec +++ b/data/rpm_templates/pyparsing.spec @@ -11,7 +11,7 @@ Url: https://github.com/pyparsing/pyparsing/ Vendor: Paul McGuire Source0: %{{name}}-%{{version}}.tar.gz BuildArch: noarch -BuildRequires: python3-devel, python3-flit-core, python3-setuptools +BuildRequires: python3-devel, python3-flit-core, python3-pip, python3-setuptools %description The parsing module is an alternative approach to creating From af8bfa667230898c560c280257b9c2cfa669d4be Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 3 Mar 2024 15:13:59 +0100 Subject: [PATCH 7/7] Changes for building fakeredis, Flor, pyparsing and xattr rpm --- data/dpkg_templates/pytest-runner-control | 15 ------ .../python3-pytest-runner.install | 2 - data/licenses/LICENSE.pytest-runner | 21 -------- data/presets.ini | 2 +- data/projects.ini | 21 +------- data/rpm_templates/pytest-runner.spec | 54 ------------------- 6 files changed, 2 insertions(+), 113 deletions(-) delete mode 100644 data/dpkg_templates/pytest-runner-control delete mode 100644 data/dpkg_templates/python3-pytest-runner.install delete mode 100644 data/licenses/LICENSE.pytest-runner delete mode 100644 data/rpm_templates/pytest-runner.spec diff --git a/data/dpkg_templates/pytest-runner-control b/data/dpkg_templates/pytest-runner-control deleted file mode 100644 index 0c949fd6..00000000 --- a/data/dpkg_templates/pytest-runner-control +++ /dev/null @@ -1,15 +0,0 @@ -Source: pytest-runner -Section: python -Priority: extra -Maintainer: Jason R. Coombs -Build-Depends: debhelper (>= 9), dh-python, python3-all (>= 3.6~), python3-setuptools (>= 27.3), python3-setuptools-scm (>= 1.15.0) -Standards-Version: 3.9.5 -X-Python3-Version: >= 3.6 -Homepage: https://github.com/pytest-dev/pytest-runner - -Package: python3-pytest-runner -Architecture: all -Depends: python3-pytest, ${{python3:Depends}}, ${{misc:Depends}} -Description: Python 3 module of pytest-runner - Setup scripts can use pytest-runner to add setup.py test - support for pytest runner. diff --git a/data/dpkg_templates/python3-pytest-runner.install b/data/dpkg_templates/python3-pytest-runner.install deleted file mode 100644 index 6195064c..00000000 --- a/data/dpkg_templates/python3-pytest-runner.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/python3*/dist-packages/*.py -usr/lib/python3*/dist-packages/pytest_runner*.egg-info/* diff --git a/data/licenses/LICENSE.pytest-runner b/data/licenses/LICENSE.pytest-runner deleted file mode 100644 index 49c95bfa..00000000 --- a/data/licenses/LICENSE.pytest-runner +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011-2016 Jason R. Coombs - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/data/presets.ini b/data/presets.ini index d408571b..4bd0fa32 100644 --- a/data/presets.ini +++ b/data/presets.ini @@ -29,7 +29,7 @@ projects: libbde,libcaes,libcdata,libcdatetime,libcdirectory,libcerror,libcfile, [plaso] presets: dfimagetools,redis-py -projects: acstore,bencode,certifi,cffi,chardet,dateutil,defusedxml,fakeredis,Flor,future,libcaes,libesedb,libevt,libevtx,libexe,libfwps,libfwsi,liblnk,libmsiecf,libolecf,libscca,mock,opensearch-py,pbr,pefile,plaso,psutil,pyparsing,python-lz4,python-zstd,pytest-runner,pytz,pyzmq,requests,urllib3,XlsxWriter,yara-python +projects: acstore,bencode,certifi,cffi,chardet,dateutil,defusedxml,fakeredis,Flor,future,libcaes,libesedb,libevt,libevtx,libexe,libfwps,libfwsi,liblnk,libmsiecf,libolecf,libscca,mock,opensearch-py,pbr,pefile,plaso,psutil,pyparsing,python-lz4,python-zstd,pytz,pyzmq,requests,urllib3,XlsxWriter,yara-python [redis-py] projects: deprecated,importlib-metadata,redis-py diff --git a/data/projects.ini b/data/projects.ini index 0685126b..dfd37f3a 100644 --- a/data/projects.ini +++ b/data/projects.ini @@ -1764,25 +1764,6 @@ git_url: https://github.com/tobgu/pyrsistent.git description_short: Persistent/Functional/Immutable data structures description_long: Persistent/Functional/Immutable data structures -[pytest-runner] -version: >=1.0.1 -dpkg_name: python-pytest-runner -dpkg_build_dependencies: python3-setuptools-scm -dpkg_dependencies: python3-pytest -dpkg_template_control: pytest-runner-control -dpkg_template_install_python3: python3-pytest-runner.install -rpm_build_dependencies: python3-setuptools_scm -rpm_template_spec: pytest-runner.spec -wheel_name: pytest_runner -maintainer: Jason R. Coombs -homepage_url: https://github.com/pytest-dev/pytest-runner -download_url: https://pypi.org/project/pytest-runner -git_url: https://github.com/pytest-dev/pytest-runner.git -description_short: Invoke py.test as distutils command with dependency - resolution -description_long: Setup scripts can use pytest-runner to add setup.py test - support for pytest runner. - [python-editor] version: >=1.0.1 maintainer: Peter Ruibal @@ -2173,7 +2154,7 @@ architecture_dependent: true build_system: setuptools disabled: windows version: >=0.9.7 -dpkg_build_dependencies: python3-cffi,python3-toml,python3-wheel +dpkg_build_dependencies: python3-cffi,python3-setuptools,python3-toml,python3-wheel dpkg_name: python-xattr rpm_build_dependencies: python3-cffi,python3-pip,python3-setuptools,python3-tox-current-env,python3-wheel rpm_name: python-xattr diff --git a/data/rpm_templates/pytest-runner.spec b/data/rpm_templates/pytest-runner.spec deleted file mode 100644 index 2848c18b..00000000 --- a/data/rpm_templates/pytest-runner.spec +++ /dev/null @@ -1,54 +0,0 @@ -%define name pytest-runner -%define version {version} -%define unmangled_name pytest-runner -%define unmangled_version {version} -%define release 1 - -Summary: Invoke py.test as distutils command with dependency resolution -Name: %{{name}} -Version: %{{version}} -Release: %{{release}} -Source0: %{{unmangled_name}}-%{{unmangled_version}}.tar.gz -License: UNKNOWN -Group: Development/Libraries -BuildRoot: %{{_tmppath}}/%{{unmangled_name}}-release-%{{version}}-%{{release}}-buildroot -Prefix: %{{_prefix}} -BuildArch: noarch -Vendor: Jason R. Coombs -Url: https://github.com/pytest-dev/pytest-runner -BuildRequires: python3-setuptools >= 30.3, python3-devel, python3-setuptools_scm - -%description -Setup scripts can use pytest-runner to add setup.py test -support for pytest runner. - -%package -n python3-%{{name}} -Summary: Invoke py.test as distutils command with dependency resolution - -%description -n python3-%{{name}} -Setup scripts can use pytest-runner to add setup.py test -support for pytest runner. - -%prep -%autosetup -n %{{unmangled_name}}-%{{unmangled_version}} - -%build -%py3_build - -%install -%py3_install -rm -rf %{{buildroot}}/usr/lib/python*/site-packages/*.egg-info/requires.txt -rm -rf %{{buildroot}}/usr/share/doc/%{{name}}/ - -%clean -rm -rf %{{buildroot}} - -%files -n python3-%{{name}} -%license LICENSE -%{{python3_sitelib}}/*.py -%{{python3_sitelib}}/__pycache__/*.pyc -%{{python3_sitelib}}/pytest_runner*.egg-info - -%changelog -* {date_time} log2timeline development team {version}-1 -- Auto-generated