Getting Error while Building RPM
Getting Error while Building RPM
Hi,
I am trying to build a RPM from the ear file. I installed the rpmbuild software. In the source directory I have placed my ear file. In the SPECS directory I have my spec file.
When I run rpmbuild -ba build-rpm.spec, i am getting below error. Could someone suggest some idea?
[root@clab756node02 SPECS]# rpmbuild -ba build-rpm.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.2813
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf sample
+ /usr/bin/unzip -qq /usr/src/redhat/SOURCES/sample-application-ear-1.0.ear
replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd sample
/var/tmp/rpm-tmp.2813: line 30: cd: sample: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.2813 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.2813 (%prep)
Thanks,
Vikram RM
I am trying to build a RPM from the ear file. I installed the rpmbuild software. In the source directory I have placed my ear file. In the SPECS directory I have my spec file.
When I run rpmbuild -ba build-rpm.spec, i am getting below error. Could someone suggest some idea?
[root@clab756node02 SPECS]# rpmbuild -ba build-rpm.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.2813
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf sample
+ /usr/bin/unzip -qq /usr/src/redhat/SOURCES/sample-application-ear-1.0.ear
replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd sample
/var/tmp/rpm-tmp.2813: line 30: cd: sample: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.2813 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.2813 (%prep)
Thanks,
Vikram RM
Re: Getting Error while Building RPM
I'm no expert on build_rpm, but might explain why can't find the directory, unless of course you are expecting the unzip to recreate it.
Code: Select all
+ rm -rf sample
Code: Select all
+ cd sample
Re: Getting Error while Building RPM
Code: Select all
Name: sample
Version: 1.0
Release: 21%{?dist}
License: GPLv2+
Group: System Environment/Base
Source: sample-application-ear-1.0.ear
URL: http://www.pobox.com/~tranter
BuildRoot: /var/tmp/sample-1.0
ExcludeArch: s390 s390x
BuildRequires: gettext
%description
The eject program allows the user to eject removable media (typically
CD-ROMs, floppy disks or Iomega Jaz or Zip disks) using software
control. Eject can also control some multi-disk CD changers and even
some devices' auto-eject features.
Install eject if you'd like to eject removable media using software
control.
%prep
%setup -q -n sample
%build
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/man/man1
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README TODO COPYING ChangeLog
/usr/bin/sample
/usr/man/man1/sample.1
%changelog
* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 3)
* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.
[ Some changelog entries trimmed for brevity. -Editor. ]
Re: Getting Error while Building RPM
Sorry, but as I said I'm no expert on rpm building. I was just "another pair of eyes" reading the log and trying to learn from others.
Re: Getting Error while Building RPM
Yes I understand, But In the spec file i have not given "rm -rf sample" anywhere. But i am not sure why it is getting executed.
I will wait for some experts to reply.
Thanks for replying.
I will wait for some experts to reply.
Thanks for replying.
Re: Getting Error while Building RPM
1st : NEVER build RPM as root.[root@clab756node02 SPECS]# rpmbuild -ba build-rpm.spec
2st : is unzip doesn't create the folder, you should use %setup -q -c
- AlanBartlett
- Forum Moderator
- Posts: 9345
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
Re: Getting Error while Building RPM
Please consult the CentOS wiki.
The following two pages will get you started --
* http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
* http://wiki.centos.org/HowTos/RebuildSRPM
The Fedora Project's RPM Guide is essential reading.
The following two pages will get you started --
* http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment
* http://wiki.centos.org/HowTos/RebuildSRPM
The Fedora Project's RPM Guide is essential reading.
100% Linux and, previously, Unix. Co-founder of the ELRepo Project.
Re: Getting Error while Building RPM
Thanks remirepo and AlanBartlet for replying.
@remirepo I have modified my spec file as below with "-c"
But getting the below error.
permission denied for creating the directory. Am i missing something? where will this spec fill will be creating the 'sample-1.0 directory?
@remirepo I have modified my spec file as below with "-c"
Code: Select all
%setup -q -c sample
Code: Select all
[vikram@clab756node02 SPECS]$ rpmbuild -ba build-rpm.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.82296
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf sample-1.0
+ /bin/mkdir -p sample-1.0
/bin/mkdir: cannot create directory `sample-1.0': Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.82296 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.82296 (%prep)
[vikram@clab756node02 SPECS]$ vi build-rpm.spec
[vikram@clab756node02 SPECS]$ rpmbuild -bp build-rpm.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.55266
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf sample-1.0
+ /bin/mkdir -p sample-1.0
/bin/mkdir: cannot create directory `sample-1.0': Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.55266 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.55266 (%prep)
Re: Getting Error while Building RPM
Now I can able to build a RPM. but i cannot see inside the cpio file to see the source packaged in it.
this is my new spec file, could someone look into the file and tel me is something wrong with the file?
I have one more doubt. What is the make command for? do we need to provide any make file for Building RPM? if so what is the content of the make file?
this is my new spec file, could someone look into the file and tel me is something wrong with the file?
Code: Select all
Name: oneconsole
Version: 1.0
Release: 1%{?dist}
Summary: One Console
Group: System Environment/Base
License: GPLv2+
URL: http://www.pobox.com/~tranter
Source0: oneconsole-application-ear-1.0.ear
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gettext
%description
One console
%prep
%setup -q -c
%build
%install
rm -rf %{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc
%changelog