# Setup a src dir in /usr/local
#
RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
#
# Get a modern version of cmake. We need 3.8.2 or later to build libkqueue rpms
# Grab libkqueue and build
#
WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
WORKDIR libkqueue
RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
make && \
- cpack -G RPM
-RUN yum localinstall -y *.rpm
+ cpack -G RPM && \
+ yum localinstall -y *.rpm
#
# Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
rpmbuild -bb hiredis-$v/redhat/hiredis.spec
RUN yum localinstall -y $HOME/rpmbuild/RPMS/*/hiredis-*.rpm
+WORKDIR /usr/local/src/repositories
+
#
# Shallow clone the FreeRADIUS source
#
-WORKDIR /usr/local/src/repositories
ARG source=https://github.com/FreeRADIUS/freeradius-server.git
RUN git clone --depth 1 ${source}
-
WORKDIR freeradius-server
-# Install build dependencies for all branches
+#
+# Install build dependencies for all branches
+#
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
do \
git checkout $i; \
[ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \
done
-# Create the build tree
+#
+# Create the RPM build tree
+#
ENV BUILDDIR=/root/rpmbuild
RUN rpmdev-setuptree
# Setup a src dir in /usr/local
#
RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
#
# Get a modern version of cmake. We need 3.8.2 or later to build libkqueue rpms
# Grab libkqueue and build
#
WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
WORKDIR libkqueue
RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
make && \
- cpack -G RPM
-RUN yum localinstall -y *.rpm
+ cpack -G RPM && \
+ yum localinstall -y *.rpm
#
# Use LTB's openldap packages intead of the distribution version to avoid linking against NSS
> /etc/yum.repos.d/ltb-project.repo
RUN rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project
+WORKDIR /usr/local/src/repositories
+
#
# Shallow clone the FreeRADIUS source
#
-WORKDIR /usr/local/src/repositories
ARG source=https://github.com/FreeRADIUS/freeradius-server.git
RUN git clone --depth 1 --no-single-branch ${source}
-
WORKDIR freeradius-server
-# Install build dependencies for all branches
+#
+# Install build dependencies for all branches
+#
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
do \
git checkout $i; \
[ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \
done
-# Create the build tree
+#
+# Create the RPM build tree
+#
ENV BUILDDIR=/root/rpmbuild
RUN rpmdev-setuptree
FROM debian:jessie
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=jessie
#
-# For GCC 4.9
+# Install add-apt-repository
#
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+ apt-get install -y software-properties-common && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
-#
-# For clang 5.0
-#
-RUN add-apt-repository "http://apt.llvm.org/jessie/ llvm-toolchain-jessie-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+# Requires GCC-4.9 as it has support for C11 keywords and atomics
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+# For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+ apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
+
+RUN apt-get update && \
+# Development utilities
+ apt-get install -y devscripts equivs git quilt && \
+# Compilers
+ apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+# eapol_test dependencies
+ apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+ --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+ update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+ update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+ update-alternatives --config lldb
-#
-# Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
#
# Setup a src dir in /usr/local
#
+RUN mkdir -p /usr/local/src/repositories
WORKDIR /usr/local/src/repositories
-RUN git clone --depth=1 --no-single-branch https://github.com/FreeRADIUS/freeradius-server.git
+
+#
+# Shallow clone the FreeRADIUS source
+#
+ARG source=https://github.com/FreeRADIUS/freeradius-server.git
+RUN git clone --depth 1 --no-single-branch ${source}
WORKDIR freeradius-server
-# Install build dependencies for all branches
+#
+# Install build dependencies for all branches
+#
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
do \
git checkout $i; \
- [ -e ./debian/control.in ] && debian/rules debian/control && echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control; \
+ if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
done
### For some reason this dep was not installed
# RUN apt-get install -y libiodbc2-dev
-
FROM debian:stretch
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=6
+ARG clangver=5.0
+ARG osname=stretch
#
-# Stretch uses GCC 4.9 by default, so we don't need to install any additional compilers to get C11 functionality
+# Install add-apt-repository
#
+RUN apt-get update && \
+ apt-get install -y software-properties-common && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
-#
-# For clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+# Stretch uses GCC-6.3 by default, so it doesn't need to be updated to get C11 functionality.
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+# For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+ apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
+
+RUN apt-get update && \
+# Development utilities
+ apt-get install -y devscripts equivs git quilt && \
+# Compilers
+ apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+# eapol_test dependencies
+ apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+ --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+ update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+ update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+ update-alternatives --config lldb
-#
-# Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
#
# Setup a src dir in /usr/local
#
RUN mkdir -p /usr/local/src/repositories
-WORKDIR /usr/local/src
+WORKDIR /usr/local/src/repositories
#
# Get a modern version of cmake. We need 3.8.2 or later to build libkqueue rpms
# Grab libkqueue and build
#
WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
WORKDIR libkqueue
RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
make && \
- cpack -P libkqueue-dev -G DEB
-RUN apt-get install -y ./*.deb
+ cpack -P libkqueue-dev -G DEB && \
+ dpkg -i --force-all ./libkqueue-*deb
+
+WORKDIR /usr/local/src/repositories
#
# Shallow clone the FreeRADIUS source
#
-WORKDIR /usr/local/src/repositories
ARG source=https://github.com/FreeRADIUS/freeradius-server.git
RUN git clone --depth 1 --no-single-branch ${source}
WORKDIR freeradius-server
RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^v[0-9]*\.[0-9x]*\.x$");\
do \
git checkout $i; \
- [ -e ./debian/control.in ] && debian/rules debian/control && echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control; \
+ if [ -e ./debian/control.in ] ; then debian/rules debian/control ; fi ; echo 'y' | mk-build-deps -irt'apt-get -yV' debian/control ; \
done
FROM ubuntu:14.04
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=trusty
#
-# For GCC 4.9
+# Install add-apt-repository
#
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+ apt-get install -y software-properties-common python-software-properties && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
-#
-# For Clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trust-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+# Requires GCC-4.9 as it has support for C11 keywords and atomics
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+# For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+ apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key && \
+# For GCC
+ add-apt-repository -y ppa:ubuntu-toolchain-r/test
+
+RUN apt-get update && \
+# Development utilities
+ apt-get install -y devscripts equivs git quilt && \
+# Compilers
+ apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+# eapol_test dependencies
+ apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+ --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+ update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+ update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+ update-alternatives --config lldb
-#
-# Install eapol_test dependencies
-#
-RUN apt-get install -y libnl-3-dev libnl-genl-3-dev
#
# Setup a src dir in /usr/local
# Grab libkqueue and build
#
WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
WORKDIR libkqueue
RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
make && \
- cpack -P libkqueue-dev -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
+ cpack -P libkqueue-dev -G DEB && \
+ dpkg -i --force-all ./libkqueue-*deb
+
WORKDIR /usr/local/src/repositories
#
FROM ubuntu:16.04
-RUN apt-get update && apt-get install -y devscripts equivs git quilt software-properties-common python-software-properties
+ARG gccver=4.9
+ARG clangver=5.0
+ARG osname=xenial
#
-# For GCC 4.9
+# Install add-apt-repository
#
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update
-RUN apt-get install -y g++-4.9
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 && update-alternatives --config gcc
+RUN apt-get update && \
+ apt-get install -y software-properties-common python-software-properties && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
-#
-# For clang 5.0
-#
-RUN add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
-RUN apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
-RUN apt-get update
-RUN apt-get install -y llvm-5.0 clang-5.0 lldb-5.0
+# Requires GCC-4.9 as it has support for C11 keywords and atomics
-RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 && update-alternatives --config clang
-RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-5.0 60 && update-alternatives --config lldb
+# For clang
+RUN add-apt-repository -y "deb http://apt.llvm.org/${osname}/ llvm-toolchain-${osname}-${clangver} main" && \
+ apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key && \
+# For GCC
+ add-apt-repository -y ppa:ubuntu-toolchain-r/test
+
+RUN apt-get update && \
+# Development utilities
+ apt-get install -y devscripts equivs git quilt && \
+# Compilers
+ apt-get install -y g++-${gccver} llvm-${clangver} clang-${clangver} lldb-${clangver} && \
+# eapol_test dependencies
+ apt-get install -y libnl-3-dev libnl-genl-3-dev
+
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${gccver} 50 \
+ --slave /usr/bin/g++ g++ /usr/bin/g++-${gccver} && \
+ update-alternatives --config gcc
+
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${clangver} 60 && \
+ update-alternatives --config clang
+
+RUN update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-${clangver} 60 && \
+ update-alternatives --config lldb
-#
-# Install eapol_test dependencies
-#
-RUN apt-get -y install libnl-3-dev libnl-genl-3-dev
#
# Setup a src dir in /usr/local
# Grab libkqueue and build
#
WORKDIR /usr/local/src/repositories
-# Fixme: Change to the main repo when they merge this branch
RUN git clone --branch master --depth=1 https://github.com/mheily/libkqueue.git
+
WORKDIR libkqueue
RUN cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib ./ && \
make && \
- cpack -P libkqueue-dev -G DEB
-RUN dpkg -i --force-all ./libkqueue-*deb
+ cpack -P libkqueue-dev -G DEB && \
+ dpkg -i --force-all ./libkqueue-*deb
+
WORKDIR /usr/local/src/repositories
#