Przeglądaj źródła

allow ssl and zlib support to be disabled; allow idn support be optionally enabled

Ralf S. Engelschall 21 lat temu
rodzic
commit
e5f83f069f
1 zmienionych plików z 41 dodań i 8 usunięć
  1. 41 8
      curl/curl.spec

+ 41 - 8
curl/curl.spec

@@ -34,7 +34,12 @@ Class:        BASE
 Group:        Web
 License:      GPL
 Version:      7.12.1
-Release:      20040811
+Release:      20040917
+
+#   package options
+%option       with_ssl   yes
+%option       with_zlib  yes
+%option       with_idn   no
 
 #   list of sources
 Source0:      http://curl.haxx.se/download/curl-%{version}.tar.bz2
@@ -44,8 +49,18 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20040130, make, gcc
 PreReq:       OpenPKG, openpkg >= 20040130
-BuildPreReq:  openssl >= 0.9.7, zlib
-PreReq:       openssl >= 0.9.7, zlib
+%if "%{with_ssl}" == "yes"
+BuildPreReq:  openssl >= 0.9.7
+PreReq:       openssl >= 0.9.7
+%endif
+%if "%{with_zlib}" == "yes"
+BuildPreReq:  zlib
+PreReq:       zlib
+%endif
+%if "%{with_idn}" == "yes"
+BuildPreReq:  pkgconfig, libidn
+PreReq:       pkgconfig, libidn
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -74,16 +89,34 @@ AutoReqProv:  no
       echo 'lt_cv_prog_compiler_c_o_F77=no'
       echo 'lt_cv_sys_max_cmd_len=100'
     ) >config.cache
-    CC="%{l_cc}" \
-    CXX="%{l_cxx}" \
-    CFLAGS="%{l_cflags -O} %{l_cppflags}" \
-    CPPFLAGS="%{l_cppflags}" \
-    LDFLAGS="%{l_ldflags}" \
+    export CC="%{l_cc}"
+    export CXX="%{l_cxx}"
+    export CFLAGS="%{l_cflags -O} %{l_cppflags}"
+    export CPPFLAGS="%{l_cppflags}"
+    export LDFLAGS="%{l_ldflags}"
+    export LIBS=""
+%if "%{with_idn}" == "yes"
+    CFLAGS="$CFLAGS `pkg-config --cflags libidn`"
+    LIBS="$LIBS `pkg-config --libs libidn`"
+%endif
     ./configure \
         --cache-file=./config.cache \
         --prefix=%{l_prefix} \
+%if "%{with_ssl}" == "yes"
         --with-ssl=%{l_prefix} \
+%else
+        --without-ssl \
+%endif
+%if "%{with_zlib}" == "yes"
         --with-zlib=%{l_prefix} \
+%else
+        --without-zlib \
+%endif
+%if "%{with_idn}" == "yes"
+        --with-libidn=%{l_prefix} \
+%else
+        --without-libidn \
+%endif
         --disable-shared
     %{l_make} %{l_mflags -O}