#10 Use %autosetup with git am
Merged 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/python3.8 git_am  into  master

file modified
+16 -18
@@ -177,6 +177,7 @@ 

  %if %{with gdbm}

  BuildRequires: gdbm-devel

  %endif

+ BuildRequires: git-core

  BuildRequires: glibc-all-langpacks

  BuildRequires: glibc-devel

  BuildRequires: gmp-devel
@@ -641,34 +642,31 @@ 

  

  %prep

  %gpgverify -k2 -s1 -d0

- %setup -q -n Python-%{upstream_version}

- # Remove all exe files to ensure we are not shipping prebuilt binaries

- # note that those are only used to create Microsoft Windows installers

- # and that functionality is broken on Linux anyway

- find -name '*.exe' -print -delete

+ %autosetup -S git_am -N -n Python-%{upstream_version}

The invocation seems sane to me according to this directive's documentation

  

- # Remove bundled libraries to ensure that we're using the system copy.

- rm -r Modules/expat

- 

- #

- # Apply patches:

- #

- %patch1 -p1

+ # Apply initial patches manually

+ %apply_patch -q %{PATCH1}

While this makes sense and it seems sane, I'm struggling to find documentation on that macro, would you be able to point me to a direction for it?

I couldn't find any %apply_patch documentation either, but it is from https://github.com/rpm-software-management/rpm/blob/master/macros.in#L1242

  

  %if "%{_lib}" == "lib64"

- %patch102 -p1

+ %apply_patch -q %{PATCH102}

  %endif

- %patch111 -p1

+ %apply_patch -q %{PATCH111}

  

  %if %{with rpmwheels}

- %patch189 -p1

+ %apply_patch -q %{PATCH189}

  rm Lib/ensurepip/_bundled/*.whl

  %endif

  

- %patch251 -p1

- %patch274 -p1

- %patch328 -p1

+ # Apply the remaining patches

+ %autopatch -m 190

+ 

+ # Remove all exe files to ensure we are not shipping prebuilt binaries

+ # note that those are only used to create Microsoft Windows installers

+ # and that functionality is broken on Linux anyway

+ find -name '*.exe' -print -delete

  

+ # Remove bundled libraries to ensure that we're using the system copy.

+ rm -r Modules/expat

  

  # Remove files that should be generated by the build

  # (This is after patching, so that we can use patches directly from upstream)

Some patches are applied conditionally, so we need to use %autosetup with -N,
to prevent automatic patch application.

Later patches from 190 up are applied (with -m for minimum).

While not necessary shorter, this no longer requires adding/removing %patch XYZ
when adding/removing patches > 190.

While at it, we also use git am to apply the patches
since they are all generated from git anyway.
This makes it easier if we ever patch binary files.

This is partial backport of https://src.fedoraproject.org/rpms/python3.9/c/0a760f01ca

Build succeeded.

The invocation seems sane to me according to this directive's documentation

While this makes sense and it seems sane, I'm struggling to find documentation on that macro, would you be able to point me to a direction for it?

The rest look good to me.

Pull-Request has been merged by churchyard

3 years ago