Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support redefining %{gitrev} RPM macro from command line. #61

Merged
merged 1 commit into from Sep 22, 2015
Merged

Support redefining %{gitrev} RPM macro from command line. #61

merged 1 commit into from Sep 22, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jun 17, 2015

This together with the following change to the spec file:

diff --git a/librepo.spec b/librepo.spec
index d5582db..0884735 100644
--- a/librepo.spec
+++ b/librepo.spec
@@ -1,4 +1,4 @@
-%global gitrev d9bed0d
+%{!?gitrev: %global gitrev d9bed0d}
 # gitrev is output of: git rev-parse --short HEAD

 %if 0%{?rhel} != 0 && 0%{?rhel} <= 7

allows one to build librepo RPMs in Mock more easily than running make_rpm.sh in Mock (which requires copying files to and from the chroot and installing all the dependencies):

GITREV=`git rev-parse --short HEAD`
utils/make_tarball.sh "$GITREV"
mock --resultdir=. --define="gitrev $GITREV" --buildsrpm --spec librepo.spec --sources .
mock --resultdir=. --define="gitrev $GITREV" *.src.rpm

Also make_rpm.sh can get rid of the sed but I guess you still want to update the spec file with the new GITREV.

It will help us to build librepo nightly builds.

Let me know if there is any problem/ugliness.

@ghost
Copy link
Author

ghost commented Sep 10, 2015

So, we no longer build librepo in Mock so it's not such a pain. We now build just SRPMs and upload them to Copr. But unless you provide a script for building a SRPM (which also modifies GITREV), this change would still simplify our script (we could get rid of the sed).

Tojaj added a commit that referenced this pull request Sep 22, 2015
Support redefining %{gitrev} RPM macro from command line.
@Tojaj Tojaj merged commit 151d165 into rpm-software-management:master Sep 22, 2015
@ghost
Copy link
Author

ghost commented Sep 24, 2015

Thank you. I don't see a change in the spec file so I hope you don't forget to apply the patch above. Otherwise, this would just break your workflow.
(But since you have already provided the script for SRPM building, we don't need this pull request any more. So, it's up to you whether you change the spec file or revert this commit.)

@Tojaj
Copy link
Contributor

Tojaj commented Sep 25, 2015

I will change the spec in Fedora, but before that, I want to apply few other patches and release a new minor version of Librepo. Stay tuned.

@Tojaj
Copy link
Contributor

Tojaj commented Sep 25, 2015

Rawhide build is ready => New spec is available in distgit (just for rawhide so far):
koji.fedoraproject.org/koji/taskinfo?taskID=11226650

@ghost
Copy link
Author

ghost commented Sep 25, 2015

I just wanted to be sure that I did not break your workflow. Thanks again!

@ghost
Copy link
Author

ghost commented Sep 25, 2015

Actually, we build RPM only from master so we don't need any spec update in the other branches. But of course, make_rpm.sh wouldn't work for you unless you do the change...
(OK, we didn't but now we do :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants