How to Install HAProxy using PKGSRC

How To use PKGSRC: https://www.netbsd.org/docs/pkgsrc/creating.html

Install dependencies:
yum install epel-release -y
yum groupinstall "Development Tools" -y
yum install vim traceroute nmap bzip2 git wget make gcc perl pcre pcre-devel zlib-devel openssl-devel -y
Bootstrap Package Source (BSD implementation):
su - kimconnect
wget ftp://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.gz
mkdir /home/kimconnect/usr
tar -xzvf pkgsrc.tar.gz -C ~/usr
cd /home/kimconnect/usr/pkgsrc && ./bootstrap/bootstrap --unprivileged

Add licensing Acceptances:
sed -i '/\.endif/i ALLOW_VULNERABLE_PACKAGES= yes' /home/kimconnect/pkg/etc/mk.conf
sed -i '/\.endif/i ACCEPTABLE_LICENSES+= oracle-binary-code-license' /home/kimconnect/pkg/etc/mk.conf
sed -i '/\.endif/i ACCEPTABLE_LICENSES+= gnu-agpl-v3' /home/kimconnect/pkg/etc/mk.conf

/home/kimconnect/pkg/sbin/pkg_admin -K /home/kimconnect/pkg/pkgdb fetch-pkg-vulnerabilities
ls ~/usr/pkgsrc/
vim ~/.bash_profile

## Ensure that these lines are present ##
PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=$PATH:/home/kimconnect/pkg/sbin
PATH=$PATH:/home/kimconnect/pkg/bin
MANPATH=/home/kimconnect/usr/pkg/man:$MANPATH
export PATH
## -------------------------------- ##

## re-login to realize the change
exit
su - kimconnect

## Perform pkgsrc update prior to any application install
cd /home/kimconnect/usr/pkgsrc && cvs update -dP

## More dependencies
cd /home/kimconnect/usr/pkgsrc/devel/gettext-tools && bmake install clean clean-depends

cd /home/kimconnect/usr/pkgsrc/net/haproxy
mv PLIST.Linux PLIST.Linux.bak

cat << EOF > PLIST.Linux
man/man1/haproxy.1
sbin/haproxy
share/doc/haproxy/architecture.txt
share/doc/haproxy/configuration.txt
share/examples/haproxy/acl-content-sw.cfg
share/examples/haproxy/auth.cfg
share/examples/haproxy/content-sw-sample.cfg
share/examples/haproxy/option-http_proxy.cfg
share/examples/haproxy/ssl.cfg
share/examples/haproxy/transparent_proxy.cfg
share/examples/haproxy/wurfl-example.cfg
EOF

## Install HAProxy
cd /home/kimconnect/usr/pkgsrc/net/haproxy && bmake clean clean-depends && bmake install
bmake package && bmake deinstall && bmake install
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *