Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 9046b129ecd05b84eeedae9092859b73 > files > 12

freeradius-1.0.2-1mdk.src.rpm

%define name	freeradius
%define version 1.0.2

#%define __libtoolize /bin/true
%define major   1
%define libname %mklibname %{name} %{major}

Summary:		High-performance and highly configurable RADIUS server
Name:			%{name}
Version:		%{version}
Release:		%mkrel 1
License:		GPL
Group:			System/Servers
URL:			http://www.freeradius.org/
Source0:		ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
Source1:		ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz.sig
Source2:		%{name}.pam.bz2
Source3:		%{name}.init.bz2
Source4:		%{name}.logrotate.bz2
Patch0:			%{name}-0.9.2-config.patch.bz2
Patch3:			%{name}-0.8.1-sasl2.patch.bz2
Patch4:			%{name}-0.8.1-use-system-com_err.patch.bz2
Patch5:			%{name}-0.9.0-libdir.patch.bz2
Patch6:			freeradius-0.9.3-avoid-version.diff.bz2
Patch7:			freeradius-1.0.0-gcc34-fixes.patch.bz2
PreReq:			rpm-helper
BuildRequires:		krb5-devel
BuildRequires:		gdbm-devel
BuildRequires:		libtool-devel
BuildRequires:		MySQL-devel
BuildRequires:		net-snmp-devel
BuildRequires:		openssl-devel
BuildRequires:		postgresql-libs-devel
BuildRequires:		libsasl-devel
BuildRequires:		openldap-devel
BuildRequires:		libtool
BuildRequires:		unixODBC-devel
BuildRequires:		net-snmp
BuildRequires:		pam-devel
BuildRequires:		postgresql-devel
BuildRequires:		zlib-devel
#Requires:		libgdbm2
#Requires:		libltdl3
#Requires:		libnet-snmp50
#Requires:		libopenssl0.9.7
Requires:		net-snmp
Requires:		net-snmp-mibs
Requires:		net-snmp-utils
Requires:		perl
Requires:		perl-base
%if %mdkversion >= 1020
BuildRequires:		multiarch-utils >= 1.0.3
%endif
Conflicts:		radiusd-cistron
BuildRoot:		%{_tmppath}/%{name}-%{version}-root

%description
The FreeRADIUS Server Project is a high-performance and highly
configurable GPL'd RADIUS server. It is somewhat similar to the
Livingston 2.0 RADIUS server, but has many more features, and is
much more configurable.


%package		-n %libname-krb5
Summary:		The Kerberos module for %{name}
Group:			System/Servers
Requires:		krb5-libs
Requires:		%{name} = %{version}
Obsoletes:		freeradius-krb5
Provides:		freeradius-krb5

%description		-n %libname-krb5
The FreeRADIUS server can use Kerberos to authenticate users, and
this module is necessary for that.


%package		-n %libname-ldap
Summary:		The LDAP module for %{name}
Group:			System/Servers
#Requires:		libldap2
#Requires:		libsasl2
Requires:		%{name} = %{version}
Obsoletes:		freeradius-ldap
Provides:		freeradius-ldap

%description		-n %libname-ldap
The FreeRADIUS server can use LDAP to authenticate users, and this
module is necessary for that.


%package		-n %libname-postgresql
Summary:		The PostgreSQL module for %{name}
Group:			System/Servers
#Requires:		libpq3
Requires:		%{name} = %{version}
Obsoletes:		freeradius-postgresql
Provides:		freeradius-postgresql

%description		-n %libname-postgresql
The FreeRADIUS server can use PostgreSQL to authenticate users and
do accounting, and this module is necessary for that.


%package		-n %libname-mysql
Summary:		The MySQL module for %{name}
Group:			System/Servers
#Requires:		libmysql12
Requires:		%{name} = %{version}
Obsoletes:		freeradius-mysql
Provides:		freeradius-mysql

%description		-n %libname-mysql
The FreeRADIUS server can use MySQL to authenticate users and do
accounting, and this module is necessary for that.


%package		-n %libname-unixODBC
Summary:		The unixODBC module for %{name}
Group:			System/Servers
#Requires:		libunixODBC2
Requires:		%{name} = %{version}
Obsoletes:		freeradius-unixODBC
Provides:		freeradius-unixODBC

