LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error displayed on creating rpm package on Red Hat Linux. (https://www.linuxquestions.org/questions/linux-newbie-8/error-displayed-on-creating-rpm-package-on-red-hat-linux-4175423359/)

vivekvraj 08-22-2012 01:55 AM

Error displayed on creating rpm package on Red Hat Linux.
 
Hi,

I am very new to rpm packaging (new learner :)).
Please find below mentioned spec file (apache-tomcat-5.5.35-src.spec) content:
------------------------------
Summary: Apache Tomcat source to bytecode compiler
%define version 5.5.35
Group: Development/Languages
Name: ApacheTomcat
Prefix: /usr
Provides: ApacheTomcat
Release: 1
Source: apache-tomcat-5.5.35-src.tar.gz
URL: http://tomcat.apache.org/download-55.cgi
Version: 5.5.35
Buildroot: /root/ApacheTomcat/ApacheTomcat-5.5.35
License: /apache-tomcat-5.5.35-src.tar.gz/apache-tomcat-5.5.35-src/LICENSE
%description
This is the top-level entry point of the documentation bundle for the Apache Tomcat Servlet/JSP container. Apache Tomcat version 5.5 implements the Servlet 2.4 and JavaServer Pages 2.0 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services.

%prep
%setup -q

%build
./configure CXXFLAGS=-O3 --prefix=$RPM_BUILD_ROOT/usr
make

%install
rm -fr $RPM_BUILD_ROOT
make install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0444,root,root)
/usr/bin/ApacheTomcat
-------------------------------------

while building rpm using the command 'rpmbuild -bb spec_file_name ' it displayed :

-----------------------------------
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.78993
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf ApacheTomcat-5.5.35
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/apache-tomcat-5.5.35-src.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ApacheTomcat-5.5.35
/var/tmp/rpm-tmp.78993: line 36: cd: ApacheTomcat-5.5.35: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.78993 (%prep)


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

Please help me to resolve this and let me know why this happened.... Thanks in advance... :)

unSpawn 08-22-2012 10:04 PM

Quote:

Originally Posted by vivekvraj (Post 4760794)
Code:

+ cd /usr/src/redhat/BUILD

Please don't build packages as root but as unprivileged user.



Quote:

Originally Posted by vivekvraj (Post 4760794)
Code:

+ cd ApacheTomcat-5.5.35
/var/tmp/rpm-tmp.78993: line 36: cd: ApacheTomcat-5.5.35: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.78993 (%prep)


Please use lowercase directive, file and directory names in .spec files except where required (like BestCrypt or BCWipe .src.rpms).


Also:
- License is a type (GPL, MIT, BSD) and not a file.
- Name may be "tomcat", RHEL5(-like) ship tomcat5-* packages (tomcat5, tomcat5-admin-webapps, tomcat5-jsp-2.0-api-javadoc, tomcat5-servlet-2.4-api, you get the idea).
- %files section looks odd, it most likely doesn't contain only "/usr/bin/ApacheTomcat". Best read some basic RPM-packager docs, Fedora has a good one.


All times are GMT -5. The time now is 07:44 PM.