LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-10-2012, 05:50 AM   #1
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Rep: Reputation: Disabled
Exclamation RPM Building in RHEL6


hi not able to create RPM... getting error while building RPM, if possible guide me in sequence steps...

here is some confuguration i hv done..
[root@station4 ~]# mkdir rpmbuild
[root@station4 ~]# mkdir rpmbuild/SOURCES
[root@station4 ~]# mkdir rpmbuild/SPECS
[root@station4 ~]# mkdir test-0.1
[root@station4 ~]# vim test-0.1/test1
#!/bin/bash
echo "Hello"

[root@station4 ~]# vim test-0.1/test2
#!/bin/bash
echo "How"

[root@station4 ~]# vim test-0.1/test3
#!/bin/bash
echo "Are You..??"

[root@station4 ~]# tar -cvzf test-0.1.tar.gz test-0.1/
[root@station4 ~]# cp test-0.1.tar.gz ~/rpmbuild/SOURCES/
[root@station4 ~]# vim rpmbuild/SPECS/test.spec

Name: Test
Version: 0.1
Release: 1%{?dist}
Summary: Good

Group: System Enviroment/Base
License: GPLv2
Source0: test-0.1.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)


%description
This is Awesome

%prep
%setup -q


%build
echo "OK"


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/root/bin
cp test1 $RPM_BUILD_ROOT/root/bin
cp test2 $RPM_BUILD_ROOT/root/bin
cp test3 $RPM_BUILD_ROOT/root/bin



%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%attr(0777,root,root)/root/bin/test1
%attr(0777,root,root)/root/bin/test2
%attr(0777,root,root)/root/bin/test3



%changelog
* Fri Feb 10 2012 test<test@example.com>-0.1
TYPE ANY COMMENT WHAT YOU LIKE

[root@station4 ~]# rpmbuild -ba rpmbuild/SPECS/test.spec

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.cIPmSL
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf Test-0.1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/test-0.1.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd Test-0.1
/var/tmp/rpm-tmp.cIPmSL: line 34: cd: Test-0.1: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.cIPmSL (%prep)


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


Please help me out where is did mistake..
 
Old 02-10-2012, 06:01 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,439

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Edit line 1 from : Name: Test
To : Name: test


And : It's not a good idea to build packages as root.
'root' is for administrative tasks only.

Please log in as <user-name>, and set up an unprivileged
rpm build account in /home/<user-name>/ :
http://www.linuxquestions.org/questi...1-a-766486/#13
> Post #13.
 
Old 02-10-2012, 06:33 AM   #3
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
getting the same error after updating the 1st line

getting the same error after updating the 1st line "Name: Test" to "Name: test" and tested through the user account "student"

[student@station4 ~]$ rpmbuild -ba rpmbuild/SPECS/test.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.O4TFQ1
+ umask 022
+ cd /home/student/rpmbuild/BUILD
+ cd /home/student/rpmbuild/BUILD
+ rm -rf test-0.1
+ /bin/tar -xf -
+ /usr/bin/gzip -dc /home/student/rpmbuild/SOURCES/test-0.1.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd test-0.1
/var/tmp/rpm-tmp.O4TFQ1: line 34: cd: test-0.1: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.O4TFQ1 (%prep)



RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.O4TFQ1 (%prep)
 
Old 02-10-2012, 06:14 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,439

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Using the file .rpmmacros , etc. from
http://www.linuxquestions.org/questi...1-a-766486/#13

.. And edited your file test.spec, line 9 to
BuildRoot: %{_tmppath}/%{name}-%{version}-build
( And line 1 to : Name: test )

.. Then no errors on "EL6" : ( rpmbuild -bb test.spec ( No 'su' ))
Code:
Wrote: /home/knudfl/rpms/RPMS/i686/test-0.1-1.el6.i686.rpm
Wrote: /home/knudfl/rpms/RPMS/i686/test-debuginfo-0.1-1.el6.i686.rpm

Last edited by knudfl; 02-10-2012 at 06:19 PM.
 
Old 02-11-2012, 08:17 AM   #5
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
error has changed..

