LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2011, 05:13 AM   #1
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Rep: Reputation: 5
cant understand how to build rpms (opensuse 11.4)


Hello,

Im trying to learn how to build rpms but I think my spec file is not correct. I have looked online and tried to copy and understand rpm build instructions but its just not working.

This is what I have:

RPM directories
Code:
/bigdrive/rpm
/bigdrive/rpm/BUILD
/bigdrive/rpm/RPMS
/bigdrive/rpm/SOURCES
/bigdrive/rpm/SRPMS
I have chmod 777 for all the directories because Im not concerned with security now(just want to get it working first).

my untared source code is in
Quote:
/bigdrive/rpm/SOURCES/HandBrake-0.9.5
My spec file is located as follows
Quote:
/bigdrive/rpm/SPECS/Handbrake-0.9.5.spec
And looks like this(I think the problem is here)
Quote:
%define _topdir /bigdrive/rpm
Summary: Handbrake
Name: HandBrake
Version: 0.9.5
Release: 1
Source: /bigdrive/rpm/
URL: http://handbrake.fr/
License: GPL
Group: Multimedia/Editing
%description
Video converter
%setup
%build
cd /bigdrive/rpm/SOURCES/HandBrake-0.9.5
CFLAGS="$RPM_OPT_FLAGS" ./configure
cd build
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%doc
I keep getting this error
Code:
petreuss@linux:/bigdrive/rpm/SPECS> sudo rpmbuild -ba HandBrake-0.9.5.spec
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.y0FWeT
+ umask 022
+ cd /bigdrive/rpm/BUILD
+ /bin/rm -rf /usr/src/packages/BUILDROOT/HandBrake-0.9.5-1.x86_64
++ dirname /usr/src/packages/BUILDROOT/HandBrake-0.9.5-1.x86_64
+ /bin/mkdir -p /usr/src/packages/BUILDROOT
+ /bin/mkdir /usr/src/packages/BUILDROOT/HandBrake-0.9.5-1.x86_64
+ cd /bigdrive/rpm/SOURCES/HandBrake-0.9.5
+ CFLAGS='-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables'
+ ./configure
/var/tmp/rpm-tmp.y0FWeT: line 30: ./configure: Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.y0FWeT (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.y0FWeT (%build)
Can anyone please help? I know I can just install the rpm with Yast but I want to understand how to make them. Another thing; when I build the normal way (./configure make && make install) I have no problem.
 
Old 11-11-2011, 06:14 AM   #2
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
Also, I created a .rpmmacros file but dont know where to put it.

Code:
        %packager       me

        %_topdir        /bigdrive/rpm
        %_tmppath       /var/tmp

        %_rpmtopdir     %{_topdir}
        %_builddir      %{_rpmtopdir}/BUILD
        %_rpmdir        %{_rpmtopdir}/RPMS
        %_sourcedir     %{_rpmtopdir}/SOURCES
        %_specdir       %{_rpmtopdir}/SPECS
        %_srcrpmdir     %{_rpmtopdir}/SRPMS
 
Old 11-11-2011, 07:11 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,360
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by Adol View Post
Im trying to learn how to build rpms
Good!


Quote:
Originally Posted by Adol View Post
I have chmod 777 for all the directories because Im not concerned with security
You should be. Learning some things you can put off (how to shoot a rifle properly, perform open heart surgery or burping the national anthem) but like other things (how to tie shoe laces, learn acceptable behaviour or Pencak Silat) should be ingrained as early as possible. If your handle is the same as your local $LOGNAME just 'sudo chmod -R 0750 /bigdrive/rpm; sudo chown -R adol:adol /bigdrive/rpm'.


Quote:
Originally Posted by Adol View Post
I keep getting this error
Code:
petreuss@linux:/bigdrive/rpm/SPECS> sudo rpmbuild -ba HandBrake-0.9.5.spec
As packages should be built as unprivileged user there's no need to use 'sudo' if you set recursive ownership and access permissions right on /bigdrive/rpm.


Quote:
Originally Posted by Adol View Post
Also, I created a .rpmmacros file but dont know where to put it.
It should reside in /home/${LOGNAME}/
 
Old 11-11-2011, 09:25 AM   #4
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by unSpawn View Post
Good!



You should be. Learning some things you can put off (how to shoot a rifle properly, perform open heart surgery or burping the national anthem) but like other things (how to tie shoe laces, learn acceptable behaviour or Pencak Silat) should be ingrained as early as possible. If your handle is the same as your local $LOGNAME just 'sudo chmod -R 0750 /bigdrive/rpm; sudo chown -R adol:adol /bigdrive/rpm'.



As packages should be built as unprivileged user there's no need to use 'sudo' if you set recursive ownership and access permissions right on /bigdrive/rpm.



It should reside in /home/${LOGNAME}/
Thank you very much. I was able to make my rpm and change permissions to be more secure.
 
  


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
no distro, custom build need help with rpms sideshowrob Linux - Software 3 06-24-2005 05:31 PM
How to make and understand RPMs wjleon Linux - Newbie 2 04-19-2005 09:46 PM
checkinstall doesn't build rpms dnraz Linux - Software 6 09-14-2004 09:14 AM
Fedora and PHP rpms vs. build linux_4_life Linux - Software 2 08-07-2004 12:31 AM
PHP rpms vs. build linux_4_life Linux - Newbie 2 08-06-2004 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 PM.

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