%description		-n %libname-unixODBC
The FreeRADIUS server can use unixODBC to authenticate users and
do accounting, and this module is necessary for that.


%package		-n %libname
Summary:		Libraries for %{name}
Group:			System/Servers
Requires:		%{name} = %{version}

%description		-n %libname
Development headers and libraries for %{name}


%package		-n %libname-devel
Summary:		Development headers for %{name}
Group:			System/Servers
Requires:		%{name} = %{version}
Obsoletes:		freeradius-devel
Provides:		freeradius-devel

%description		-n %libname-devel
Development headers and libraries for %{name}


%prep

%setup -q -n %{name}-%{version}
%patch0 -p0
%patch3 -p0
%patch4 -p1 -b .peroyvind
%patch5 -p1
%patch6 -p1
%patch7 -p1

# For pre release only:
perl -pi -e 's,\$\(RADIUSD_VERSION\),%{version},' doc/Makefile
perl -pi -e 's,\$\(RADIUSD_VERSION\),%{version},' doc/rfc/Makefile

%__install -d mandrake
bzcat %{SOURCE2} > mandrake/%{name}.pam
bzcat %{SOURCE3} > mandrake/%{name}.init
bzcat %{SOURCE4} > mandrake/%{name}.logrotate

%build
#export WANT_AUTOCONF_2_5=1
#libtoolize --copy --force; aclocal; autoconf
#    --with-system-libtool \

%serverbuild
%configure2_5x \
    --with-gnu-ld \
    --with-threads \
    --with-thread-pool \
    --libdir=%{_libdir}/%{name} \
    --libexecdir=%{_libdir}/%{name} \
    --localstatedir=%{_var} \
    --with-logdir=%{_var}/log/radius \
    --disable-ltdl-install \
    --with-ltdl-lib=%{_libdir} \
    --with-ltdl-include=%{_includedir} \
    --with-radacctdir=%{_var}/log/radius/radacct \
    --with-raddbdir=%{_sysconfdir}/raddb \
    --with-snmp \
    --with-static-modules="" \
    --with-experimental-modules
    
make
#%make LIBTOOL=%{_bindir}/libtool

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%__install -d %{buildroot}%{_sysconfdir}/logrotate.d
%__install -d %{buildroot}%{_sysconfdir}/pam.d
%__install -d %{buildroot}%{_initrddir}
%__install -d %{buildroot}/var/run/radiusd
%__install -d %{buildroot}%{_includedir}/%{name}

make install R=%{buildroot}

