Create RPM from tarball

Latest response

I’m trying to create an rpm file to install WebLogic on a RHEL server. I have already installed WebLogic on a server and afterwards, tarred the installation. Using the tarball with satellite server, WebLogic is automatically deployed to RHEL and is ready to run when the server boots. Now, instead of using a .tar file I would like to use an .rpm file. This will give us better control over the software being installed.

I installed rpm-build on my server and set up the /rpmbuild directory structure i.e. /root/rpmbuild/BUILD, /BUILDROOT, /RPMS, /SOURCES, /SPECS, /SRPMS, /tmp, .rpmmacros. The tar file was placed in the /SOURCE directory and the WebLogic.spec file was placed in the /SPEC directory. However, running the command:

rpmbuild -ba /root/rpmbuild/SPECS/weblogic.spec

...unpacks the source file and populates the /BUILD and /BUILDROOT directories, but the program crashes on the
'Executing(%install): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.CgRyQZ’ with a file not found error ‘error: File not found: /root/rpmbuild/BUILDROOT/weblogic-1.0-1.x86_64/etc/weblogic/weblogic.conf’. I’m not sure why the program is even looking for this file since there is no file weblogic.conf on a weblogic server. Also, the weblogic.spec file is black under the ‘%install’
I know that getting the .spec file is critical to getting the RPM build, so I’ve included the file below. Does anyone have any suggestions on how to complete this effort?

Name: WeblogicInstall
Version: 1.0
Release: 1
Summary: A weblogic installation
License: GPL
Source0: weblogic.tar.gz
BuildArch: noarch
BuildRoot:  %{_tmppath}/%{name}-%{version}.%{release}

%description
Installs weblogic in the /apphome directory.

%prep
rm -rf $RPM_BUILD_DIR/12c 

%setup -q #Command changes to build directory, /usr/src/redhat/BUILD, and extracts
          #source files. Macro expects at least one of the source files will create the necessary
          #subdirectory under /usr/src/redhat/BUILD. Subdirectory should be named with the package name
          #and version, such as telnet-1.0.1. 

%build

%install

%clean
rm -rf $RPM_BUILD_ROOT

%files

%changelog

Responses

try

%define _unpackaged_files_terminate_build 0

in your spec file to disable Fascist builds, which should allow the package build to complete IIRC, it's been a while. Alternately touch a file so it exists but is zero length.

Stephen;
Thanks for the response, but this particular problem was caused by this macro in my .spec file.

%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf

When I commented out the line, the problem cleared. The line came from someone else’s .spec file that I was adapting to my needs. The line is basically saying when the RPM installs, create the %{name} (weblogic as specified on line 9 of the spec file) configuration file and ensuring that, if it already exists, it does not get replaced. However, the file has to exist first and if the rpmbuild command cannot find it (as it is listed and, therefore, necessary to create the RPM), it will fail.

Brian

Brian: glad you found it!

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.