Rpm packaging on Suse Linux


 
Thread Tools Search this Thread
Operating Systems Linux SuSE Rpm packaging on Suse Linux
# 1  
Old 02-14-2011
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.
# 2  
Old 02-14-2011
Without any knowledge of the commands in your spec file and the exact error you're getting I doubt we can help you.
# 3  
Old 02-14-2011
Hi,
Thanks for the reply.
This is the error.
Code:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.52497
+ umask 022
+ cd /usr/src/packages/BUILD
+ cd /usr/src/packages/BUILD
+ rm -rf tasmportlets-1
+ /usr/bin/gzip -dc /usr/src/packages/SOURCES/tasmportlets-1.tar.gz
+ tar -xvvf -
drwxr-xr-x 0/0               0 2011-02-09 18:59 tasmportlets-1/
-rw-r--r-- 0/0            1476 2011-02-09 18:59 tasmportlets-1/LinuxProj.war
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd tasmportlets-1
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.52497
+ umask 022
+ cd /usr/src/packages/BUILD
+ /bin/rm -rf /tmp/tasmportlets-1-buildroot
++ dirname /tmp/tasmportlets-1-buildroot
+ /bin/mkdir -p /tmp
+ /bin/mkdir /tmp/tasmportlets-1-buildroot
+ cd tasmportlets-1
+ $'\r'
: command not found497: line 27: 
error: Bad exit status from /var/tmp/rpm-tmp.52497 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.52497 (%build)

The spec file has been attached as tasmportlet_original.txt and the /var/tmp/rpm-tmp.52497 has been attached as tmp.txt.

Moderator's Comments:
Mod Comment Please use code tags for console output. You've got an PM on how to do that.
# 4  
Old 02-14-2011
2 things I've noticed:
  • Create empty lines between the prep, setup, and build sections. I'm not 100% sure on this, but I think those are required.
  • It seems the file was created on Windows. Convert it to UNIX-style first (SuSE probably has the dos2unix command available.
# 5  
Old 02-14-2011
Heyei Thanks for your help. It looks that we are getting nearer to the solution. The problem is with ./configure stage of the %build. It says
Code:
No such file or directoryerror: Bad exit status

Now I dont know what this .configure is as I already said that I am newby to linux. But so far I know that it is some config file needed for installation but in my case I am only copying and pasting the war file from one place to another. I dont know how to write this config file.

Quote:
Create empty lines between the prep, setup, and build sections.
I tried your way as well, which is at the same point, the %build. I cleaned the code below this stage but then it threw this error:
Code:
command not founderror: Bad exit status

# 6  
Old 02-14-2011
The configure script (./configure means the file/script named configure in the current directory) is usually generated by autoconf for use with automake. Since you don't need to invoke make you probably won't need it. So you can clear the build section (although the keyword still has to be there).
# 7  
Old 02-15-2011
Hi,
The problem is how to clear/ skip the %build section. I tried the following combinations but no benefit.
Code:
%build

Code:
%build
:

Can you tell me how to skip the %build stage? And thanks for looking into the matter.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Red Hat

RPM packaging a directory of files

Hi, I wonder if anyone can point me in the right direction I have a requirement to distribute a set of admin scripts that currently sit in an SVN repo by packaging them up in an RPM so that they can me unpacked to the correct location by simply installing the package .. e.g. 'yum install... (0 Replies)
Discussion started by: hcclnoodles
0 Replies

2. Linux

rpm packaging issue for unixodbc driver manager

Hi All, I am trying to make rpm package for unixODBC driver manager 2.3.0 using below spec file. During rpmbuild i am getting the error. Can you pls advice how we can overcome this issue %define name unixODBC %define ver 2.3.0 %define prefix /usr %define sysconfdir /etc %define libdir... (2 Replies)
Discussion started by: kamauv234
2 Replies

3. Shell Programming and Scripting

build rpm with SPEC file for packaging .jar and some .sh files..

Good day people, Hereby wish to have your advise for below: I have some .jar files, some script files (install.sh, action.sh) , and a libaes.so file. Basically, the .jar files compute the operation of my system and define the working directory for my system. My current scenario: i trigger... (1 Reply)
Discussion started by: cielle
1 Replies

4. Red Hat

RPM Packaging doubt!

Hi, I need to create an RPM package for my java application. Already build package for that application avail;able. I need to create binary RPM package for my java application. For that in spec file, do I need to write any script kind of thing to install my package. any one have idea... (1 Reply)
Discussion started by: ram.sj
1 Replies
Login or Register to Ask a Question