diff --git a/content/other-tools/04_distros.md b/content/other-tools/04_distros.md index 15766f6..fed5b02 100644 --- a/content/other-tools/04_distros.md +++ b/content/other-tools/04_distros.md @@ -27,41 +27,9 @@ If your project is not yet packaged, that's fine, you can do it yourself. The only files you need to manage are a `.spec` file and a `packit` configuration[^2]. The spec file can be quite minimal and low/no maintenance: -```rpmspec -Name: foo -Version: 0.0.0 -Release: %autorelease -Summary: Example package -License: Unlicense -URL: https://example.com -Source: %{pypi_source foo} -BuildRequires: python3-devel - -%description -Lorem ipsum - -%prep -%autosetup -n foo-%{version} - -%generate_buildrequires -%pyproject_buildrequires -x test - -%build -%pyproject_wheel - -%install -%pyproject_install -%pyproject_save_files foo - -%check -%pytest - -%files -f %{pyproject_files} -%license LICENSE -%doc README.md - -%changelog -%autochangelog +```{literalinclude} ../../examples/5_04_distros/foo.spec +:language: rpmspec +:caption: foo.spec ``` Packit is a service available as a GitHub app and on GitLab, but can be extended upon request. diff --git a/examples/5_04_distros/foo.spec b/examples/5_04_distros/foo.spec index 5862a44..2abea84 100644 --- a/examples/5_04_distros/foo.spec +++ b/examples/5_04_distros/foo.spec @@ -5,11 +5,30 @@ Summary: Example package License: Unlicense URL: https://example.com Source: %{pypi_source foo} +BuildRequires: python3-devel %description Lorem ipsum -%files +%prep +%autosetup -n foo-%{version} + +%generate_buildrequires +%pyproject_buildrequires -x test + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files foo + +%check +%pytest + +%files -f %{pyproject_files} +%license LICENSE +%doc README.md %changelog %autochangelog