Skip to content

Commit e64ee8f

Browse files
committed
use rpmautospec
Signed-off-by: Tomas Tomecek <[email protected]>
1 parent 9a90184 commit e64ee8f

File tree

6 files changed

+69
-55
lines changed

6 files changed

+69
-55
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ MANIFEST
173173
# Usually these files are written by a python script from a template
174174
# before PyInstaller builds the exe, so as to inject date/other infos into it.
175175
*.manifest
176-
*.spec
177176

178177
# Installer logs
179178
pip-log.txt

.packit.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
---
2+
specfile_path: fedora/python-ogr.spec
3+
synced_files:
4+
- fedora/changelog
25
# https://packit.dev/docs/configuration/#top-level-keys
36
downstream_package_name: python-ogr
47
upstream_project_url: https://github.com/packit-service/ogr
5-
# the version is different than with basic git describe
6-
create_tarball_command: ["python3", "setup.py", "sdist", "--dist-dir", "."]
7-
current_version_command: ["python3", "setup.py", "--version"]
8+
actions:
9+
# we need this b/c `git archive` doesn't put all the metadata in the tarball:
10+
# LookupError: setuptools-scm was unable to detect version for '/builddir/build/BUILD/ogr-0.11.1'.
11+
# Make sure you're either building from a fully intact git repository or PyPI tarballs.
12+
create-archive:
13+
- python3 setup.py sdist --dist-dir ./fedora/
14+
- bash -c "ls -1t ./fedora/*.tar.gz | head -n 1"
15+
get-current-version: python3 setup.py --version
816
jobs:
917
- job: sync_from_downstream
1018
trigger: commit

python-ogr.spec fedora/changelog

-50
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
1-
%global srcname ogr
2-
3-
Name: python-%{srcname}
4-
Version: 0.11.1
5-
Release: 1%{?dist}
6-
Summary: One API for multiple git forges
7-
8-
License: MIT
9-
URL: https://github.com/packit-service/ogr
10-
Source0: %{pypi_source}
11-
BuildArch: noarch
12-
13-
BuildRequires: python3-devel
14-
BuildRequires: python3dist(setuptools)
15-
BuildRequires: python3dist(setuptools-scm)
16-
BuildRequires: python3dist(setuptools-scm-git-archive)
17-
18-
%description
19-
One Git library to Rule!
20-
21-
%package -n python3-%{srcname}
22-
Summary: %{summary}
23-
%{?python_provide:%python_provide python3-%{srcname}}
24-
25-
%description -n python3-%{srcname}
26-
One Git library to Rule!
27-
28-
29-
%prep
30-
%autosetup -n %{srcname}-%{version}
31-
# Remove bundled egg-info
32-
rm -rf %{srcname}.egg-info
33-
34-
35-
%build
36-
%py3_build
37-
38-
39-
%install
40-
%py3_install
41-
42-
43-
%files -n python3-%{srcname}
44-
%license LICENSE
45-
%doc README.md
46-
%{python3_sitelib}/%{srcname}
47-
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info
48-
49-
50-
%changelog
511
* Wed Apr 01 2020 Jan Sakalos <[email protected]> - 0.11.1-1
522
- patch release: 0.11.1
533

fedora/python-ogr.spec

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
%global srcname ogr
2+
3+
Name: python-%{srcname}
4+
Version: 0.11.1
5+
Release: %{?autorel}%{!?autorel:1}
6+
Summary: One API for multiple git forges
7+
8+
License: MIT
9+
URL: https://github.com/packit-service/ogr
10+
Source0: %{pypi_source}
11+
BuildArch: noarch
12+
13+
BuildRequires: python3-devel
14+
BuildRequires: python3dist(setuptools)
15+
BuildRequires: python3dist(setuptools-scm)
16+
BuildRequires: python3dist(setuptools-scm-git-archive)
17+
18+
%description
19+
One Git library to Rule!
20+
21+
%package -n python3-%{srcname}
22+
Summary: %{summary}
23+
%{?python_provide:%python_provide python3-%{srcname}}
24+
25+
%description -n python3-%{srcname}
26+
One Git library to Rule!
27+
28+
29+
%prep
30+
%autosetup -n ogr-0.11.1
31+
# Remove bundled egg-info
32+
rm -rf %{srcname}.egg-info
33+
34+
35+
%build
36+
%py3_build
37+
38+
39+
%install
40+
%py3_install
41+
42+
43+
%files -n python3-%{srcname}
44+
%license LICENSE
45+
%doc README.md
46+
%{python3_sitelib}/%{srcname}
47+
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info
48+
49+
50+
%changelog
51+
%autochangelog

files/tasks/build-rpm-deps.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Install RPM build dependencies
3-
command: dnf -y builddep python-ogr.spec
3+
command: dnf -y builddep fedora/python-ogr.spec
44
args:
55
chdir: "{{ project_dir }}"
66
become: true

files/tasks/generic-dnf-requirements.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@
77
- dnf-utils
88
- python3-pip
99
become: true
10+
- name: Install rpmautospec-rpm-macros
11+
dnf:
12+
name:
13+
- rpmautospec-rpm-macros
14+
enablerepo: updates-testing
15+
become: true

0 commit comments

Comments
 (0)