Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for Centos to package tengine to make rpm installation package

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the steps of "Centos packaging tengine making rpm installation package". In daily operation, I believe many people have doubts about the steps of Centos packaging tengine making rpm installation package. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "Centos packaging tengine making rpm installation package". Next, please follow the editor to study!

1 install the development environment integration package for CentOS and the dependency package for tengine

The code is as follows:

Yum groupinstall "Development Tools"

Yum install pcre-devel

Yum install openssl openssl-devel

2 create tengine rpm package with test for non-root users

The code is as follows:

Su-test

Mkdir-p ~ / rpmbuild/ {BUILD,RPMS,SOURCES,SPECS,SRPMS}

(3) write .rpmmacros in the home directory (that is, the file of the custom production path mentioned in the previous article)

The code is as follows:

# .rpmmacros

% _ topdir / home/test/rpmbuild

% _ tmppath / home/test/rpmbuild/tmp

% buildroot / home/test/rpmbuild/BUILDROOT

% _ prefix /

4 create a production directory rpmbuild in the home directory

The code is as follows:

Rpmbuild/

├── BUILD

├── RPMS

├── SOURCES

│ └── tengine-1.5.0.tar.gz

├── SPECS

│ └── tengine.spec

├── SRPMS

└── tmp

5 tengine.spec content

The code is as follows:

Name: tengine

Version: 1.5.0

Release: 1

Vendor: Taobao

Summary: GUN Tengine X86_64

License: GPL

Source: tengine-1.5.0.tar.gz

Group: System Enviroment/Daemons

URL: http://tengine.taobao.org/

Packager: guol@oschina.com

% description

Taobao tengine package

% prep

% setup-Q

. / configure-- prefix=/etc/Nginx/

Make

% install

Make DESTDIR=$RPM_BUILD_ROOT install

% clean

["$RPM_BUILD_ROOT"! = "/"] & & rm-rf "$RPM_BUILD_ROOT"

Make clean

% files

% defattr (-, root,root)

/ etc/nginx/

Note: use rpmbuild to make rpm package on centos 6.0.If file not found: / root/rpmbuild/BUILDROOT/ appears. The error is that the rpmbuild topdir in centos 6 has changed. In order to be compatible with the spec file of centos 5, topdir needs to be modified.

The code is as follows:

Edit the / usr/lib/rpm/macros file:

% _ topdir% {getenv:HOME} / rpmbuild

Modified to:

% _ topdir% {_ usrsrc} /

6 start production of rpm package

The code is as follows:

# in the test home directory

Rpmbuild-ba. / rpmbuild/SPECS/tengine.spec

If there are no errors, the relevant rpm package is generated in the rpmbuild/RPMS directory. This is a simple production process, and if you want to do deep customization, you can customize the scripts executed before and after installation.

At this point, on the "Centos packaging tengine to make rpm installation package steps" on the end of the study, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report