Operating System - Linux
1755707 Members
4758 Online
108837 Solutions
New Discussion юеВ

Re: Rpm packaging on Suse Linux

 
SOLVED
Go to solution
dirshah
Occasional Contributor

Rpm packaging on Suse Linux

Hi All,
I am new to linux. Still I am asked to package a war file as an RPM package. That is an unusual RPM packaging(To me). If you guys could guide me, on how to do that, will be great. I have a war file inside a folder, that folder is inside a tar file as a SOURCE for RPM package. The structure is like below.

--RPMS
--SOURCES
--tasmportlets-1.tar.gz(its a tar file)
--tasmportlets-1(its a folder)
--tasmportlets.war
--BUILD
--SPECS
--mySpecs.spec
--SRPMS

I simply want that the war file from sources is transferred to the web app of my tomcat server through RPM. I try to package it as an RPM, but its always giving me errors in %build stage. When I try to remove %build from stage from the spec file, then it says command missing.

Can anyone please help me here Or point me in the right direction? An example will be great.

My system details are:
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 1
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"

Thanks in advance.
4 REPLIES 4
Matti_Kurkela
Honored Contributor
Solution

Re: Rpm packaging on Suse Linux

What's in your mySpecs.spec file?

What's the command you're trying to use to create the RPM? (If you're trying to run a command that specifically runs the %build stage and the %build stage does not exist in your package, it's no wonder you get an error message.)

If it turns out you absolutely have to to put something into your %build section, then put in a command that does nothing (successfully): /bin/true.

www.rpm.org has links to some books and other documentation about RPMs, You might want to read the section named "Packager documentation", if you already haven't done so.

And of course, you might find a SuSE source RPM that does something similar, and read its .spec file to see how it builds its binary RPM.

MK
MK
dirshah
Occasional Contributor

Re: Rpm packaging on Suse Linux

Hi Guys,
Finally I did it. I skipped the %build stage bu just writing echo "1" in the stage.

HTH someone else.
Ralph Grothe
Honored Contributor

Re: Rpm packaging on Suse Linux

I think that %build is a predefined RPM macro whose definition on an RHEL system can be found in /usr/lib/rpm/macros.

Maybe if you tried

rpm --eval %build

or

rpm --showrc | less

you would find an answer?
But I'm not sure with SUSE.

It's been a while since I last packaged an RPM and thus needed to create a spec file.
The documentation that helped me a tremendously then was "Maximum RPM" which I e.g. found here:

http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-macros.html
Madness, thy name is system administration
Reiner  Rottmann
Frequent Advisor

Re: Rpm packaging on Suse Linux

I've written a small script that converts a tarball to a RPM:

http://www.mindtwist.de/main/linux/3-linux-tipps/32-how-to-convert-tar-gz-archive-to-rpm-.html

Depending on your expectations on the resulting RPM, this may be a suitable and easy way - or at least a good starting point to enhance your spec file.