gastonelhordoy / grunt-rpm

Grunt plugin to create an RPM out of a project for distribution.
MIT License
15 stars 16 forks source link

grunt-rpm broken on OSX (w/ working command-line example) #15

Open asnowfix opened 10 years ago

asnowfix commented 10 years ago

This is the same problem than the one recently fixed by https://github.com/sbt/sbt-native-packager/pull/22, invoking the rpmbuild command-line, but from scala (instead of from Node+Grunt).

[...]
Spawning rpmbuild: {"cmd":"rpmbuild","args":["-bb","--target","noarch","--buildroot","/Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/tmp","/Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/SPECS/mpf-client.spec"]}
Warning: error: Unable to open temp file.
    Unable to open temp file. Use --force to continue.

Aborted due to warnings.

Here is the spawned command-line execution job:

$ rpmbuild -vvv -bb --target noarch --buildroot /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/t
mp /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/SPECS/mpf-client.spec
Building target platforms: noarch
D:     target platform: noarch
Processing files: mpf-client-0.1.0-SNAPSHOT20140616220711
D:      execv(/opt/local/lib/rpm/find-provides) pid 83186
D:      waitpid(83186) rc 83186 status 0
Finding  Provides: /opt/local/lib/rpm/find-provides
D:      execv(/opt/local/lib/rpm/find-requires) pid 83200
D:      waitpid(83200) rc 83200 status 0
Finding  Requires: /opt/local/lib/rpm/find-requires
Checking for unpackaged file(s): /opt/local/lib/rpm/check-files /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/tmp
D:      execv(/opt/local/lib/rpm/check-files) pid 83219
D:      waitpid(83219) rc 83219 status 0
error: Unable to open temp file.

RPM build errors:
    Unable to open temp file.

Once the generated command is changed into the following format, it works fine:

$ rpmbuild -vvv -bb --target noarch --buildroot /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/t
mp --define "_topdir /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild" --define "_tmppath /tmp" /Users/kowalskif/Desktop/GIT/hp-ws/mpf-client/_rpmbuild/SPECS/mpf-cli
ent.spec

As a confirmation, here is the content generated rpm:

$ rpm -qlp _rpmbuild/RPMS/noarch/mpf-client-0.1.0-SNAPSHOT20140616220711.noarch.rpm 
/export/u1/pos-static/mpf/lib/bower_components/angular/angular-csp.css
/export/u1/pos-static/mpf/lib/bower_components/angular/angular.js
/export/u1/pos-static/mpf/lib/bower_components/angular/angular.min.js
[...]
dod38fr commented 10 years ago

By default, rpm use /var/tmp as tmppath. Have you tried to override this value in rpmrc file ? (Either in /etc/rpm/rc or ~/.rpmrc). For more infomration, see tmppath setup in rpmrc

HTH

asnowfix commented 10 years ago

@dod38fr yes, and the work-around work, but this should not be required on OSX, an OS whose built-in packaging system is not RPM & therefore where there is no /etc/rpmrc or ~/.rpmrc by default.