error in creating rpm package for a simple "Hello World" c program
hi friends,
Im new to this forum. can anyone here tell me how to create a rpm package for simple "Hello world" c program. I have created a spec file. It's giving error in Buildroot: can any one help me, Thanks in advance Jayasekar |
You might wanna ask a mod to put this in the programming forum they may be able to help you a bit more.
|
Can you please post your spec file ?
|
Welcome to LQ.
I think if you install the package rpmdevtools you might have an easier time. There are also gui rpm creators, where you can fill in text boxes. |
Quote:
This is my spec file: #script to build sample rpm %define ver 1.0 %define rel 1 %define prefix /usr Name: Demorpm Version: 1.0 Release: 1.0 Summary: To test the rpm package building process Group: Applications License: GPL #URL: Source0: %{name}-%{ver}.tar.gz Source1: %{name}-%{ver} BuildRoot: /tmp/%{name}-%{ver}-root #BuildRequires: #Requires: %description To test the sample rpm build %prep %setup make %build #make #%configure #make configure %install rm -rf ${RPM_BUILD_ROOT} make install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc #%changelog |
|
As suggested by AwsomeMachine, please install rpmdevtools and take a look at /etc/rpmdevtools/spectemplate-minimal.spec, or simply do:
Code:
cd ~/rpmbuild cheers |
Quote:
rpmdevtools is installed first and then only i have started to build rpm. Im using fedora-11, given below r the errors... [root@js SPECS]# rpmbuild -bb Demorpm.spec Executing(%prep): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.8xfvPl + umask 022 + cd /root/rpmbuild/BUILD + LANG=C + export LANG + unset DISPLAY + cd /root/rpmbuild/BUILD + rm -rf Demorpm-1.0 + /bin/tar -xf /root/rpmbuild/SOURCES/Demorpm-1.0.tar.gz + cd Demorpm-1.0 + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + exit 0 Executing(%build): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.MqnIYn + umask 022 + cd /root/rpmbuild/BUILD + cd Demorpm-1.0 + LANG=C + export LANG + unset DISPLAY + make gcc -Wall -O2 -I/usr/include -DVERSION="1.0" -c sample.c gcc -Wall -O2 -I/usr/include -DVERSION="1.0" sample.o -o sample + CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables' + export CFLAGS + CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables' + export CXXFLAGS + FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables -I/root/rpmbuild/lib/gfortran/modules' + export FFLAGS + ./configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i586-redhat-linux-gnu --program-prefix= --prefix=/root/rpmbuild --exec-prefix=/root/rpmbuild --bindir=/root/rpmbuild/bin --sbindir=/root/rpmbuild/sbin --sysconfdir=/etc --datadir=/root/rpmbuild/share --includedir=/root/rpmbuild/include --libdir=/root/rpmbuild/lib --libexecdir=/root/rpmbuild/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info + ./configure --prefix=/usr + exit 0 Executing(%install): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.gwEBhq + umask 022 + cd /root/rpmbuild/BUILD + cd Demorpm-1.0 + LANG=C + export LANG + unset DISPLAY + rm -rf /root/rpmbuild/BUILDROOT/Demorpm-1.0-1.0.i386 + make install removed `/usr/bin/sample' `sample' -> `/usr/bin/sample' + /usr/lib/rpm/find-debuginfo.sh --strict-build-id /root/rpmbuild/BUILD/Demorpm-1.0 find: `/root/rpmbuild/BUILDROOT/Demorpm-1.0-1.0.i386': No such file or directory error: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.gwEBhq (%install) RPM build errors: Bad exit status from /root/rpmbuild/tmp/rpm-tmp.gwEBhq (%install) |
Problem solved
Quote:
Modify the spec file as shown below %prep %setup -q %build make %configure ./configure --prefix=/usr %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}/usr/bin make install _prefix=${RPM_BUILD_ROOT} $RPM_BUILD_ROOT/usr/bin/%{name} it will work as u think useful link: http://articles.techrepublic.com.com...tag=rbxccnbtr1 Thanks for your help and spending time to analyse my problem.. Thank you very much. |
All times are GMT -5. The time now is 04:22 PM. |