Skip to content

Instantly share code, notes, and snippets.

@eru
Created October 13, 2015 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eru/922eb6ebabc937c5f596 to your computer and use it in GitHub Desktop.
Save eru/922eb6ebabc937c5f596 to your computer and use it in GitHub Desktop.
#!/bin/sh
#####
# This script for CentOS 6.x
# 2015.10.13 Kazuki Hashimoto <eru.tndl@gmail.com>
#
# ref: http://usafusa.com/postgresqlpostfixpostfix-admin/
# ref: http://qiita.com/4486/items/62cfc7ab46e6c5add425
#####
# Update packages
yum update -y
# Install requirement packages
yum install -y rpm-build tar gcc \
zlib-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel
# Get src.rpm repository file
# If your relese version isn't 6.7 plese change 6.7 to your CentOS release version
curl https://gist.githubusercontent.com/eru/1afce3c5640f4bc82762/raw/43cf589197285496dbb97957235f795748bb6e61/CentOS-Source.repo | sed -e 's/$full_releasever/6.7/g' > /etc/yum.repos.d/CentOS-Source.repo
# Get src.rpm file
yumdownloader --enablerepo=base-src,updates-src,extras-src --source postfix
# Install src.rpm file (postfix-2.6.6-6.el6.src.rpm at 2015.10.13)
rpm -ivh postfix-*.src.rpm
# Enable postgresql build option
sed -i -e 's/%{?!PGSQL: %define PGSQL 0}/%{?!PGSQL: %define PGSQL 1}/g' ~/rpmbuild/SPECS/postfix.spec
# Build rpm
rpmbuild -ba ~/rpmbuild/SPECS/postfix.spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment