Management of Linux software package--source management

Source: Internet
Author: User
Tags builtin


Any management tool has its own most suitable scenario, like the management of the package, in the CentOS series, with the RPM Package Manager, but it automatically does not solve the package manager, so there is a Yum manager, but he does not meet our actual requirements (custom function), so there is source management. Perhaps, sometimes the source code does not meet our requirements, I may have to do two based on the source of development. Here, we explain the source management.


First, the source installation steps

The source code compiles the premise, must have like gcc,make and so on compiles the tool. These compilation tools are generally available in the development tools.

The source code installation procedure actually does not have the specific step, because the different source code producer's production way difference causes us to use the installation procedure and the choice to have the difference. But in general, the producer will follow some specific rules. So, under normal circumstances, the source code compilation is the following steps.

To install the Ngnix service, for example:

# Compressed files for the Tar XF package

[Email protected] ~]# Tar XF nginx-1.4.7.tar.gz

# Software catalog after CD decompression

[Email protected] ~]# CD Nginx-1.4.7[[email protected] nginx-1.4.7]# pwd/root/nginx-1.4.7

#./configure also need to specify compilation attributes with many options

[[Email protected] nginx-1.4.7]# ./configure --prefix=/usr/local/nginxchecking for  OS + Linux 2.6.32-358.el6.x86_64 x86_64checking for C compiler  ... found + using gnu c compiler + gcc version: 4.4.7  20120313  (red hat 4.4.7-4)   (GCC)  checking for gcc -pipe switch  ... foundchecking for gcc builtin atomic operations ... found### ###### #中间省去好多checking ########################### #checking  for zlib library ...  foundcreating objs/makefileconfiguration summary  + using system pcre  Library  + openssl library is not used  + using builtin  md5 code  + sha1 library is not found  + using  system zlib library    #  If the configuration is correct, the path to the file is displayed   nginx path prefix: /usr/ Local/nginx "  nginx binary file: "/usr/local/nginx/sbin/nginx "  nginx  configuration prefix:  "/usr/local/nginx/conf"   nginx configuration file:  "/ Usr/local/nginx/conf/nginx.conf "  nginx pid file: "/usr/local/nginx/logs/nginx.pid "   nginx error log file:  "/usr/local/nginx/logs/error.log"   nginx  http access log file:  "/usr/local/nginx/logs/access.log"   nginx http  client request body temporary files:  "Client_body_temp"   nginx http  proxy temporary files:  "Proxy_temp"   nginx http fastcgi  temporary files:  "Fastcgi_temp"   nginx http uwsgi temporary files:   "Uwsgi_temp"   nginx http scgi temporary files:  "Scgi_temp" 

A makefile file is generated in the current directory with the following contents:

# It defines the statements executed by different actions, each of which may have different forms Default:buildclean:rm-rf Makefile objsbuild:$ (make)-F objs/makefile$ (make)-F OBJS /makefile manpageinstall:$ (make)-F objs/makefile installupgrade:/usr/local/nginx/sbin/nginx-tkill-usr2 ' cat/usr/ Local/nginx/logs/nginx.pid ' sleep 1test-f/usr/local/nginx/logs/nginx.pid.oldbinkill-quit ' cat/usr/local/nginx/ Logs/nginx.pid.oldbin '

# make

# to perform compilation operations, with Linux C programming experience, this step is to use GCC to generate linked files

# make Install

# This step is a true installation operation, which is actually copying (or creating) the corresponding file to the specified path.

Perform these 2 steps, even if the installation is complete.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/3F/8B/wKiom1PKok2SEn60AADpUZw1XHU675.jpg "title=" 121221.jpg "alt=" Wkiom1pkok2sen60aadpuzw1xhu675.jpg "/>


Use of the./configure script:

1. Get Help

./configure--help

2, some of the more common options

Installation path Related:

--prefix=/path/to/somewhere: Specifying the installation path

--sysconfdir=/path/to/somewhere: Specify the configuration file installation path

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/3F/8B/wKioL1PKn1DDyOuSAAIMBUBB9m0481.jpg "title=" ww.jpg "alt=" Wkiol1pkn1ddyousaaimbubb9m0481.jpg "/>

Specify enabled/disabled attributes

--enable-feature: for example--ENABLE-FPM

--disable-feature: for example--disable-socket

Specify the features, programs, or files that you depend on

--with-function[=/path/to/somewhere]

--without-function

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/3F/8B/wKiom1PKnsPAj3XpAAO3sUSFc0s960.jpg "title=" Qqq.jpg "alt=" Wkiom1pknspaj3xpaao3susfc0s960.jpg "/>


Second, after the installation of the configuration

1, if only the operation of the program, do not do for other software development of the dependent environment

1) We can use the relevant functions of the software globally

Of course there are many ways to do this, such as linking the commands to a path in the path variable as a linked file, or copying the commands to a path in the path variable, or modifying the values of the environment variables to add the path to the command.

Here's how I'm demonstrating:

Under/etc/profile.d/, build a script with the same name as the software, for example: nginx.sh. Add the following line of content

Export path= $PATH:/path/to/somewhere # For example: Export path= $PATH:/usr/local/nginx/sbin/# After completing this step, log in again to work

2) Export manual page:

Edit the/etc/man.config configuration file, add a manpath, and the path is the man directory for the newly installed program;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/3F/8B/wKiom1PKpUDAY04LAAE7FpEU0O4012.jpg "title=" 11111. JPG "alt=" wkiom1pkpuday04laae7fpeu0o4012.jpg "/>

Of course, we can also specify the Help document path view through Man-m.

3) If we want to use like other RPM package software startup mode, at this time we have to write the relevant format of the script in the/ETC/INIT.D directory for unified Management.


2, if as a program development: that other applications rely on the program's development environment, or for the program to do two development

1) Export the library file

Step one: Specify a path for the system to search for customizations

Edit/etc/ld.so.conf.d/appname.conf

# For example, build a nginx.conf in the/etc/ld.so.conf.d/directory (just for example, Ngnix does not necessarily have a library file) # A single library file path/usr/local/ngnix/lib

The second step: Trigger the system to re-search all the library files and generate the cache, because the system has been started by/etc/ld.so.cache this file cache library files

# Ldconfig

-V Display procedure

2) Export Header file

How to export: Create a link to

# Suppose: Ngnix's header file is/usr/local/nginx/includeln-sv/usr/local/nginx/include/usr/include/nginx


Summary: This article mainly introduces the source code how to install the software package.

This article is from the "Upstream Cold" blog, please be sure to keep this source http://guoting.blog.51cto.com/8886857/1440409

Management of Linux software package--source management

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.