# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171480 -7200 # Node ID 7894123eadbf58e0e7df696675417b28d1176b8e # Parent 66949ddfb71687f313741f749dcddf8938fa6f1c Modernize packaging, leverage pkg-config(1), and improve integration of optional OpenLDAP and PostgreSQL component logic. diff -r 66949ddfb716 -r 7894123eadbf freeradius/freeradius.spec --- a/freeradius/freeradius.spec Tue Aug 28 18:31:15 2012 +0200 +++ b/freeradius/freeradius.spec Tue Aug 28 18:31:20 2012 +0200 @@ -21,6 +21,9 @@ ## SUCH DAMAGE. ## +# FIXME: rse: default configuration is a little bit fat +# FIXME: rse: still not runtime tested + # package information Name: freeradius Summary: FreeRADIUS Server @@ -32,7 +35,7 @@ Group: RADIUS License: GPL Version: 2.1.10 -Release: 20100930 +Release: 20120800 # package options %option with_mysql no @@ -46,10 +49,8 @@ Patch0: freeradius.patch # build information -Prefix: %{l_prefix} -BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, libtool -PreReq: OpenPKG, openpkg >= 20060823 +BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, libtool +PreReq: OpenPKG, openpkg >= 20100101 BuildPreReq: perl, openssl, gdbm, readline PreReq: perl, openssl, gdbm, readline %if "%{with_mysql}" == "yes" @@ -57,7 +58,7 @@ PreReq: mysql, zlib %endif %if "%{with_openldap}" == "yes" -BuildPreReq: openldap +BuildPreReq: openldap, pkgconfig PreReq: openldap %endif %if "%{with_pgsql}" == "yes" @@ -68,8 +69,6 @@ BuildPreReq: snmp PreReq: snmp %endif -AutoReq: no -AutoReqProv: no %description FreeRADIUS is one of the most modular and featureful RADIUS servers @@ -93,32 +92,22 @@ -e 's; */usr/local/pgsql/include;;g' \ -e 's; */usr/include/pgsql;;g' \ src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure - extlib='' - case "%{l_platform -t}" in - *-sunos* ) - extlib='-lsocket -lnsl' - ;; - esac -%if "%{with_openldap}" == "yes" - %{l_shtool} subst \ - -e "s;\(LIBS *=.* *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \ - -e "s;\(smart_lib *=.* *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \ - src/modules/rlm_ldap/configure -%endif -%if "%{with_pgsql}" == "yes" - %{l_shtool} subst \ - -e "s;-lpq;-lpq `%{l_prefix}/bin/pg_config --libs` $extlib;g" \ - src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure -%endif %build # configure package + extlib='' +%if "%{with_pgsql}" == "yes" + extlib="`%{l_prefix}/bin/pg_config --libs`" +%endif +%if "%{with_openldap}" == "yes" + extlib="$extlib `%{l_prefix}/bin/pkg-config --libs openldap`" \ +%endif CC="%{l_cc}" \ CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \ CPPFLAGS="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ %if "%{with_openldap}" == "yes" - LIBS="-llber -lssl -lcrypto -lreadline" \ + LIBS="$extlib" \ %endif ./configure \ --prefix=%{l_prefix} \ @@ -193,7 +182,6 @@ %install # install package - rm -rf $RPM_BUILD_ROOT %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius %{l_make} %{l_mflags} install \ @@ -229,5 +217,4 @@ %files -f files %clean - rm -rf $RPM_BUILD_ROOT