# install headers
%__install -m0644 src/include/*  %{buildroot}%{_includedir}/%{name}/

# install mandrake scripts and stuff...
%__install -m0644 mandrake/%{name}.pam %{buildroot}%{_sysconfdir}/pam.d/radiusd
%__install -m0644 mandrake/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/radiusd
%__install -m0755 mandrake/%{name}.init %{buildroot}%{_initrddir}/radiusd

# put the mibs in place
%__install -d %{buildroot}%{_datadir}/snmp/mibs
%__install -m0644 mibs/GNOME* mibs/RADIUS* %{buildroot}%{_datadir}/snmp/mibs/

# fix ghostfiles
touch %{buildroot}/var/log/radius/radutmp
touch %{buildroot}/var/log/radius/radwtmp
touch %{buildroot}/var/log/radius/radius.log

# remove unneeded stuff
%__rm -f %{buildroot}%{_sbindir}/rc.radiusd
%__rm -f %{buildroot}%{_sysconfdir}/raddb/mssql.conf
%__rm -f %{buildroot}%{_sysconfdir}/raddb/oraclesql.conf

# remove faulty perl file...
%__rm -f %{buildroot}%{_libdir}/%{name}/rlm_perl.a

# this annoying file gets installed on ML9.0, remove it...
%__rm -f %{buildroot}%{_sysconfdir}/raddb/Makefile

# include more docs
%__cp src/modules/rlm_sql/README README.sql
%__cp src/modules/rlm_cram/Readme Readme.cram
%__cp src/modules/rlm_cram/Standard.draft .
%__cp src/modules/rlm_cram/dictionary.sandy .
%__cp src/modules/rlm_smb/README README.smb

# put specific docs and files where they belong (prepare for doc inclusion)
%__cp src/modules/rlm_sql/drivers/rlm_sql_postgresql/db_postgresql.sql .
%__cp src/modules/rlm_sql/drivers/rlm_sql_mysql/db_mysql.sql .
%__cp doc/rlm_krb5 .
%__cp doc/RADIUS-LDAP.schema .
%__cp doc/RADIUS-LDAPv3.schema .
%__cp doc/rlm_ldap .

# fix the naming of the sql.conf file
%__mv %{buildroot}%{_sysconfdir}/raddb/sql.conf %{buildroot}%{_sysconfdir}/raddb/mysql.conf

# nuke useless dupes
rm -f %{buildroot}%{_libdir}/%{name}/*%{version}*.la

%if %mdkversion >= 1020
%multiarch_includes %{buildroot}%{_includedir}/freeradius/build-radpaths-h
%multiarch_includes %{buildroot}%{_includedir}/freeradius/radpaths.h
%endif

%pre
%_pre_useradd radius /var/log/radius/radacct /bin/false

%post
%_post_service radiusd
%create_ghostfile /var/log/radius/radutmp radius radius 0644
%create_ghostfile /var/log/radius/radwtmp radius radius 0644
%create_ghostfile /var/log/radius/radius.log radius radius 0644

%preun
%_preun_service radiusd

%postun
%_postun_userdel radius

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc doc COPYRIGHT CREDITS INSTALL LICENSE README
%doc README.sql README.smb Readme.cram Standard.draft dictionary.sandy

%attr(0755,radius,radius) %dir %{_sysconfdir}/raddb
%attr(0755,radius,radius) %dir %{_sysconfdir}/raddb/certs

%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/pam.d/radiusd
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/radiusd
%attr(0755,root,root) %{_initrddir}/radiusd

%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/acct_users
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/attrs
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/dictionary*
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/experimental.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/example.pl
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/hints
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/huntgroups
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/naslist
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/persistent.pl
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/radiusd.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/realms
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/x99.conf
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/clients
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/clients.conf
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/naspasswd
%config(noreplace) %attr(0640,root,radius) %{_sysconfdir}/raddb/preproxy_users
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/proxy.conf
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/snmp.conf
%config(noreplace) %attr(0640,root,radius) %{_sysconfdir}/raddb/users
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/x99passwd.sample
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/eap.conf
%config(noreplace) %attr(-,root,root) %{_sysconfdir}/raddb/certs/*

%{_bindir}/rad*
%{_bindir}/rlm_*
%{_bindir}/smbencrypt
%{_sbindir}/check*
%{_sbindir}/rad*

# these belong to their respective sub package
%exclude %{_libdir}/%{name}/rlm_sql_mysql*
%exclude %{_libdir}/%{name}/rlm_sql_postgresql*
%exclude %{_libdir}/%{name}/rlm_sql_unixodbc*
%exclude %{_libdir}/%{name}/rlm_krb5*
%exclude %{_libdir}/%{name}/rlm_ldap*

%attr(0755,radius,radius) %dir /var/log/radius
%attr(0755,radius,radius) %dir /var/log/radius/radacct
%attr(0755,radius,radius) %dir /var/run/radiusd
%attr(0644,radius,radius) %ghost /var/log/radius/radutmp
%attr(0644,radius,radius) %ghost /var/log/radius/radwtmp
%attr(0644,radius,radius) %ghost /var/log/radius/radius.log
%attr(0644,root,root) %{_datadir}/snmp/mibs/*
%{_datadir}/freeradius
%attr(0644,root,root) %{_mandir}/man*/*

%files			-n %libname-krb5
%defattr(-,root,root)
%doc rlm_krb5
%{_libdir}/%{name}/rlm_krb5*.so*

%files			-n %libname-ldap
%defattr(-,root,root)
%doc RADIUS-LDAP.schema RADIUS-LDAPv3.schema rlm_ldap
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/ldap.attrmap
%{_libdir}/%{name}/rlm_ldap*.so*

%files			-n %libname-postgresql
%defattr(-,root,root)
%doc db_postgresql.sql
%doc src/billing
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/postgresql.conf
%{_libdir}/%{name}/rlm_sql_postgresql*.so*

%files			-n %libname-mysql
%defattr(-,root,root)
%doc db_mysql.sql
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/mysql.conf
%{_libdir}/%{name}/rlm_sql_mysql*.so*

