#3 use '%autosetup -S git' to apply patches
Opened 2 months ago by tmz. Modified 2 months ago
rpms/ tmz/dionaea simplify-git-prep-v2  into  rawhide

file modified
+7 -16
@@ -2,7 +2,7 @@ 

  Version:        0.7.0

  Summary:        Low interaction honeypot

  # Show as the RPM release number (keep same number line for tarball and git builds)

- %global         baserelease     18

+ %global         baserelease     19


  %if 0%{?rhel}

  # Group needed for EPEL
@@ -132,7 +132,7 @@ 

  BuildRequires:  bison

  BuildRequires:  pkgconfig

  BuildRequires:  sqlite

- BuildRequires:  git

+ BuildRequires:  git-core


  BuildRequires:  libev-devel

  BuildRequires:  libemu-devel
@@ -229,24 +229,12 @@ 


  %if 0%{?with_snapshot}

  # Build from git snapshot

- %autosetup -p 1 -n %{gitname}-%{commit} -N

+ %autosetup -p 1 -n %{gitname}-%{commit} -S git


  # Build from git release version

- %autosetup -p 1 -n %{gitname}-%{version} -N

+ %autosetup -p 1 -n %{gitname}-%{version} -S git



- # Re-initialize the git repo, to track changes even on files ignored by the upstream

- rm -rf .git

- # Remove the .gitignore to prevent ignoring changes in some files

- rm -f .gitignore

- git init -q

- git config user.email "rpmbuild"

- git config user.name "rpmbuild"

- git add .

- git commit -a -m "base"


- %autopatch -p 1


  # Unbundle the pyev library and use the system one

  # https://github.com/DinoTools/dionaea/issues/169

  rm -rf modules/python/pyev
@@ -493,6 +481,9 @@ 




+ * Sun Mar 12 2023 Todd Zullinger <tmz@pobox.com> - 0.7.0-19

+ - use '%%autosetup -S git' to apply patches


  * Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.0-18

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild


Replace manual git setup and patch application in %prep with the
equivalent from %autosetup.

With %autosetup -S git there is no need to call rm -rf on .git or
.gitignore. A .git directory should never end up in the source tree
(but would be irrelevant for the patch application anyway). And the
.gitignore is not an issue because the %__scm_setup_git macro passes
the --force option to git add[*], which adds all files -- regardless of
whether they would be ignored.

Change BuildRequires: git to git-core, which saves a bit of space in the

[*] The macro on EL-7 lacks the --force option. With EL-7 very close to
EOL, it's highly unlikely that it's going to see any large merges from
the rawhide branch.

I ran across an old branch which I created around the time PR#2 was open. I cleaned it up and updated it here.

thank you for the pull request, but I have been this path - see https://src.fedoraproject.org/rpms/dionaea/blob/aea04ba38cde38b0e17a8f8b780da3250fa608dc/f/dionaea.spec
As the project contains its own .gitignore there was a problem with the patch using git tools was leaving out the info about changes done to the Makefiles and other ignored files.

I really use this to troubleshoot the patches and this way allows me to easily update the patches when needed.

I am preparing change to 0.11, but still have got some problems with the cmake which is somehow clashing with the Fedora optimizations.

Your previous attempt was prior to upstream rpm's 1e0376f86 (macros: force add files to git index, 2020-06-02).

That is now present in all supported Fedora branches as well as EL8 and EL9.