How to run own shell script from spec

ram s ramforummail at gmail.com
Sun Sep 6 09:31:50 UTC 2009


Hi,

I am creating on example.sh in my source folder and tar it and put it in
/home/user/rpmbuild/SOURCES directory.


In that example.sh, I am creating one directory in my tmp folder.

But, when I run the spec file, it not execute the shell script and run the
command.

I am using %pre section to run that shell script.

My spec file is,

******************************************************************

Summary: This Package install example daemon application
Name: example
Version:1
Release:5
License: CC-GNU GPL version 2.0
Group: Applications/System
Source:example-1.tar.gz
BuildRoot:%{_tmppath}/%{name}-root
Requires: python = 2.2.3
Requires: gcc
Requires(post): /bin/sh
BuildRequires:  libpcap
BuildRequires: gawk

BuildArch:x86_64
Packager:S.Jayaram

%description
This Package install CDaemon application
%prep

%setup -q
%build
%{__make}
%pre
sh example.sh
sh javacheck.sh
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_tmppath}
install -m755 example   $RPM_BUILD_ROOT%{_tmppath}/example
%makeinstall

%files
%defattr(-,root,root,-)
#%dir /home/nco_user/rpmbuild/SOURCES/example-1
%{_bindir}/*


%clean
%{__rm} -rf %{buildroot}




***************************************************************

My script is,
#!/bin/sh
mkdir /home/nco_user/rpmbuild/tmp/CDaemon

I am not able to run the script and create the folder.

When I run rpmbuild , it run properly and create the binary.

But when I installed it shows following error,

[error]
Preparing...                ###########################################
[100%]
sh: example.sh: No such file or directory
sh: javacheck.sh: No such file or directory
error: %pre(example-1-5.x86_64) scriptlet failed, exit status 127
error:   install: %pre scriptlet failed (2), skipping example-1-5
////////////////////////////////////////////////////


what is my problem.
I put my shell scripts in /home/user/rpmbuild/SOURCES/example-1/ directory
and finally tar it.

where can i call my own custom shell scripts.

thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20090906/151678e0/attachment.htm>


More information about the Rpm-list mailing list