LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2013, 01:26 PM   #1
bowserjr
LQ Newbie
 
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
Redhat Linux rpmbuild issue


Hello all,
I am trying to build an rpm in my redhat linux server and have been experiencing issues with the build being successful.

I'm running the following version of linux and software tools

Red Hat Enterprise Linux Server release 6.1 (Santiago)
rpm-build-4.8.0-16.el6.x86_64
rpm-libs-4.8.0-16.el6.x86_64
redhat-rpm-config-9.0.3-42.el6.noarch
rpm-4.8.0-16.el6.x86_64

I decided to start off with a simple build of one directory and one file. Here is my spec file.

Name: MikeMntr
Summary: Software tools
Version: 1.0
Release: 1
License:
Vendor:
Packager: Mike Bowser
Group:
Source: mike.tar.gz


%description
Software tools for Mike

%pre
echo "*** Monitoring Tools 1.0-1 installation ***"

%install
tar -zxpf $RPM_SOURCE_DIR/mike.tar.gz -C"/tmp/"

%post
echo "MikeMntr*** successfully installed! ***"
exit

%preun
echo "*** monitoring tools 1.0-1 uninstalling ***"

%postun
echo "*** successfully uninstalled! ***"
exit

%files
/tmp/mikerpm
/tmp/mikerpm/test.txt


The rpmbuild command completes with no issues when I delete the absolute pathways and names under the %files line. When those are listed I have issues. I'm assuming this is a config issue because its trying to find my source files in a different location than I'm storing them but I'm just not sure where to begin looking. Please direct me to another thread if this question has already been answered. As always any help or feedback is appreciated.

$rpmbuild -ba mike.spec
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.qVTWIY
+ umask 022
+ cd /appl/jrpm/rpmbuild/BUILD
+ '[' /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64 '!=' / ']'
+ rm -rf /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64
++ dirname /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64
+ mkdir -p /appl/jrpm/rpmbuild/BUILDROOT
+ mkdir /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64
+ LANG=C
+ export LANG
+ unset DISPLAY
+ tar -zxpf /appl/jrpm/rpmbuild/SOURCES/mike.tar.gz -C/tmp/
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: MikeMntr-1.0-1.x86_64
error: File not found: /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64/tmp/mikerpm
error: File not found: /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64/tmp/mikerpm/test.txt


RPM build errors:
File not found: /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64/tmp/mikerpm
File not found: /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1.0-1.x86_64/tmp/mikerpm/test.txt



Thank you
 
Old 05-25-2013, 03:40 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564
Quote:
Originally Posted by bowserjr View Post
Please direct me to another thread if this question has already been answered.
See for example this thread: http://www.linuxquestions.org/questi...pm-4175461744/
 
Old 05-29-2013, 06:15 PM   #3
bowserjr
LQ Newbie
 
Registered: May 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Linux RPMBuild issue

So I looked at that link and understand how the %setup macro works and fixed that, but now my rpmbuild is failing in the install section. I guess I'm not clear on how to get my source file mike.tar.gz into the build directory when I don't know what the pathway will be beforehand. Any help is appreciated.

SPEC FILE
Summary: My first rpm script package
Name: MikeMntr
Version: 1
Release: 1
Source0: mike.tar.gz
License: GPL
Group: MyJunk
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-buildroot
%description
Make some relevant package description here
%prep
%setup -n mikerpm
%build
%install
tar -zxpf $RPM_BUILD_ROOT/mike.tar.gz -C"/tmp/"
%clean
rm -rf $RPM_BUILD_ROOT
%post
echo " "
echo "This will display after rpm installs the package!"
%files
%dir /tmp/mikerpm
/tmp/mikerpm/test.txt

MY RPMBUILD OUTPUT
$rpmbuild -ba ../SPECS/mike2.spec
Executing(%prep): /bin/sh -e /appl/jrpm/rpmbuild/tmp/rpm-tmp.8z7gtK
+ umask 022
+ cd /appl/jrpm/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /appl/jrpm/rpmbuild/BUILD
+ rm -rf mikerpm
+ /usr/bin/gzip -dc /appl/jrpm/rpmbuild/SOURCES/mike.tar.gz
+ /bin/tar -xvvf -
drwxrwxr-x jrpm/jrpm 0 2013-05-15 13:38 mikerpm/
-rw-rw-r-- jrpm/jrpm 21 2013-05-15 13:38 mikerpm/test.txt
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mikerpm
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /appl/jrpm/rpmbuild/tmp/rpm-tmp.ErHqWh
+ umask 022
+ cd /appl/jrpm/rpmbuild/BUILD
+ cd mikerpm
+ LANG=C
+ export LANG
+ unset DISPLAY
+ exit 0
Executing(%install): /bin/sh -e /appl/jrpm/rpmbuild/tmp/rpm-tmp.S5rorP
+ umask 022
+ cd /appl/jrpm/rpmbuild/BUILD
+ '[' /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64 '!=' / ']'
+ rm -rf /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64
++ dirname /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64
+ mkdir -p /appl/jrpm/rpmbuild/BUILDROOT
+ mkdir /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64
+ cd mikerpm
+ LANG=C
+ export LANG
+ unset DISPLAY
+ tar -zxpf /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64/mike.tar.gz -C/tmp/
tar (child): /appl/jrpm/rpmbuild/BUILDROOT/MikeMntr-1-1.x86_64/mike.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
error: Bad exit status from /appl/jrpm/rpmbuild/tmp/rpm-tmp.S5rorP (%install)


RPM build errors:
Bad exit status from /appl/jrpm/rpmbuild/tmp/rpm-tmp.S5rorP (%install)
 
Old 05-30-2013, 02:14 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564Reputation: 3564
Quote:
Originally Posted by bowserjr View Post
Code:
%install
tar -zxpf $RPM_BUILD_ROOT/mike.tar.gz -C"/tmp/"
The %setup section already installs %{name}.tar.gz into your %{_buildroot} so usually the %install section will contain 'mkdir', 'make install' and suchlike commands, copying files from /appl/jrpm/rpmbuild/BUILD/%{name}/ to $RPM_BUILD_ROOT and your %{name}.tar.gz doesn't reside in /appl/jrpm/rpmbuild/BUILDROOT/%{name}-%{version}-%{release}.%{arch}/ ($RPM_BUILD_ROOT) but in /appl/jrpm/rpmbuild/SOURCES/ (the $RPM_SOURCE_DIR something).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RedHat Linux AS 2.1 FTP issue deal732 Red Hat 1 01-17-2009 06:30 PM
redhat Linux power off issue steeles Linux - General 4 06-03-2008 09:24 AM
rpmbuild doesn't produce the source code in /usr/src/redhat/BUILD Niceman2005 Linux - Software 2 11-29-2004 05:58 PM
Redhat linux 7.3 password issue mobassir Linux - General 4 01-12-2004 04:25 PM
rpmbuild redhat 8.0 stevenhasty Linux - Newbie 2 04-01-2003 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration