Modernize packaging, leverage pkg-config(1), and improve integration of

Tue, 28 Aug 2012 18:31:20 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:31:20 +0200
changeset 546
7894123eadbf
parent 545
66949ddfb716
child 547
1c75a8bb0fec

Modernize packaging, leverage pkg-config(1), and improve integration of
optional OpenLDAP and PostgreSQL component logic.

freeradius/freeradius.spec file | annotate | diff | comparison | revisions
     1.1 --- a/freeradius/freeradius.spec	Tue Aug 28 18:31:15 2012 +0200
     1.2 +++ b/freeradius/freeradius.spec	Tue Aug 28 18:31:20 2012 +0200
     1.3 @@ -21,6 +21,9 @@
     1.4  ##  SUCH DAMAGE.
     1.5  ##
     1.6  
     1.7 +#   FIXME: rse: default configuration is a little bit fat
     1.8 +#   FIXME: rse: still not runtime tested
     1.9 +
    1.10  #   package information
    1.11  Name:         freeradius
    1.12  Summary:      FreeRADIUS Server
    1.13 @@ -32,7 +35,7 @@
    1.14  Group:        RADIUS
    1.15  License:      GPL
    1.16  Version:      2.1.10
    1.17 -Release:      20100930
    1.18 +Release:      20120800
    1.19  
    1.20  #   package options
    1.21  %option       with_mysql     no
    1.22 @@ -46,10 +49,8 @@
    1.23  Patch0:       freeradius.patch
    1.24  
    1.25  #   build information
    1.26 -Prefix:       %{l_prefix}
    1.27 -BuildRoot:    %{l_buildroot}
    1.28 -BuildPreReq:  OpenPKG, openpkg >= 20060823, make, gcc, libtool
    1.29 -PreReq:       OpenPKG, openpkg >= 20060823
    1.30 +BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc, libtool
    1.31 +PreReq:       OpenPKG, openpkg >= 20100101
    1.32  BuildPreReq:  perl, openssl, gdbm, readline
    1.33  PreReq:       perl, openssl, gdbm, readline
    1.34  %if "%{with_mysql}" == "yes"
    1.35 @@ -57,7 +58,7 @@
    1.36  PreReq:       mysql, zlib
    1.37  %endif
    1.38  %if "%{with_openldap}" == "yes"
    1.39 -BuildPreReq:  openldap
    1.40 +BuildPreReq:  openldap, pkgconfig
    1.41  PreReq:       openldap
    1.42  %endif
    1.43  %if "%{with_pgsql}" == "yes"
    1.44 @@ -68,8 +69,6 @@
    1.45  BuildPreReq:  snmp
    1.46  PreReq:       snmp
    1.47  %endif
    1.48 -AutoReq:      no
    1.49 -AutoReqProv:  no
    1.50  
    1.51  %description
    1.52      FreeRADIUS is one of the most modular and featureful RADIUS servers
    1.53 @@ -93,32 +92,22 @@
    1.54          -e 's; */usr/local/pgsql/include;;g' \
    1.55          -e 's; */usr/include/pgsql;;g' \
    1.56          src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure
    1.57 -    extlib=''
    1.58 -    case "%{l_platform -t}" in
    1.59 -        *-sunos* )
    1.60 -            extlib='-lsocket -lnsl'
    1.61 -            ;;
    1.62 -    esac
    1.63 -%if "%{with_openldap}" == "yes"
    1.64 -    %{l_shtool} subst \
    1.65 -        -e "s;\(LIBS *=.*  *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \
    1.66 -        -e "s;\(smart_lib *=.*  *-lldap[_r]*\);\1 -llber -lssl -lcrypto $extlib;g" \
    1.67 -        src/modules/rlm_ldap/configure
    1.68 -%endif
    1.69 -%if "%{with_pgsql}" == "yes"
    1.70 -    %{l_shtool} subst \
    1.71 -        -e "s;-lpq;-lpq `%{l_prefix}/bin/pg_config --libs` $extlib;g" \
    1.72 -        src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure
    1.73 -%endif
    1.74  
    1.75  %build
    1.76      #   configure package
    1.77 +    extlib=''
    1.78 +%if "%{with_pgsql}" == "yes"
    1.79 +    extlib="`%{l_prefix}/bin/pg_config --libs`"
    1.80 +%endif
    1.81 +%if "%{with_openldap}" == "yes"
    1.82 +    extlib="$extlib `%{l_prefix}/bin/pkg-config --libs openldap`" \
    1.83 +%endif
    1.84      CC="%{l_cc}" \
    1.85      CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
    1.86      CPPFLAGS="%{l_cppflags}" \
    1.87      LDFLAGS="%{l_ldflags}" \
    1.88  %if "%{with_openldap}" == "yes"
    1.89 -    LIBS="-llber -lssl -lcrypto -lreadline" \
    1.90 +    LIBS="$extlib" \
    1.91  %endif
    1.92      ./configure \
    1.93          --prefix=%{l_prefix} \
    1.94 @@ -193,7 +182,6 @@
    1.95  
    1.96  %install
    1.97      #   install package
    1.98 -    rm -rf $RPM_BUILD_ROOT
    1.99      %{l_shtool} mkdir -f -p -m 755 \
   1.100          $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
   1.101      %{l_make} %{l_mflags} install \
   1.102 @@ -229,5 +217,4 @@
   1.103  %files -f files
   1.104  
   1.105  %clean
   1.106 -    rm -rf $RPM_BUILD_ROOT
   1.107  

mercurial