This article solves the source code installation needs to check the system on whether the application depends on the software package to worry about the source code developers also have some help. Can be modified on the basis of the appropriate to meet their own requirements.
The REDHAT5 or CentOS5 has provided a directory for RPM packages that can be placed directly into the system-specific directory of the applications that need to make the RPM package, without having to create a directory of RPM packages yourself, like on REDHAT6 (7) or CentOS6 (7).
1 Adding a normal user
Useradd Redhat
passwd Redhat
Redhat
Redhat
2 Switch to normal user Redhat
Su–redhat
3 Create rpmbuild directory in Redhat's home directory
MKDIR–PV Rpmbuild/{build,rpms,sources,specs,srpms}
4 Cloning The Pgrpms Project (http://git.postgresql.org/gitweb/?p=pgrpms.git) to a local
Cd/opt
mkdir pgrpm
git clone git://git.postgresql.org/git/pgrpms.git
/opt/pgrpm/pgrpms
5 copy files from the PGRPMS project to the local system version in the directory to the created source directory
cp/opt/pgrpm/pgrpms/rpm/redhat/9.4/postgresql/el-6/*/home/redhat/rpmbuild/source
Cd/home/redhat/rpmbuild/source
CP Postgresql-9.4.spec. /spec
6 Download PG9.4.5 source package with PG9.4.5 official documents to/opt/soft_bak
POSTGRESQL-9.4.5.TAR.BZ2 postgresql-9.4-a4.pdf
7 Copy the PG9.4.5 source package and the PG9.4.5 document to/home/redhat/rpmbuild/source
Directory under
8 Installing the PostgreSQL dependency pack
Glibc-devel Bison Flex perl-extutils-embed per (extutils::makemaker) Python-devel tcl-devel readline-devel Openssl-devel krb5-devel e2fsprogs-devel libxml2-devel libxslt-devel pam-devel libuuid-devel openldap-devel openjade OPENSP Docbook-dtds
Docbook-style-dsssl
9 start playing PG9.4.5 binary RPM package
(Yum install–y rpm-build)
Cd/home/redhat/rpmbuild/spec
RPMBUILD–BB Postgresql-9.4.spec
10 View the RPM package.
The RPM package is stored in the RPMs directory.
How to make a non-dependent PostgreSQL database RPM package on REDHAT6 (7) or CentOS6 (7)