From: Alexander Clouter Date: Thu, 3 Aug 2017 16:35:33 +0000 (+0100) Subject: winbind build X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79877febd7069c5c357f6f5aacf16736e1ec3e8a;p=thirdparty%2Ffreeradius-server.git winbind build --- diff --git a/redhat/freeradius.spec b/redhat/freeradius.spec index 8b2d3943fb0..dcfd7f4f74d 100644 --- a/redhat/freeradius.spec +++ b/redhat/freeradius.spec @@ -75,6 +75,8 @@ BuildRequires: libpcap-devel BuildRequires: libtalloc-devel BuildRequires: net-snmp-devel BuildRequires: net-snmp-utils +BuildRequires: libwbclient-devel +BuildRequires: samba-devel %if %{?_unitdir:1}%{!?_unitdir:0} BuildRequires: systemd-devel %endif @@ -97,6 +99,8 @@ Requires: readline Requires: libtalloc Requires: libkqueue Requires: net-snmp +Requires: libwbclient +Requires: samba-libs Requires: zlib Requires: pam @@ -417,6 +421,7 @@ export LDFLAGS="-Wl,--build-id" --without-rlm_sql_db2 \ --with-jsonc-lib-dir=%{_libdir} \ --with-jsonc-include-dir=/usr/include/json \ + --with-winbind-include-dir=/usr/include/samba-4.0 \ %if %{?_with_freeradius_openssl:1}%{!?_with_freeradius_openssl:0} --with-openssl-lib-dir=/opt/openssl/lib \ --with-openssl-include-dir=/opt/openssl/include \ diff --git a/scripts/docker/build-centos6/Dockerfile b/scripts/docker/build-centos6/Dockerfile index 8ebe9f5289c..23ada12a719 100644 --- a/scripts/docker/build-centos6/Dockerfile +++ b/scripts/docker/build-centos6/Dockerfile @@ -6,6 +6,7 @@ FROM centos:centos6 RUN yum groupinstall -y "Development Tools" RUN yum install -y rpmdevtools RUN yum install -y vim emacs nano +RUN yum install -y openssl RUN yum install -y yum-utils # @@ -29,27 +30,21 @@ WORKDIR /usr/local/src # # Get a modern version of cmake. We need 3.8.2 or later to build libkqueue rpms # -RUN yum install -y openssl - -RUN curl https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh > ./cmake.sh - -RUN [ "$(cat ./cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ] -RUN chmod +x ./cmake.sh -RUN ./cmake.sh --skip-license --prefix=/usr/local +RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh +RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ] +RUN sh cmake.sh --skip-license --prefix=/usr/local # # Grab libkqueue and build # WORKDIR /usr/local/src/repositories -RUN git clone --depth=1 https://github.com/arr2036/libkqueue.git -WORKDIR libkqueue - # Fixme: Change to the main repo when they merge this branch -RUN git checkout patch-3 +RUN git clone --branch patch-3 --depth=1 https://github.com/arr2036/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 +RUN yum localinstall -y *.rpm # # Use LTB's openldap packages intead of the distribution version to avoid linking against NSS @@ -63,7 +58,6 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\ > /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 RUN git clone --depth=1 https://github.com/mattrose/hiredis.git WORKDIR hiredis @@ -81,7 +75,8 @@ RUN yum localinstall -y $HOME/rpmbuild/RPMS/*/hiredis-*.rpm # Shallow clone the FreeRADIUS source # WORKDIR /usr/local/src/repositories -RUN git clone --depth=1 https://github.com/mattrose/freeradius-server.git +ARG source=https://github.com/FreeRADIUS/freeradius-server.git +RUN git clone --depth 1 --no-single-branch ${source} WORKDIR freeradius-server @@ -89,7 +84,7 @@ 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 ./redhat/freeradius.spec ] && yum-builddep -y ./redhat/freeradius.spec; \ + [ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \ done # Create the build tree @@ -98,7 +93,7 @@ RUN rpmdev-setuptree ### This is necessary for the jenkins server to talk to the docker instance RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo RUN adduser jenkins -RUN echo -e "jenkins1" | passwd --stdin jenkins +RUN printf jenkins1 | passwd --stdin jenkins RUN mkdir /var/run/sshd RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd diff --git a/scripts/docker/build-centos7/Dockerfile b/scripts/docker/build-centos7/Dockerfile index a240fe18c8d..7af22fe3db2 100644 --- a/scripts/docker/build-centos7/Dockerfile +++ b/scripts/docker/build-centos7/Dockerfile @@ -6,6 +6,7 @@ FROM centos:centos7 RUN yum groupinstall -y "Development Tools" RUN yum install -y rpmdevtools RUN yum install -y vim emacs nano +RUN yum install -y openssl # # Add the EPEL repository for freetds and hiredis @@ -28,27 +29,21 @@ WORKDIR /usr/local/src # # Get a modern version of cmake. We need 3.8.2 or later to build libkqueue rpms # -RUN yum install -y openssl - -RUN curl https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh > ./cmake.sh - -RUN [ "$(cat ./cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ] -RUN chmod +x ./cmake.sh -RUN ./cmake.sh --skip-license --prefix=/usr/local +RUN curl -f -o cmake.sh https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh +RUN [ "$(cat cmake.sh | openssl sha256 | sed 's/^.* //')" = "bb26b1871f9e5c2fb73476186cc94d03b674608f704b48b94d617340b87b4d73" ] +RUN sh cmake.sh --skip-license --prefix=/usr/local # # Grab libkqueue and build # WORKDIR /usr/local/src/repositories -RUN git clone --depth=1 --no-single-branch https://github.com/arr2036/libkqueue.git -WORKDIR libkqueue - # Fixme: Change to the main repo when they merge this branch -RUN git checkout patch-3 +RUN git clone --branch patch-3 --depth=1 https://github.com/arr2036/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 +RUN yum localinstall -y *.rpm # # Use LTB's openldap packages intead of the distribution version to avoid linking against NSS @@ -66,14 +61,16 @@ RUN rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project # Shallow clone the FreeRADIUS source # WORKDIR /usr/local/src/repositories -RUN git clone --depth 1 --no-single-branch https://github.com/FreeRADIUS/freeradius-server.git +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 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; \ + [ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \ done # Create the build tree @@ -82,7 +79,7 @@ RUN rpmdev-setuptree ### This is necessary for the jenkins server to talk to the docker instance RUN yum install -y openssh-server java-1.8.0-openjdk-headless createrepo RUN adduser jenkins -RUN echo -e "jenkins1" | passwd --stdin jenkins +RUN printf jenkins1 | passwd --stdin jenkins RUN mkdir /var/run/sshd RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd