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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting build rpm with SPEC file for packaging .jar and some .sh files..
# 1  
Old 04-02-2012
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
Code:
install.sh

to set up the my service with /etc/init.d and with command
Code:
service xSystem start

to start up my system.
Code:
service xSystem start

will eventually trigger
Code:
action.sh

with passing parameter
Code:
start

to run the .jar file.

Now i intend package my system into rpm. I tried to write the SPEC file to build the rpm but i failed. Hope to have some guidance here.

Below is my SPEC file content:

Code:
# This is a spec file for xSystem

%define _topdir	 	/usr/src/redhat
%define name		xSystem
%define release		1
%define version 	1.0
%define buildroot %{_topdir}/%{name}-%{version}-root

BuildRoot:	%{buildroot}
Summary: 		GNU xSystem
License: 		GPL
Name: 			%{name}
Version: 		%{version}
Release: 		%{release}
Source: 		%{name}-%{version}.tar.gz
Prefix: 		/usr
Group: 			Applications/System

%description
xSystem's description is here.


%prep
%build
/%{name}/.install.sh

%files

I tar all my .jar, .sh, and .so files and place it under /usr/src/redhat/SOURCES and place my SPEC file under /usr/src/redhat/SPECS .. then i execute
Code:
rpmbuild xSystem.spec

from the SPECS directory.

But unfortunately, i can't find any .rpm file after executing that command.
What i have missed out?

please advice again.. I have come across with reference on making rpm with spec files.. but most of the one i found is working on .c file.. and not really matching my scenario. I have run out of idea..

I appreciate for guidance given here.

Many thanks again.

---------- Post updated 04-02-12 at 09:00 PM ---------- Previous update was 04-01-12 at 10:59 PM ----------

Hope to have any guidance again..

Seriously need help on this.

Many thanks.
# 2  
Old 04-02-2012
build rpm with SPEC file for packaging .jar and some .sh files..

Good day people,

I have posted this under Linux' Red Hat session but no luck.
Hope can have some luck here with my problem.

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 install.sh to set up the my service with /etc/init.d and with command service xSystem start to start up my system.

service xSystem start will eventually trigger action.sh with passing parameter start to run the .jar file.

Now i intend package my system into rpm. I tried to write the SPEC file to build the rpm but i failed. Hope to have some guidance here.

Below is my SPEC file content:

Code:
# This is a spec file for xSystem

%define _topdir	 	/usr/src/redhat
%define name		xSystem
%define release		1
%define version 	1.0
%define buildroot %{_topdir}/%{name}-%{version}-root

BuildRoot:	%{buildroot}
Summary: 		GNU xSystem
License: 		GPL
Name: 			%{name}
Version: 		%{version}
Release: 		%{release}
Source: 		%{name}-%{version}.tar.gz
Prefix: 		/usr
Group: 			Applications/System

%description
xSystem's description is here.


%prep
%build
/%{name}/.install.sh

%files

I tar all my .jar, .sh, and .so files and place it under /usr/src/redhat/SOURCES and place my SPEC file under /usr/src/redhat/SPECS .. then i execute
rpmbuild xSystem.spec from the SPECS directory.

But unfortunately, i can't find any .rpm file after executing that command.
What i have missed out?

please advice again.. I have come across with reference on making rpm with spec files.. but most of the one i found is working on .c file.. and not really matching my scenario. I have run out of idea..

I appreciate for guidance given here.

Many thanks again.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies

2. 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

3. Red Hat

RedHat version in rpm spec files

Hi In opensuse we have this nice version control variable I use much when designing rpm spec files: rpm --showrc | grep suse_version %if 0%{?suse_version} > 0 && 0%{?suse_version} < 1700 -14: suse_version 1140But I do not find anything close to this in rhel/centos The only way... (0 Replies)
Discussion started by: mortenb
0 Replies

4. 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

5. Shell Programming and Scripting

Calling script from a RPM spec file

Hi, I want to execute a script "myscript.sh" in the %post part of a rpm spec file. Suppose the script is placed in /opt/path. Then simply calling like sh /opt/path/myscript.sh from %post part (of that spec file) will suffice? Or there is any other way? (0 Replies)
Discussion started by: saurabhkoar
0 Replies

6. SuSE

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.... (8 Replies)
Discussion started by: dirshah
8 Replies

7. Shell Programming and Scripting

Need help writing RPM .spec file

I'm new to this. This installer just installs PHP code so NOTHING needs to be built (do I still need to use the build and buildroot directories?). I would just like to create an installer (spec) that: 1) unpacks a tarball 2) moves the unpacked files to the installation target 3) runs a script... (2 Replies)
Discussion started by: stevenswj
2 Replies

8. 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

9. UNIX for Advanced & Expert Users

Help needed to build an RPM?

I use Fedora Core 6. ->Our application has a Binary file and few .SO files. So i would like to build an RPM FILE for this with .SPEC file. ->Even i need to set some Envirnoment variables. Can any one give me the steps to Build an RPM?(A bit more clearly please as I am very new to... (1 Reply)
Discussion started by: platso
1 Replies
Login or Register to Ask a Question