CentOS 6.4 rpm package for Tengine

Source: Internet
Author: User

Recently, tengine has been involved in CentOS 6.4. Recently, I saw how to create an rpm package, so I had the idea of creating an rpm package.

1. Install the CentOS development environment integration package and tengine dependency package

Yum groupinstall "Development Tools"
Yum install pcre-devel
Yum install openssl-devel

2. Create a tengine rpm package and use test as a non-root user.

Su-test
Mkdir-p ~ /Rpmbuild/{BUILD, RPMS, SOURCES, SPECS, SRPMS}

3. Write. rpmmacros in the Home Directory (that is, the file used to create a custom path in the previous article)

#. Rpmmacros
% _ Topdir/home/test/rpmbuild
% _ Tmppath/home/test/rpmbuild/tmp
% Buildroot/home/test/rpmbuild/BUILDROOT
% _ Prefix/

4. Create the directory rpmbuild in the Home Directory

Rpmbuild/
── BUILD
── RPMS
── SOURCES
│ ── Tengine-1.5.0.tar.gz.
── SPECS
│ ── Tengine. spec
── SRPMS
── Tmp

5 tengine. spec content

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@oschin.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 create an rpm package on centos 6.0 if File not found:/root/rpmbuild/BUILDROOT /... In centos 6, rpmbuild topdir has changed. To be compatible with centos 5 spec files, you need to modify topdir.

Edit the/usr/lib/rpm/macros file:
% _ Topdir % {getenv: HOME}/rpmbuild
To:
% _ Topdir % {_ usrsrc }/

6. Start to produce rpm packages

# In the test home directory
Rpmbuild-ba./rpmbuild/SPECS/tengine. spec

If no error occurs, the rpm package is generated in the rpmbuild/RPMS directory. This is just a simple production process. If you need in-depth customization, you can customize the scripts executed before and after installation.

Note: The above configuration file passed the test on centos6.4

Create your own rpm package

Directory structure and configuration after rpm installation in Linux

Brief Introduction and demo of rpm and yum

RedHat Linux --- rpm command details

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.