PDA

View Full Version : How to deploy compiled applications using RPM?



mp33919
24th November 2014, 22:23
Now my boss asks me to deploy the program using RPM. I tried to find out how to do it. I read a lot of articles. Here are what I have:
Follows one article, I have created .rpmmacros file that contains resides in /home/me directory:
%_topdir
%_builddir
%_rpmdir
%_sourcedir
%_specdir
%_srcrpmdir

Then, I created a spec file named:myapp.spec resides in my project (/home/me/MyApp )where the makefile resides:
the spec file contains:
%define name myapp
%define version 1.1

Summary: My Qt Application
Name: name
Version: version
Release: 1%{?dist}

Group: Applications
License: GPL
Source0: myapp

%description
An application made from Qt

%prep
(nothing in here)

%build
(nothing in here)

%install
(nothing in here)

%clean
(nothing in here)

%files
%defattr(-,root,root)
%doc

Then, I type:
MyApp]$rpmbuild -bb myapp.spec

I got error:
/var/tmp/rpm-tmp.qCxNyz: line 35 ./configure: no such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.qCxNyz (%build)

Well, when the Qt(5.2.1) builds the application, it did not have configure file generated. So, how can I fix this problem? Is there any other way to pack with RPM?

Can anyone help for this issue?

Thanks in advance!

anda_skoa
25th November 2014, 05:39
It is just likely that, without any further information about the build process, rpmbuild falls back to assuming autotools.

Since there are many other build systems, e.g. qmake and cmake, it has to have options to deal with these as well.
Maybe that is what the "prep" and "build" sections are about?

Which build system are you using?

Cheers,
_

mp33919
25th November 2014, 14:44
anda_skoa,
Thanks for your replying.
First thing I like to say: the article I was mention above is: www.advenage.com/topics/binary-RPM.php. In that article, seems like nothing I need to put in the %prep and %build sections.
Second: I only want to RPM one file - an executable file. I don't attempt to RPM all the source files.
Third: I have tried other way too. I tarball myapp to myapp.tar.gz and put %setup -n tmp in %prep section and myapp.pro make in the %build section. I got error: /var/tmp/rpm-tmp.dWoeTz: line 38: cd tmp: No such file or directory error: ... Bad exit status from /var/tmp/rpm-tmp.dWoeTz (%prep). I did mkdir tmp under BUILD directory. I did find the myapp was unpacked in BUILD directory but the tmp directory was removed.
Forth: my build directory is /home/me/rpmbuild. The BUILD, SPECS, ... are all under rpmbuild directory
The myapp was created by Qt (3.3.8b), compiled in CentOS 6.5 Kernel Linux 2.6.32-431.11.2.el6.x86_64 GNOME 2.28.2 system. I am using this system to RPM the application and to deploy to other similar systems for installation.
I am very thankful if you could help me on this RPM business for my Qt applications.

mp33919
12th June 2015, 22:33
I finally made some progress for my applications written by Qt5.2.1. And, I have to deliver it using RPM, as I explained above.
This is I got, so far:
an application named: myApp
a libraries folder contains all the libraries myApp is using: myLib
a script file to set the LIB PATH to myLib

Then, I copied these three files into a CentOS machine which has only Q3.x has been installed very long time ago. And it runs. But I know it is not near to be a "RPM-package". What I mean is that I have another folder (myDoc) that contains program-specific configurations such as UDP/TCP IPs and Ports that the myApp needs.

Now, back to my original questions: How can I "RPM" these files and folders so that the target machine could un-pack the RPM package and install the myApp and myDoc in the directory I specified?

Thanks in advance.