%files			-n %libname-unixODBC
%defattr(-,root,root)
%{_libdir}/%{name}/rlm_sql_unixodbc*.so*

%files			-n %libname
%defattr(-,root,root)
%{_libdir}/%{name}/libradius*.la
%{_libdir}/%{name}/libradius*.so
%{_libdir}/%{name}/libeap.la
%{_libdir}/%{name}/libeap*.so
%{_libdir}/%{name}/rlm_*.la
%{_libdir}/%{name}/rlm_*.so

%files			-n %libname-devel
%defattr(-,root,root)
%doc todo
%if %mdkversion >= 1020
%multiarch %{multiarch_includedir}/freeradius/build-radpaths-h
%multiarch %{multiarch_includedir}/freeradius/radpaths.h
%endif
%{_includedir}/%{name}
%{_libdir}/%{name}/*.a

%changelog
* Fri Apr 08 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.0.2-1mdk
- 1.0.2
- use the %%mkrel macro
- misc rpmlint fixes

* Mon Jan 31 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.0.0-6mdk
- fix deps and conditional %%multiarch

* Mon Jan 24 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 1.0.0-5mdk
- rebuilt against MySQL-4.1.x system libs

* Tue Dec 07 2004 Michael Scherer <misc@mandrake.org> 1.0.0-4mdk
- Rebuild for new python

* Wed Sep  1 2004 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 1.0.0-3mdk
- add obsolete/provide to new libpackages

* Wed Sep  1 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.0.0-2mdk
- fix build

* Thu Aug 19 2004 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 1.0.0-1mdk
- 1.0.0

* Sun Aug 01 2004 Arnaud de Lorbeau <adelorbeau@mandrakesoft.com> 1.0.0-pre3.4mdk
- new release
- package libification

* Sun May 02 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.9.3-8mdk
- fix the %%vendor and %%distribution string

* Sun Apr 18 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.9.3-7mdk
- fix changelog and some rpmlint errors

* Sun Apr 18 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 0.9.3-6mdk
- added P6 because that's what it's really asking for... (fix #6797 ?)

* Fri Apr 2 2004 Tibor Pittich <Tibor.Pittich@mandrake.org> 0.9.3-5mdk
- remove dirty tricks with rlm_ldap, fixed on openldap package
- incerease rpm build - problem with previous error in changelog

* Sun Feb 22 2004 Tibor Pittich <Tibor.Pittich@mandrake.org> 0.9.3-2mdk
- updated to 0.9.3
- freeradius requires openldap2-devel/libs and sasl2-devel/libs
- some macroszification in configure stage
- remove duplicate --with-system-libtool from configure macro
- remove --enable-developer from configure macro, we are users :)
- added dirty trick to allow build rlm_ldap; somewhere is problem caused that
  libtool only here can't find liblber.la and libsasl2.la
- /var/log/radius as --with-logdir
- some cleanup

* Fri Jan 30 2004 Tibor Pittich <Tibor.Pittich@mandrake.org> 0.9.3-1mdk
- fixed freeradius-mysql and freeradius-unixODBC packages to really include so
  library not only symlink

* Thu Oct 23 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.2-2mdk
- fix pid file location (duh!)
- lib64 fix in S2

* Mon Oct 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.9.2-1mdk
- 0.9.2
- fix P0
- drop P1, it's included
- merge rh patches (P2 & P5)
- fix invalid-build-requires
- fix explicit-lib-dependency
- misc spec file fixes

* Sat Jul 26 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 0.8.1-4mdk
- rebuild against new kerberos
- use system com_err.h header (P4)

* Wed Jul 16 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.8.1-3mdk
- rebuilt against new openldap, sasl2, etc.

* Sun Jun 29 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.8.1-2mdk
- added P1 from CVS to enable build against new PostgreSQL libs
- use macros
- added missing files
- might as well enable the "experimental-modules"
- don't link against db2
- added P2 by RH to make it load modules without la files
- updated P0
- put correct attributes on the files in %{_sysconfdir}/raddb/
- the %{_sysconfdir}/raddb dir has to be owned by the radius user
- misc spec file fixes

* Sun Mar 02 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.8.1-1mdk
- initial cooker contrib
- used microscopic parts of the provided spec file and debian conf
- don't pack the web gui, it will be a separate package, if ever
- great thanks to Jim Tarvid at LSNet for testing!