Building RPMS from main branch 3.x relase

2013-06-21 Thread Divyesh Raithatha
Hello,

Has anyone successfully built RPM's from the main branch 3.x?

I am trying to build one but keep on running into errors.  Similar to the
ones I saw with the version 2.x.x  branch (regarding version numbers,
patches, libray file names) until the changes were pushed by Fajar on May
9th.

 redhat: package all modules in freeradius RPM
?ed336742a6? Browse code ?fajarnugraha authored May 09, 2013

redhat: only keep the last changelog from original spec file
?5240ada0f2? Browse code ?fajarnugraha authored May 09, 2013

redhat: package everything in freeradius rpm
?bcae31b171? Browse code ?fajarnugraha authored May 09, 2013

redhat: removed obsolete patches
?bc38b7d591? Browse code ?fajarnugraha authored May 09, 2013

redhat: README was renamed to README.rst
?766fd283ca? Browse code ?fajarnugraha authored May 09, 2013

redhat: refresh freeradius-cert-config.patch
?69d798819b? Browse code ?fajarnugraha authored May 09, 2013

redhat: add "make" to BuildRequires list
?50d0bf530b? Browse code ?fajarnugraha authored May 09, 2013

redhat: bump version in specfile to 2.2.1
?561e929be6? Browse code ?fajarnugraha authored May 09, 2013

Thanks
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

MySQL Cluster as back-end for FreeRadius

2013-05-22 Thread Divyesh Raithatha
Newbie question.

Has someone successfully configured a high-availability MySQL cluster as a
back-end for FreeRadius?

Trying to find out what architecture was used to achieve the cluster or
high availabilty and how successful you have been in a Production
Environment.

1.  Master/Master Replication?
2.  Master/Slave Replication (for DR)?
3.  MySQL Cluster using NDB?

What other backend databases in a high avilable configureation have been
used/tested.

Thanks.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Need help with making RPM from v2.x.x branch

2013-05-10 Thread Divyesh Raithatha
It appears that the created RPM doesn't include the TLV update that were
made to the 2.x.x branch last week.  Why wouldn't this be inlcuded in the
RPM even though I am building the RPM with the current 2.x.x. source?

Thanks.

On Wed, May 8, 2013 at 5:42 PM, Divyesh Raithatha <
divyesh.raitha...@gmail.com> wrote:

> Thanks everyone.  Finally got the RPM build to work by doing the following:
>
> Version:  2.2.0" in the top of the freeradius.spec file to 2.2.1, and
> renaming source
> bz2 file to freeradius-server-2.2.1.tar.**bz2
>
> Along with commenting out patches 2 and 5
> #Patch2: freeradius-radtest.patch
> #Patch5: freeradius-radeapclient-ipv6.patch
>
>
> Changing the README line to README.rst
> # install doc files omitted by standard install
> for f in COPYRIGHT CREDITS INSTALL README.rst; do
> cp $f $RPM_BUILD_ROOT/%{docdir}
> diff freeradius.spec ~/freeradius-server-2.2.1/redhat/freeradius.spec
> 3c3
> < Version: 2.2.0
> ---
> > Version: 2.2.1
> 15c15
> < Patch2: freeradius-radtest.patch
> ---
> > #Patch2: freeradius-radtest.patch
> 18c18
> < Patch5: freeradius-radeapclient-ipv6.patch
> ---
> > #Patch5: freeradius-radeapclient-ipv6.patch
> 152c152
> < %patch2 -p1 -b .radtest
> ---
> > #%patch2 -p1 -b .radtest
> 155c155
> < %patch5 -p1 -b .radeapclient-ipv6
> ---
> > #%patch5 -p1 -b .radeapclient-ipv6
> 239c239
> < for f in COPYRIGHT CREDITS INSTALL README; do
> ---
> > for f in COPYRIGHT CREDITS INSTALL README.rst; do
> By commenting out patch 2 and patch 5 what am I missing, if anything?
>
> On Wed, May 8, 2013 at 8:20 AM, John Dennis  wrote:
>
>> On 05/08/2013 03:19 AM, Fajar A. Nugraha wrote:
>>
>>> On Wed, May 8, 2013 at 1:50 PM, Raithatha, Divyesh
>>>  wrote:
>>>
>>>> Thanks, I got past the README but now I am getting the following file
>>>> not found errors.  They do exist, however, it looks like the build is
>>>> looking for version 2.2.0 of the library files yet they are listed as 
>>>> 2.2.1.
>>>>
>>>>
>>>> error: File not found: /home/test/rpmbuild/BUILDROOT/**
>>>> freeradius-2.2.0-1.el6.x86_64/**etc/raddb/certs/README.rst
>>>>
>>>
>>> That's kinda tricky. Look at %files section in the spec file.
>>>
>>> The cleanest solution right now would probably be changing "Version:
>>> 2.2.0" in the top of the make file to 2.2.1, AND rename your source
>>> bz2 file to freeradius-server-2.2.1.tar.**bz2.
>>>
>>
>> The version macro in the spec file, the version embedded in tar file
>> name, and the contents of tar file all *MUST* match. You have to be precise
>> with what version you're building.
>>
>> I assumed that was obvious as opposed to being tricky ;-)
>>
>>
>>> Another way would be changing the files section, from (e.g.)
>>>
>>> %{_libdir}/freeradius/rlm_**acct_unique-%{version}.so
>>>
>>> to
>>>
>>> %{_libdir}/freeradius/rlm_**acct_unique-*.so
>>>
>>> ... or even try deleting all rlm_* lines and replace them with a
>>> one-liner
>>>
>>> %{_libdir}/freeradius/rlm_*.**so*
>>>
>>>
>>
>> --
>> John Dennis 
>>
>> Looking to carve out IT costs?
>> www.redhat.com/carveoutcosts/
>> -
>> List info/subscribe/unsubscribe? See http://www.freeradius.org/**
>> list/users.html <http://www.freeradius.org/list/users.html>
>>
>
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Need help with making RPM from v2.x.x branch

2013-05-08 Thread Divyesh Raithatha
Thanks everyone.  Finally got the RPM build to work by doing the following:

Version:  2.2.0" in the top of the freeradius.spec file to 2.2.1, and
renaming source
bz2 file to freeradius-server-2.2.1.tar.**bz2

Along with commenting out patches 2 and 5
#Patch2: freeradius-radtest.patch
#Patch5: freeradius-radeapclient-ipv6.patch


Changing the README line to README.rst
# install doc files omitted by standard install
for f in COPYRIGHT CREDITS INSTALL README.rst; do
cp $f $RPM_BUILD_ROOT/%{docdir}
diff freeradius.spec ~/freeradius-server-2.2.1/redhat/freeradius.spec
3c3
< Version: 2.2.0
---
> Version: 2.2.1
15c15
< Patch2: freeradius-radtest.patch
---
> #Patch2: freeradius-radtest.patch
18c18
< Patch5: freeradius-radeapclient-ipv6.patch
---
> #Patch5: freeradius-radeapclient-ipv6.patch
152c152
< %patch2 -p1 -b .radtest
---
> #%patch2 -p1 -b .radtest
155c155
< %patch5 -p1 -b .radeapclient-ipv6
---
> #%patch5 -p1 -b .radeapclient-ipv6
239c239
< for f in COPYRIGHT CREDITS INSTALL README; do
---
> for f in COPYRIGHT CREDITS INSTALL README.rst; do
By commenting out patch 2 and patch 5 what am I missing, if anything?

On Wed, May 8, 2013 at 8:20 AM, John Dennis  wrote:

> On 05/08/2013 03:19 AM, Fajar A. Nugraha wrote:
>
>> On Wed, May 8, 2013 at 1:50 PM, Raithatha, Divyesh
>>  wrote:
>>
>>> Thanks, I got past the README but now I am getting the following file
>>> not found errors.  They do exist, however, it looks like the build is
>>> looking for version 2.2.0 of the library files yet they are listed as 2.2.1.
>>>
>>>
>>> error: File not found: /home/test/rpmbuild/BUILDROOT/**
>>> freeradius-2.2.0-1.el6.x86_64/**etc/raddb/certs/README.rst
>>>
>>
>> That's kinda tricky. Look at %files section in the spec file.
>>
>> The cleanest solution right now would probably be changing "Version:
>> 2.2.0" in the top of the make file to 2.2.1, AND rename your source
>> bz2 file to freeradius-server-2.2.1.tar.**bz2.
>>
>
> The version macro in the spec file, the version embedded in tar file name,
> and the contents of tar file all *MUST* match. You have to be precise with
> what version you're building.
>
> I assumed that was obvious as opposed to being tricky ;-)
>
>
>> Another way would be changing the files section, from (e.g.)
>>
>> %{_libdir}/freeradius/rlm_**acct_unique-%{version}.so
>>
>> to
>>
>> %{_libdir}/freeradius/rlm_**acct_unique-*.so
>>
>> ... or even try deleting all rlm_* lines and replace them with a one-liner
>>
>> %{_libdir}/freeradius/rlm_*.**so*
>>
>>
>
> --
> John Dennis 
>
> Looking to carve out IT costs?
> www.redhat.com/carveoutcosts/
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/**
> list/users.html 
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Need help with making RPM from v2.x.x branch

2013-05-06 Thread Divyesh Raithatha
Thanks Alan, I had to comment out both Patch 2 and 5 sections

#%patch2 -p1 -b .radtest
#%patch5 -p1 -b .radeapclient-ipv6


to get past the patch error messages but I get another error below:



+ cp README
/home/divtest/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64//usr/share/doc/freeradius-2.2.0
cp: cannot stat `README': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.wG9x7h (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.wG9x7h (%install)

Here are the contents of the temp file:

  cat /var/tmp/rpm-tmp.wG9x7h
#!/bin/sh
  RPM_SOURCE_DIR="/home/test/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/home/test/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="freeradius"
  RPM_PACKAGE_VERSION="2.2.0"
  RPM_PACKAGE_RELEASE="1.el6"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:

RPM_BUILD_ROOT="/home/test/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH

  set -x
  umask 022
  cd "/home/test/rpmbuild/BUILD"
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
mkdir -p `dirname "$RPM_BUILD_ROOT"`
mkdir "$RPM_BUILD_ROOT"
cd 'freeradius-server-2.2.0'
LANG=C
export LANG
unset DISPLAY
mkdir -p $RPM_BUILD_ROOT//var/lib/radiusd
# fix for bad libtool bug - can not rebuild dependent libs and bins
#FIXME export LD_LIBRARY_PATH=$RPM_BUILD_ROOT//usr/lib64
make install R=$RPM_BUILD_ROOT
# modify default configuration
RADDB=$RPM_BUILD_ROOT/etc/raddb
perl -i -pe 's/^#user =.*$/user = radiusd/'   $RADDB/radiusd.conf
perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf
# logs
mkdir -p $RPM_BUILD_ROOT/var/log/radius/radacct
touch $RPM_BUILD_ROOT/var/log/radius/{radutmp,radius.log}
install -D -m 755 /home/test/rpmbuild/SOURCES/freeradius-radiusd-init
$RPM_BUILD_ROOT//etc/rc.d/init.d/radiusd
install -D -m 644 /home/test/rpmbuild/SOURCES/freeradius-logrotate
$RPM_BUILD_ROOT//etc/logrotate.d/radiusd
install -D -m 644 /home/test/rpmbuild/SOURCES/freeradius-pam-conf
$RPM_BUILD_ROOT//etc/pam.d/radiusd
mkdir -p
/home/test/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64/var/run/
install -d -m 0710
/home/test/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64/var/run/radiusd/
# remove unneeded stuff
rm -rf doc/00-OLD
rm -f $RPM_BUILD_ROOT/usr/sbin/rc.radiusd
rm -rf $RPM_BUILD_ROOT//usr/lib64/freeradius/*.a
rm -rf $RPM_BUILD_ROOT//usr/lib64/freeradius/*.la
rm -rf $RPM_BUILD_ROOT//etc/raddb/sql/mssql
rm -rf $RPM_BUILD_ROOT//etc/raddb/sql/oracle
rm -rf $RPM_BUILD_ROOT//usr/share/dialup_admin/sql/oracle
rm -rf $RPM_BUILD_ROOT//usr/share/dialup_admin/lib/sql/oracle
rm -rf $RPM_BUILD_ROOT//usr/share/dialup_admin/lib/sql/drivers/oracle
# remove header files, we don't ship a devel package and the
# headers have multilib conflicts
rm -rf $RPM_BUILD_ROOT//usr/include
# remove unsupported config files
rm -f $RPM_BUILD_ROOT//etc/raddb/experimental.conf
# install doc files omitted by standard install
for f in COPYRIGHT CREDITS INSTALL README; do
cp $f $RPM_BUILD_ROOT//usr/share/doc/freeradius-2.2.0
done
cp LICENSE $RPM_BUILD_ROOT//usr/share/doc/freeradius-2.2.0/LICENSE.gpl
cp src/lib/LICENSE
$RPM_BUILD_ROOT//usr/share/doc/freeradius-2.2.0/LICENSE.lgpl
cp src/LICENSE.openssl
$RPM_BUILD_ROOT//usr/share/doc/freeradius-2.2.0/LICENSE.openssl
# add Red Hat specific documentation
cat >> $RPM_BUILD_ROOT//usr/share/doc/freeradius-2.2.0/REDHAT << EOF
Red Hat, RHEL, Fedora, and CentOS specific information can be found on the
FreeRADIUS Wiki in the Red Hat FAQ.
http://wiki.freeradius.org/guide/Red_Hat_FAQ
Please reference that document.
EOF

# Make sure our user/group is present prior to any package or subpackage
installation

   /usr/lib/rpm/find-debuginfo.sh --strict-build-id
"/home/test/rpmbuild/BUILD/freeradius-server-2.2.0"
/usr/lib/rpm/check-buildroot

/usr/lib/rpm/redhat/brp-compress

/usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
/usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip
/usr/bin/objdump
/usr/lib/rpm/brp-python-bytecompile
/usr/lib/rpm/redhat/brp-python-hardlink
/usr/lib/rpm/redhat/brp-java-repack-jars

On Mon, May 6, 2013 at 1:09 PM, Alan DeKok wrote:


> Divyesh Raithatha wrote:
> > Hello all, has anyone had success in building an RPM from the v2.x.x
> > branch from http://git.freeradius.org?
> >
>   That

Need help with making RPM from v2.x.x branch

2013-05-06 Thread Divyesh Raithatha
Hello all, has anyone had success in building an RPM from the v2.x.x branch
from http://git.freeradius.org?

I am following the information from
http://wiki.freeradius.org/guide/Red-Hat-FAQ

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:


Hunk #1 FAILED at 121.
1 out of 1 hunk FAILED -- saving rejects to file src/main/radtest.in.rej
error: Bad exit status from /var/tmp/rpm-tmp.uETav5 (%prep)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.uETav5 (%prep)


Here is the radtest.in.rej file contents:

--- src/main/radtest.in 2011-09-30 10:12:07.0 -0400
+++ src/main/radtest.in 2012-01-05 15:51:56.877585514 -0500
@@ -121,7 +121,7 @@
echo "EAP-Code = Response"
echo "EAP-Type-Identity = \"$1\""
fi
-   if [ "$6" ]
+   if [ ! -z "$6" ] && [[ $6 =~ ^[0-9]+$ ]] && [ $6 -gt 0 ]
then
echo "Framed-Protocol = PPP"
fi





Here is the contents of /var/tmp/rpm-tmp.uETav5

#!/bin/sh

  RPM_SOURCE_DIR="/home/test/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/home/test/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="freeradius"
  RPM_PACKAGE_VERSION="2.2.0"
  RPM_PACKAGE_RELEASE="1.el6"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:

RPM_BUILD_ROOT="/home/test/rpmbuild/BUILDROOT/freeradius-2.2.0-1.el6.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH

  set -x
  umask 022
  cd "/home/test/rpmbuild/BUILD"
LANG=C
export LANG
unset DISPLAY

cd '/home/test/rpmbuild/BUILD'
rm -rf 'freeradius-server-2.2.0'
/usr/bin/bzip2 -dc
'/home/test/rpmbuild/SOURCES/freeradius-server-2.2.0.tar.bz2' | /bin/tar
-xf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
  exit $STATUS
fi
cd 'freeradius-server-2.2.0'
/bin/chmod -Rf a+rX,u+w,g-w,o-w .
echo "Patch #1 (freeradius-cert-config.patch):"
/bin/cat /home/test/rpmbuild/SOURCES/freeradius-cert-config.patch |
/usr/bin/patch  -p1 -b --suffix .cert-config --fuzz=0

echo "Patch #2 (freeradius-radtest.patch):"
/bin/cat /home/test/rpmbuild/SOURCES/freeradius-radtest.patch |
/usr/bin/patch  -p1 -b --suffix .radtest --fuzz=0

#%patch3 -p1 -b .man
#%patch4 -p1 -b .unix-passwd-expire
echo "Patch #5 (freeradius-radeapclient-ipv6.patch):"
/bin/cat /home/test/rpmbuild/SOURCES/freeradius-radeapclient-ipv6.patch |
/usr/bin/patch  -p1 -b --suffix .radeapclient-ipv6 --fuzz=0

#%patch6 -p1
#%patch7 -p1 -b perl
echo "Patch #8 (freeradius-dhcp_sqlippool.patch):"
/bin/cat /home/test/rpmbuild/SOURCES/freeradius-dhcp_sqlippool.patch |
/usr/bin/patch  -p1  --fuzz=0


# Some source files mistakenly have execute permissions set
find $RPM_BUILD_DIR/freeradius-server-2.2.0 \( -name '*.c' -o -name '*.h'
\) -a -perm /0111 -exec chmod a-x {} +

exit 0


Any Ideas?

Thank you.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html