<div>Hello all, has anyone had success in building an RPM from the v2.x.x branch from <a href="http://git.freeradius.org">http://git.freeradius.org</a>?</div>
<div> </div>
<div>I am following the information from <a href="http://wiki.freeradius.org/guide/Red-Hat-FAQ">http://wiki.freeradius.org/guide/Red-Hat-FAQ</a></div>
<div> </div>
<div>On a CentOS 6.4 x64 system I was able to build an RPM from 2.2.0 source successfully but I want to get all of the recent patches from the v2.x.x branch.  However, when I tried to build the RPM from v2.x.x I get the following message:</div>


<div> </div>
<blockquote style="MARGIN-RIGHT:0px" dir="ltr">
<div><font face="courier new,monospace">Hunk #1 FAILED at 121.</font></div>
<div><font face="courier new,monospace">1 out of 1 hunk FAILED -- saving rejects to file src/main/radtest.in.rej</font></div>
<div><font face="courier new,monospace">error: Bad exit status from /var/tmp/rpm-tmp.uETav5 (%prep)</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">RPM build errors:</font></div>
<div><font face="courier new,monospace">    Bad exit status from /var/tmp/rpm-tmp.uETav5 (%prep)</font></div></blockquote>
<div> </div>
<div>Here is the radtest.in.rej file contents:</div>
<blockquote style="MARGIN-RIGHT:0px" dir="ltr">
<div><font face="courier new,monospace">--- src/main/<a href="http://radtest.in">radtest.in</a> 2011-09-30 10:12:07.000000000 -0400</font></div>
<div><font face="courier new,monospace">+++ src/main/<a href="http://radtest.in">radtest.in</a> 2012-01-05 15:51:56.877585514 -0500</font></div>
<div><font face="courier new,monospace">@@ -121,7 +121,7 @@</font></div>
<div><font face="courier new,monospace">            echo "EAP-Code = Response"</font></div>
<div><font face="courier new,monospace">            echo "EAP-Type-Identity = \"$1\""</font></div>
<div><font face="courier new,monospace">        fi</font></div>
<div><font face="courier new,monospace">-       if [ "$6" ]</font></div>
<div><font face="courier new,monospace">+       if [ ! -z "$6" ] && [[ $6 =~ ^[0-9]+$ ]] && [ $6 -gt 0 ]</font></div>
<div><font face="courier new,monospace">        then</font></div>
<div><font face="courier new,monospace">                echo "Framed-Protocol = PPP"</font></div>
<div><font face="courier new,monospace">        fi</font></div></blockquote>
<div><font face="courier new,monospace"> </font></div>
<div> </div>
<div> </div>
<div> </div>
<div>Here is the contents of /var/tmp/rpm-tmp.uETav5 </div>
<blockquote style="MARGIN-RIGHT:0px" dir="ltr">
<div><font face="courier new,monospace">#!/bin/sh</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">  RPM_SOURCE_DIR="/home/test/rpmbuild/SOURCES"</font></div>
<div><font face="courier new,monospace">  RPM_BUILD_DIR="/home/test/rpmbuild/BUILD"</font></div>
<div><font face="courier new,monospace">  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"</font></div>
<div><font face="courier new,monospace">  RPM_ARCH="x86_64"</font></div>
<div><font face="courier new,monospace">  RPM_OS="linux"</font></div>
<div><font face="courier new,monospace">  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS</font></div>
<div><font face="courier new,monospace">  RPM_DOC_DIR="/usr/share/doc"</font></div>
<div><font face="courier new,monospace">  export RPM_DOC_DIR</font></div>
<div><font face="courier new,monospace">  RPM_PACKAGE_NAME="freeradius"</font></div>
<div><font face="courier new,monospace">  RPM_PACKAGE_VERSION="2.2.0"</font></div>
<div><font face="courier new,monospace">  RPM_PACKAGE_RELEASE="1.el6"</font></div>
<div><font face="courier new,monospace">  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE</font></div>
<div><font face="courier new,monospace">  LANG=C</font></div>
<div><font face="courier new,monospace">  export LANG</font></div>
<div><font face="courier new,monospace">  unset CDPATH DISPLAY ||:</font></div>
<div><font face="courier new,monospace">  RPM_BUILD_ROOT="/home/test/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64"</font></div>
<div><font face="courier new,monospace">  export RPM_BUILD_ROOT</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">  PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"</font></div>
<div><font face="courier new,monospace">  export PKG_CONFIG_PATH</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">  set -x</font></div>
<div><font face="courier new,monospace">  umask 022</font></div>
<div><font face="courier new,monospace">  cd "/home/test/rpmbuild/BUILD"</font></div>
<div><font face="courier new,monospace">LANG=C</font></div>
<div><font face="courier new,monospace">export LANG</font></div>
<div><font face="courier new,monospace">unset DISPLAY</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">cd '/home/test/rpmbuild/BUILD'</font></div>
<div><font face="courier new,monospace">rm -rf 'freeradius-server-2.2.0'</font></div>
<div><font face="courier new,monospace">/usr/bin/bzip2 -dc '/home/test/rpmbuild/SOURCES/freeradius-server-2.2.0.tar.bz2' | /bin/tar -xf -</font></div>
<div><font face="courier new,monospace">STATUS=$?</font></div>
<div><font face="courier new,monospace">if [ $STATUS -ne 0 ]; then</font></div>
<div><font face="courier new,monospace">  exit $STATUS</font></div>
<div><font face="courier new,monospace">fi</font></div>
<div><font face="courier new,monospace">cd 'freeradius-server-2.2.0'</font></div>
<div><font face="courier new,monospace">/bin/chmod -Rf a+rX,u+w,g-w,o-w .</font></div>
<div><font face="courier new,monospace">echo "Patch #1 (freeradius-cert-config.patch):"</font></div>
<div><font face="courier new,monospace">/bin/cat /home/test/rpmbuild/SOURCES/freeradius-cert-config.patch | /usr/bin/patch  -p1 -b --suffix .cert-config --fuzz=0</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">echo "Patch #2 (freeradius-radtest.patch):"</font></div>
<div><font face="courier new,monospace">/bin/cat /home/test/rpmbuild/SOURCES/freeradius-radtest.patch | /usr/bin/patch  -p1 -b --suffix .radtest --fuzz=0</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">#%patch3 -p1 -b .man</font></div>
<div><font face="courier new,monospace">#%patch4 -p1 -b .unix-passwd-expire</font></div>
<div><font face="courier new,monospace">echo "Patch #5 (freeradius-radeapclient-ipv6.patch):"</font></div>
<div><font face="courier new,monospace">/bin/cat /home/test/rpmbuild/SOURCES/freeradius-radeapclient-ipv6.patch | /usr/bin/patch  -p1 -b --suffix .radeapclient-ipv6 --fuzz=0</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">#%patch6 -p1</font></div>
<div><font face="courier new,monospace">#%patch7 -p1 -b perl</font></div>
<div><font face="courier new,monospace">echo "Patch #8 (freeradius-dhcp_sqlippool.patch):"</font></div>
<div><font face="courier new,monospace">/bin/cat /home/test/rpmbuild/SOURCES/freeradius-dhcp_sqlippool.patch | /usr/bin/patch  -p1  --fuzz=0</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace"># Some source files mistakenly have execute permissions set</font></div>
<div><font face="courier new,monospace">find $RPM_BUILD_DIR/freeradius-server-2.2.0 \( -name '*.c' -o -name '*.h' \) -a -perm /0111 -exec chmod a-x {} +</font></div>
<div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace">exit 0</font></div></blockquote>
<div> </div>
<div>Any Ideas?</div>
<div> </div>
<div>Thank you.</div>