7

I have a spec file to build an rpm package, in my %install section I have this:

%install
install -m 700 foo/bar/filesToCopy/. $RPM_BUILD_ROOT/

The filesToCopy folder is a tree exactly how the package file tree should look like. It has all the sub directories a package has such as etc/..., /usr/bin, /usr/share ..., and subsquent files in those.

When building it gives me

install: omitting directory 'foo/bar/filesToCopy/'
error: Bad exit status from /var/tmp/rpm-tmp.sea6XO (%install)

Is there a way I dont have to copy each file individuallly like this:

install -m 700 foo/bar/filesToCopy/usr/bin/file1.ex $RPM_BUILD_ROOT/usr/bin/
...

As everything in filesToCopy/ is the structure as in $RPM_BUILD_ROOT/

UPDATE

I found a solution, I changed the "install -m 700" to a "cp -a"

Jimmie
  • 397
  • 2
  • 5
  • 20
  • What is generating the files in the first place? Usually, you call `make` and `make install` using the RPM macros (e.g. `%make_install`), and they handle this all for you. Is your "source" a pre-compiled tarball or something? – Aaron D. Marasco Nov 17 '15 at 02:02
  • Yea, Im using gradle to compile my code, and in my build.gradle file there is a task called preparePacakge. In my RPM Spec under %build I run the command: ./gradlew myApp:preparePackage . Then this creates a directory called TMPINST that has an etc folder and usr folder with sub-dir init, myApp in etc, then bin, lib,share in usr It also containing config files and a jar with all the class files and the man files and so on, all the things I want in the package. Its like what it would look like if you unpacked the .rpm file – Jimmie Nov 17 '15 at 02:21
  • I know nothing about `gradle`, but [this might help](https://github.com/nebula-plugins/gradle-ospackage-plugin). – Aaron D. Marasco Nov 17 '15 at 11:40

0 Answers0