public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/swig] f43: Add python3-swig with Python package metadata
Date: Thu, 11 Jun 2026 11:19:35 GMT [thread overview]
Message-ID: <178117677574.1.1094016580019439568.rpms-swig-629969e87823@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/swig
Branch : f43
Commit : 629969e878236279bd395d5700813d9770e022a6
Author : Yaakov Selkowitz <yselkowi@redhat.com>
Date : 2026-06-10T13:14:40+02:00
Stats : +32/-1 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/swig/c/629969e878236279bd395d5700813d9770e022a6?branch=f43
Log:
Add python3-swig with Python package metadata
SWIG is also packaged on PyPI via https://github.com/nightlark/swig-pypi.
For example, the Python bindings in gpgme now use this:
[build-system]
requires = ["setuptools", "swig"]
build-backend = "setuptools.build_meta"
When %pyproject_buildrequires is run against such a package, a
BuildRequires on python3dist(swig) is generated. This will fulfill such a
requirement, and allow the package to build without bypassing dynamic BRs.
The PyPI project also includes a swig "module", but that only serves as a
script entrypoint which wraps the bundled version. We don't need that
here as we already have a real /usr/bin/swig, and "import swig" is not a
documented use case for the "module".
---
diff --git a/swig.spec b/swig.spec
index 4861e11..9a5711c 100644
--- a/swig.spec
+++ b/swig.spec
@@ -69,7 +69,7 @@
Summary: Connects C/C++/Objective C to some high-level programming languages
Name: swig
Version: 4.3.1
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPL-3.0-or-later AND BSD-3-Clause
URL: https://www.swig.org/
Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz
@@ -189,6 +189,17 @@ Requires: swig
This package contains file with commands for easier debugging of SWIG
in gdb.
+%if %{python3lang}
+%package -n python%{python3_pkgversion}-swig
+Summary: Python package metadata for SWIG
+Requires: swig = %{version}-%{release}
+BuildArch: noarch
+
+%description -n python%{python3_pkgversion}-swig
+This package registers swig as installed for Python with pip for the
+purpose of using "swig" in build-system.requires of a pyproject.toml file.
+%endif
+
%prep
%autosetup -p1
@@ -344,6 +355,18 @@ install -pm 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_datadir}/%{name}/gdb
install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb
+%if %{python3lang}
+# Create python package metadata
+mkdir -p %{buildroot}%{python3_sitelib}/swig-%{version}.dist-info
+echo "rpm" > %{buildroot}%{python3_sitelib}/swig-%{version}.dist-info/INSTALLER
+cat > %{buildroot}%{python3_sitelib}/swig-%{version}.dist-info/METADATA <<_EOF
+Metadata-Version: 2.1
+Name: swig
+Version: %{version}
+_EOF
+%endif
+
+
%files
%{_bindir}/%{name}
%{_datadir}/%{name}
@@ -367,7 +390,15 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb
%files gdb
%{_datadir}/%{name}/gdb
+%if %{python3lang}
+%files -n python%{python3_pkgversion}-swig
+%{python3_sitelib}/swig-%{version}.dist-info/
+%endif
+
%changelog
+* Thu Jan 08 2026 Yaakov Selkowitz <yselkowi@redhat.com> - 4.3.1-6
+- Add python3-swig with Python package metadata
+
* Thu Aug 07 2025 Orion Poplawski <orion@nwra.com> - 4.3.1-5
- Rebuild for Octave 10.2
reply other threads:[~2026-06-11 11:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178117677574.1.1094016580019439568.rpms-swig-629969e87823@fedoraproject.org \
--to=yselkowi@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox