Run the qt program into the rpm package

Source: Internet
Author: User
Run the qt program into the rpm package-general Linux technology-Linux programming and kernel information. The following is a detailed description. Using qt for development, the rpm package is always loaded directly to/usr/lib, instead of $ RPM_BUILD_ROOT/usr/lib, inspired by the competition and self-exploration, we finally found a solution.

1. Create a pro File
Call qmake-project to generate a. pro file with the same name as the directory. In the pro file, TEMPLATE = app is the default build type. If the project is a library, replace the app with lib. Another important variable is TARGET =, which is the name of the TARGET file. If lib and TARGET = mytarget are built, the final TARGET is libmytarget. so. (version ).

The installation steps are as follows: 1. The target files, 2. The target paths, that is, the installation path. I think there are two types: the first executable file or the generated library, which is the default build target; the second is the header file. You can set the target name by yourself, such as mytest in my pro file:

Target. path =/usr/lib
Mytest. files = $ HEADERS
Mytest. path =/usr/include
Install+ = target mytest

2. settings in the spec File
I am confused here. Later, inspired by the competition, DESTDIR needs to be preconfigured in Makefile to get inspiration, and finally found the default installation prefix in qt4, INSTALL_ROOT.

The preceding fields are all % setup qmake make or something. In % install, make install does not use DESTDIR, but INSTALL_ROOT to get the correct result. The spec file is as follows:

% Prep
% Setup-n % {name}

% Build
Qmake
Make

% Install
Make INSTALL_ROOT = $ RPM_BUILD_ROOT install

% Files
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.