Creating RPM from current directory
Asked Answered
E

2

5

I'm trying to create an rpm from local source. Is it possible to do compilation in a similar to what pdebuild does - just copy the local directory as the source and operate on that copy? Every time I do rpmbuild -ba ... it tries to unpack some archive in RPMBUILD/SOURCE, but I don't want to go that way.

Essentially I'd like to be able to just checkout the repository with the code, do rpmbuild -ba application.spec in that checkout directory and have it do the right thing... Is that possible?

Emend answered 6/4, 2011 at 13:24 Comment(1)
Even now after years passed, you'd probable need to use --define to define the rpmbuild paths.Kimberelykimberlee
I
7

I don't know about a better way than the following:

rpmbuild -bs my_file.spec --define "_sourcedir $PWD"

For my own project, I'm always using a Makefile to define make rpm once and then just use it.

Intern answered 2/11, 2017 at 23:5 Comment(0)
D
0

The %setup macro in the spec file is what unpacks the source. Remove that, and your problem goes away, and you can do anything you'd like to fetch the source.

Destinee answered 22/12, 2011 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.