Last active
January 4, 2022 13:28
-
-
Save kwk/259ad2f15ae4a7dc0d7987e5886d1922 to your computer and use it in GitHub Desktop.
Copr changelog entry with link to package build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: foo | |
Version: 1.0.0 | |
Release: 1 | |
Summary: foo | |
License: GPL | |
%description | |
some desc | |
%changelog | |
* Tue Jan 04 2022 LLVM snapshot build | |
- Snapshot build of version 1.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: foo | |
Version: 1.0.0 | |
Release: 1 | |
Summary: foo | |
License: GPL | |
%description | |
some desc | |
# Check if we're building with copr | |
%if 0%{?copr_projectname:1} | |
# Remove the .copr prefix that is added here infront the build ID | |
# see https://pagure.io/copr/copr/blob/main/f/rpmbuild/mock.cfg.j2#_22-25 | |
%global copr_build_id %{lua: print(string.sub(rpm.expand("%buildtag"), 6))} | |
%global llvm_snapshot_build_link https://copr.fedorainfracloud.org/coprs/build/%{copr_build_id}/ | |
%endif | |
# This prints a multiline string for the changelog entry | |
%{lua: function _llvm_snapshot_changelog_entry() | |
print("* ") | |
print(os.date("%a %b %d %Y")) | |
print(" LLVM snapshot build\n") | |
print("- Snapshot build of version ") | |
print(rpm.expand("%version")) | |
print("\n\n") | |
if rpm.isdefined("llvm_snapshot_build_link") then | |
print(" (") | |
print(rpm.expand("%llvm_snapshot_build_link")) | |
print(")") | |
end | |
end} | |
%global llvm_snapshot_changelog_entry %{lua: _llvm_snapshot_changelog_entry()} | |
# ... | |
%changelog | |
%{?llvm_snapshot_changelog_entry} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment