1#!/bin/bash
2
3BRANCH=${TRAVIS_BRANCH:-master}
4VERSION=${PACKAGE_VERSION:-1.3.6rc5}
5
6# Make sure that the necessary packages/tools are installed
7yum install -y \
8  gcc \
9  git \
10  imake \
11  make \
12  rpm-build
13
14# These are for the basic proftpd build
15yum install -y \
16  gettext \
17  libacl-devel \
18  libcap-devel \
19  ncurses-devel \
20  pam-devel \
21  pkgconfig \
22  zlib-devel
23
24# And these are for --with everything
25yum install -y \
26  geoip-devel \
27  libmemcached-devel \
28  mysql-devel \
29  openldap-devel \
30  openssl-devel \
31  pcre-devel \
32  postgresql-devel \
33  sqlite-devel \
34  tcp_wrappers-devel
35
36# Install the EPEL repo, for the Redis RPMs
37yum install -y wget
38wget -q -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e
39rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm
40yum install -y hiredis-devel
41
42rm -fr rpm/
43mkdir rpm/
44cd rpm/
45git clone -q -b "${BRANCH}" --depth 10 https://github.com/proftpd/proftpd.git "proftpd-${VERSION}"
46cd "proftpd-${VERSION}/"
47./configure
48make dist
49cd ..
50tar zcf "proftpd-${VERSION}.tar.gz" "proftpd-${VERSION}"
51rpmbuild -ta "proftpd-${VERSION}.tar.gz" --with everything
52