Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make rpm-maven-plugin work on MAC OS(mavericks)

Tags:

java

maven

rpm

I use rpm-maven-plugin to generate installation package. This runs fine on UBUNTU but when i run it on mac os, I met the following errors. Is there a way to make it work on mac os?

<groupId>org.codehaus.mojo</groupId>
    <artifactId>rpm-maven-plugin</artifactId>
        <executions>
            <execution>
                <phase>prepare-package</phase>
                <goals>
                    <goal>rpm</goal>
                </goals>
            </execution>
        </executions>

[WARNING] /bin/sh: rpm: command not found
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.0.1:rpm (default) on project mongodb: RPM query for default vendor returned: '127' executing '/bin/sh -c rpm -E '%{_host_vendor}'' -> [Help 1]
like image 597
nullox Avatar asked Aug 13 '14 04:08

nullox


2 Answers

it is invoking native rpm command which is available in your ubuntu environment, for your apple environment you will have to install rpm executable

$ brew install rpm
$ brew install rpmbuild
like image 120
jmj Avatar answered Sep 17 '22 00:09

jmj


Needless to say you can also install it via macports:


$> sudo port install rpm

---> Computing dependencies for rpm

---> Dependencies to be installed: beecrypt neon kerberos5 libcomerr openssl libproxy python27 db48 db_select python_select sqlite3 vala

---> Fetching archive for beecrypt

---> Attempting to fetch beecrypt-4.2.1_5.darwin_14.x86_64.tbz2 from http://packages.macports.org/beecrypt

...

---> Applying patches to rpm

---> Configuring rpm <== takes a long time

---> Building rpm <== takes a long time

---> Staging rpm into destroot

---> Installing rpm @4.4.9_17

---> Activating rpm @4.4.9_17

---> Cleaning rpm

---> Updating database of binaries

---> Scanning binaries for linking errors

---> No broken files found.

$>

Note that in the above install, the 'Configuring rpm' and 'Building rpm' steps took a long time, so be patient, it's working in the background (but doesn't print progress markers)


$> which rpm

/opt/local/bin/rpm


I ran into another problem too while running my build; the rpmbuild step failed with: 'Unable to open temp file'.

Solution from https://www.redhat.com/archives/rpm-list/2002-June/msg00258.html is to

$> vi $HOME/.rpmmacros

& add one line to it

%_tmppath /tmp

You should be golden.

like image 36
Anand Ganesh Avatar answered Sep 17 '22 00:09

Anand Ganesh