Done the changes in '/home/student/rpmbuild/SPECS/test.spec' in the 1st and 9th line
Name: test
BuildRoot: %{_tmppath}/%{name}-%{version}-x86_64


and created
[student@server1 ~]$ echo "%_topdir `echo $HOME/rpmbuild`" > $HOME/.rpmmacros

file in the homedir of 'student' with the entries:

%_topdir /home/student/rpmbuild
%_tmppath %{_topdir}/tmp


But after that while running the rpmbuild command getting the output but now the output has changed.

[student@server1 ~]$ rpmbuild -bb rpmbuild/SPECS/test.spec
Executing(%prep): /bin/sh -e /home/student/rpmbuild/tmp/rpm-tmp.Yf6ZOt
+ umask 022
+ cd /home/student/rpmbuild/BUILD
+ cd /home/student/rpmbuild/BUILD
+ rm -rf test-0.1
+ /usr/bin/gzip -dc /home/student/rpmbuild/SOURCES/test-0.1.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd test-0.1
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /home/student/rpmbuild/tmp/rpm-tmp.cK1H9C
+ umask 022
+ cd /home/student/rpmbuild/BUILD
+ cd test-0.1
+ echo OK
OK
+ CFLAGS='-O2 -g'
+ export CFLAGS
+ CXXFLAGS='-O2 -g'
+ export CXXFLAGS
+ FFLAGS='-O2 -g'
+ export FFLAGS
+ ./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
/home/student/rpmbuild/tmp/rpm-tmp.cK1H9C: line 33: ./configure: No such file or directory
error: Bad exit status from /home/student/rpmbuild/tmp/rpm-tmp.cK1H9C (%build)


RPM build errors:
Bad exit status from /home/student/rpmbuild/tmp/rpm-tmp.cK1H9C (%build)
 
Old 02-11-2012, 09:47 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
You have a %build section but you don't actually './configure; make' something so comment it out.
 
Old 02-11-2012, 10:11 AM   #7
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
its already commented in '/home/student/rpmbuild/SPECS/test.spec'

#%configure
#make %{?_smp_mflags}

Last edited by anas_lko; 02-11-2012 at 10:12 AM.
 
Old 02-11-2012, 10:45 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,439

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Don't know what is happening.

Your original spec file from post #1 works OK,
with the two edits.
I don't think I changed anything else,
but please try for yourself :
The file is attached.
.
Attached Files
File Type: txt test.spec.txt (680 Bytes, 152 views)
 
Old 02-11-2012, 10:56 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,439

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
#7
Quote:
#%configure
OK, I can see the error now :
Why have any words like configure and make added to a spec file
when you don't want to do 'configure' or 'make' ? ?

! A line starting with % cannot be commented out !


.
 
Old 02-11-2012, 11:21 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Quote:
Originally Posted by knudfl View Post
A line starting with % cannot be commented out
Sure but you'll have to make the %section read %%section ;-p
 
Old 02-11-2012, 01:48 PM   #11
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
getting issue while signing the package

well guys knudfl and unSpawn thanks alot for yr concern i hv removed both the lines "configure" and "make" and im succeed to build the RPM but not the probem occured in signing that RPM...when trying to sigh the RPM with the command "gpg --gen-key" but getting error "/home/student/.gnupg/S.gpg-agent': No such file or directory"
[student@server1 ~]$ gpg --gen-key
gpg (GnuPG) 2.0.14; Copyright (C) 2009 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 0
Key does not expire at all
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: Student
Email address: student@server1.example.com
Comment: IT
You selected this USER-ID:
"Student (IT) <student@server1.example.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

can't connect to `/home/student/.gnupg/S.gpg-agent': No such file or directory
No protocol specified
xprop: unable to open display ':0.0'
No protocol specified

(pinentry-gtk-2:5490): Gtk-WARNING **: cannot open display: :0.0
gpg-agent[5489]: can't connect server: ec=4.16383
gpg-agent[5489]: can't connect to the PIN entry module: End of file
gpg-agent[5489]: command get_passphrase failed: No pinentry
gpg: problem with the agent: No pinentry
gpg: Key generation canceled.
 
