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?

viraptor
  • 33,322
  • 10
  • 107
  • 191

2 Answers2

6

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.

Pavel Šimerda
  • 5,783
  • 1
  • 31
  • 31
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.

Corey Henderson
  • 7,239
  • 1
  • 39
  • 43