Old 02-11-2012, 02:09 PM   #12
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
pinentry issue :(

chkd my running the command "eval $(gpg-agent --daemon)"
issue resolved but now its showing
gpg: problem with the agent: No pinentry
gpg: Key generation canceled.

Last edited by anas_lko; 02-12-2012 at 04:02 AM.
 
Old 02-12-2012, 10:41 AM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
"pinentry is a small collection of dialog programs that allow GnuPG to read passphrases and PIN numbers in a secure manner. There are versions for the common GTK and Qt toolkits as well as for the text terminal (Curses)."

Check if there is a 'ls -al /usr/bin/pinentry*' and if the "pinentry-program" directive in ~/.gnupg/gpg-agent.conf points to it?
 
Old 02-12-2012, 02:30 PM   #14
anas_lko
LQ Newbie
 
Registered: Jan 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
[student@server1 ~]$ ls -al /usr/bin/pinentry*
-rwxr-xr-x. 1 root root 2135 Oct 10 2009 /usr/bin/pinentry
-rwxr-xr-x. 1 root root 52296 Apr 29 2010 /usr/bin/pinentry-curses
lrwxrwxrwx. 1 root root 14 Feb 4 19:31 /usr/bin/pinentry-gtk -> pinentry-gtk-2
-rwxr-xr-x. 1 root root 119488 Apr 29 2010 /usr/bin/pinentry-gtk-2
-rwxr-xr-x. 1 root root 222344 Apr 29 2010 /usr/bin/pinentry-qt


no "gpg-agent.conf" file found in "~/.gnupg/"

[student@server1 ~]$ ll -a ~/.gnupg/
total 28
drwx------. 3 student student 4096 Feb 12 00:02 .
drwx------. 7 student student 4096 Feb 13 01:00 ..
-rw-------. 1 student student 7856 Feb 11 23:56 gpg.conf
drwx------. 2 student student 4096 Feb 11 23:58 private-keys-v1.d
-rw-------. 1 student student 0 Feb 11 23:56 pubring.gpg
-rw-------. 1 student student 600 Feb 12 14:43 random_seed
-rw-------. 1 student student 0 Feb 11 23:56 secring.gpg
-rw-------. 1 student student 40 Feb 12 00:00 trustdb.gpg
 
Old 02-12-2012, 02:46 PM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Quote:
Originally Posted by anas_lko View Post
Code:
 ~]$ ls -al /usr/bin/pinentry*
-rwxr-xr-x. 1 root root   2135 Oct 10  2009 /usr/bin/pinentry
-rwxr-xr-x. 1 root root  52296 Apr 29  2010 /usr/bin/pinentry-curses
lrwxrwxrwx. 1 root root     14 Feb  4 19:31 /usr/bin/pinentry-gtk -> pinentry-gtk-2
-rwxr-xr-x. 1 root root 119488 Apr 29  2010 /usr/bin/pinentry-gtk-2
-rwxr-xr-x. 1 root root 222344 Apr 29  2010 /usr/bin/pinentry-qt
AFAIK /usr/bin/pinentry should be a link to one of /usr/bin/pinentry-{gtk,qt,curses}.


Quote:
Originally Posted by anas_lko View Post
no "gpg-agent.conf" file found in "~/.gnupg/"
OK. Maybe try 'grep -r ~/.gnupg/ -e pinentry' then?
 
  


Reply

Tags
rpmbuild


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
rpm repackage option not working rhel6 MANOHARNLINUX Linux - Enterprise 3 11-01-2011 04:02 PM
RHEL6 xfs support and RPM's drews4ya Red Hat 1 07-27-2011 08:41 PM
Building rpm pvpnguyen Programming 4 11-23-2006 11:57 AM
Help building an .rpm from a .src.rpm ssenuta Linux - Software 6 04-10-2006 11:36 PM
Building RPM via src.Rpm ivanatora Linux - Newbie 2 02-20-2006 05:29 PM

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

All times are GMT -5. The time now is 08:42 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
Open Source Consulting | Domain Registration