--- /dev/null
+*.dsw -crlf
+buildconf eol=lf
+configure.ac eol=lf
+*.m4 eol=lf
+*.in eol=lf
--- /dev/null
+.deps
+.libs
+*.lib
+*.pdb
+*.dll
+*.exe
+*.obj
+*.asc
+.*.swp
+Debug
+Release
+*.exp
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+libtool
+ltmain.sh
+compile
+curl-config
+libcurl.pc
+missing
+curl-*.tar.gz
+curl-*.tar.bz2
+curl-*.tar.lzma
+curl-*.zip
+INSTALL
+install-sh
+*.o
+*.lo
+*.la
+mkinstalldirs
+tags
+TAGS
+*~
+aclocal.m4.bak
+CHANGES.dist
+.project
+.cproject
+.settings
+/[0-9]*.patch
+.dirstamp
--- /dev/null
+language: c
+
+before_script:
+ - ./buildconf
+
+compiler:
+ - clang
+ - gcc
+
+notifications:
+ email: false
+++ /dev/null
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
- eat=1
- linker_opts="$linker_opts $2"
- ;;
- -*)
- set x "$@" "$1"
- shift
- ;;
- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
- func_file_conv "$1"
- set x "$@" -Tp"$file"
- shift
- ;;
- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
- func_file_conv "$1" mingw
- set x "$@" "$file"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
- done
- if test -n "$linker_opts"; then
- linker_opts="-link$linker_opts"
- fi
- exec "$@" $linker_opts
- exit 1
-}
-
-eat=
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
- func_cl_wrapper "$@" # Doesn't return...
- ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- # So we strip '-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no '-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # '.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
dnl genprogc/thread_quick_ref.htm
+dnl **********************************************************************
+dnl Check for ICU-UC (IDN support)
+dnl **********************************************************************
+
+AC_MSG_CHECKING([whether to build with icu-uc])
+OPT_IDN="default"
+AC_ARG_WITH(icu-uc,
+AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
+AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
+ [OPT_IDN=$withval])
+case "$OPT_IDN" in
+ no)
+ dnl --without-icu-uc option used
+ want_idn="no"
+ AC_MSG_RESULT([no])
+ ;;
+ default)
+ dnl configure option not specified
+ want_idn="yes"
+ want_idn_path="default"
+ AC_MSG_RESULT([(assumed) yes])
+ ;;
+ yes)
+ dnl --with-icu-uc option used without path
+ want_idn="yes"
+ want_idn_path="default"
+ AC_MSG_RESULT([yes])
+ ;;
+ *)
+ dnl --with-icu-uc option used with path
+ want_idn="yes"
+ want_idn_path="$withval"
+ AC_MSG_RESULT([yes ($withval)])
+ ;;
+esac
+
+if test "$want_idn" = "yes"; then
+ dnl idn library support has been requested
+ clean_CPPFLAGS="$CPPFLAGS"
+ clean_LDFLAGS="$LDFLAGS"
+ clean_LIBS="$LIBS"
+ PKGCONFIG="no"
+ #
+ if test "$want_idn_path" != "default"; then
+ dnl path has been specified
+ IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
+ CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
+ if test "$PKGCONFIG" != "no"; then
+ IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+ $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
+ IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+ $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
+ IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+ $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ else
+ dnl pkg-config not available or provides no info
+ IDN_LIBS="-licu-uc"
+ IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
+ IDN_CPPFLAGS="-I$want_idn_path/include"
+ IDN_DIR="$want_idn_path/lib$libsuff"
+ fi
+ else
+ dnl path not specified
+ CURL_CHECK_PKGCONFIG(icu-uc)
+ if test "$PKGCONFIG" != "no"; then
+ IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
+ IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
+ IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ else
+ dnl pkg-config not available or provides no info
+ IDN_LIBS="-licu-uc"
+ fi
+ fi
+ #
+ if test "$PKGCONFIG" != "no"; then
+ AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
+ AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
+ AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
+ AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
+ else
+ AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
+ AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
+ AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
+ AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
+ fi
+ #
+ CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
+ LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
+ LIBS="$IDN_LIBS $LIBS"
+ #
+ AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
+ AC_LINK_IFELSE([
+ AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_links_icu="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_links_icu="no"
+ ])
+ #
+ if test "$tst_links_icu" = "yes"; then
+ AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
+ dnl different versions of libidn have different setups of these:
+
+ AC_SUBST([IDN_ENABLED], [1])
+ curl_idn_msg="enabled (icu-uc)"
+ if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
+ export LD_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+ fi
+ else
+ AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
+ CPPFLAGS="$clean_CPPFLAGS"
+ LDFLAGS="$clean_LDFLAGS"
+ LIBS="$clean_LIBS"
+ fi
+
+fi
+
+dnl Let's hope this split URL remains working:
+dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
+dnl genprogc/thread_quick_ref.htm
+
+dnl **********************************************************************
+dnl Check for DLP
+dnl **********************************************************************
+
+AC_ARG_ENABLE([dlp],
+ AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
+
+AS_IF([test "x$enable_dlp" = "xyes"], [
+ CPPFLAGS+=" -DUSE_TIZEN_FEATURE_DLP"
+])
+
+AM_CONDITIONAL(USE_TIZEN_FEATURE_DLP, test "x$enable_dlp" = "xyes")
+
dnl **********************************************************************
dnl Check for nghttp2
include/curl/Makefile \
src/Makefile \
lib/Makefile \
+ extensions/Makefile \
scripts/Makefile \
lib/libcurl.vers \
tests/Makefile \
--- /dev/null
+lib_LTLIBRARIES = libcurl_extension_dlp.la
+
+libcurl_extension_dlp_la_SOURCES = tizen_dlp.c
--- /dev/null
+/**
+ * @file tizen_dlp.cpp
+ * @brief external API functions for DLP
+ */
+
+#include <dlfcn.h>
+
+#define LIBRARY_PATH "/lib/libprivacy-guard-client.so"
+
+static int first_run = 1;
+static void (*privacy_guard_dlp_init)(void) = 0;
+static void (*privacy_guard_dlp_check_leak)(const char *, char * const, size_t) = 0;
+
+/**
+ * @fn void tizen_dlp_init(void)
+ * @brief Initialize the DLP creating the Load Rules and Logging threads
+ * @callgraph
+ */
+void tizen_dlp_init(void)
+{
+ if (first_run) {
+ void *handle = dlopen(LIBRARY_PATH, RTLD_LAZY|RTLD_NODELETE);
+ if (handle) {
+ privacy_guard_dlp_init = dlsym(handle, "privacy_guard_dlp_init");
+ privacy_guard_dlp_check_leak = dlsym(handle, "privacy_guard_dlp_check_leak");
+ dlclose(handle);
+ first_run = 0;
+ }
+ }
+
+ if (privacy_guard_dlp_init)
+ privacy_guard_dlp_init();
+}
+
+/**
+ * @fn void tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len)
+ * @brief Checks for information leak on a given request string
+ *
+ * @param[in] hostname The hostname of the server to which the request will be sent
+ * @param[in] mem Text that we are going to validate for info leak
+ * @param[in] len Size of len in bytes
+ *
+ * @return either PRIV_GUARD_DLP_RESULT_ALLOW or PRIV_GUARD_DLP_RESULT_DENY
+ * @callgraph
+ */
+void tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len)
+{
+ /**
+ * Send data to Tizen DLP verification
+ */
+ if(privacy_guard_dlp_check_leak)
+ privacy_guard_dlp_check_leak(hostname, mem, len);
+}
/* to enable Apple OS native SSL/TLS support */
#undef USE_DARWINSSL
+/* Define to 1 if you have the `icu-uc' library (-licu-uc). */
+#undef USE_ICU_IDNA
+
/* if GnuTLS is enabled */
#undef USE_GNUTLS
--- /dev/null
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 2014 - 2016, Steve Holme, <steve_holme@hotmail.com>.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/**
+ * @file curl_extensions.cpp
+ * @brief external API functions for DLP
+ */
+
+#ifdef USE_TIZEN_FEATURE_DLP
+#include <dlfcn.h>
+#include <extensions/curl_extensions.h>
+
+#define LIBRARY_PATH "/usr/lib/libcurl_extension_dlp.so.0"
+
+static int first_run = 1;
+static void (*tizen_dlp_init)(void) = NULL;
+static void (*tizen_dlp_check_leak)(const char *, char * const, size_t) = NULL;
+
+/**
+ * @fn void curl_extensions_init(void)
+ * @brief Load the extension shared library looking for the function call
+ * symbols it going to use
+ * @callgraph
+ */
+static void curl_extensions_init(void)
+{
+ if (first_run) {
+ void *handle = dlopen(LIBRARY_PATH, RTLD_LAZY|RTLD_NODELETE);
+ if (handle) {
+ tizen_dlp_init = dlsym(handle, "tizen_dlp_init");
+ tizen_dlp_check_leak = dlsym(handle, "tizen_dlp_check_leak");
+ dlclose(handle);
+ first_run = 0;
+ }
+ }
+}
+
+/**
+ * @callgraph
+ */
+void curl_extensions_tizen_dlp_init(void)
+{
+ curl_extensions_init();
+
+ if (tizen_dlp_init)
+ tizen_dlp_init();
+}
+
+/**
+ * @callgraph
+ */
+void curl_extensions_tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len)
+{
+ if(tizen_dlp_check_leak)
+ tizen_dlp_check_leak(hostname, mem, len);
+}
+#endif /* USE_TIZEN_FEATURE_DLP */
--- /dev/null
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 2014 - 2016, Steve Holme, <steve_holme@hotmail.com>.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/**
+ * @file curl_extensions.h
+ * @brief API for privacy-guard-dlp
+ */
+
+#ifdef USE_TIZEN_FEATURE_DLP
+#ifndef HEADER_CURL_EXTENSIONS_H
+#define HEADER_CURL_EXTENSIONS_H
+
+#include <stddef.h>
+
+/**
+ * @fn void curl_extensions_tizen_dlp_init(void)
+ * @brief Initialize the DLP creating the Load Rules and Logging threads
+ * @callgraph
+ */
+void curl_extensions_tizen_dlp_init(void);
+
+/**
+ * @fn void curl_extensions_tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len)
+ * @brief Checks for information leak on a given request string
+ *
+ * @param[in] hostname The hostname of the server to which the request will be sent
+ * @param[in] mem Text that we are going to validate for info leak
+ * @param[in] len Size of len in bytes
+ *
+ * @return either PRIV_GUARD_DLP_RESULT_ALLOW or PRIV_GUARD_DLP_RESULT_DENY
+ * @callgraph
+ */
+void curl_extensions_tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len);
+
+#endif /* HEADER_CURL_EXTENSIONS_H */
+#endif /* USE_TIZEN_FEATURE_DLP */
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: curl
+Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
+Version: 7.59.0
+Release: 1
+Group: Applications/Internet
+License: MIT
+URL: http://curl.haxx.se/
+#Source0: http://curl.haxx.se/download/%{name}-%{version}.tar.bz2
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
+BuildRequires: pkgconfig(openssl)
+BuildRequires: pkgconfig(zlib)
+BuildRequires: pkgconfig(libcares)
+BuildRequires: pkgconfig(libnghttp2)
+
+Provides: webclient
+
+
+%description
+curl is a client to get documents/files from servers, using any of the
+supported protocols. The command is designed to work without user
+interaction or any kind of interactivity.
+
+curl offers a busload of useful tricks like proxy support, user
+authentication, ftp upload, HTTP post, file transfer resume and more.
+
+%package -n libcurl
+Summary: A library for getting files from web servers
+Group: System/Libraries
+License: MIT
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libcurl
+This package provides a way for applications to use FTP, HTTP, Gopher and
+other servers for getting files.
+
+
+%package -n libcurl-devel
+Summary: Files needed for building applications with libcurl
+Group: Development/Libraries
+License: MIT
+Requires: libcurl = %{version}-%{release}
+Provides: curl-devel = %{version}-%{release}
+Obsoletes: curl-devel < %{version}-%{release}
+
+%description -n libcurl-devel
+libcurl is the core engine of curl; this packages contains all the libs,
+headers, and manual pages to develop applications using libcurl.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+#%patch01 -p1
+#%patch02 -p1
+
+%build
+
+export CPPFLAGS="-DHAVE_PK11_CREATEGENERICOBJECT"
+CFLAGS+=" -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE -pie"
+%if "%{TIZEN_PROFILE_TV}" == "1"
+CFLAGS+=" -DTIZEN_TV_EXT"
+%reconfigure --without-nss --without-gnutls --with-openssl --disable-ipv6 \
+%else
+%reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \
+%endif
+--with-ca-path==/etc/ssl/certs \
+--with-ca-bundle=/etc/ssl/ca-bundle.pem \
+--with-lber-lib=lber \
+--enable-manual --enable-versioned-symbols --enable-ares --enable-debug --enable-curldebug \
+--disable-static \
+--with-nghttp2 \
+--without-zsh-functions-dir \
+
+#--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt
+
+sed -i -e 's,-L/usr/lib ,,g;s,-L/usr/lib64 ,,g;s,-L/usr/lib$,,g;s,-L/usr/lib64$,,g' \
+Makefile libcurl.pc
+# Remove bogus rpath
+sed -i \
+-e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
+-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+
+make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+
+rm -rf $RPM_BUILD_ROOT
+
+make DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" install
+
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl{,_extension_dlp}.la
+install -d $RPM_BUILD_ROOT/%{_datadir}/aclocal
+install -m 644 docs/libcurl/libcurl.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
+
+
+# don't need curl's copy of the certs; use openssl's
+find ${RPM_BUILD_ROOT} -name ca-bundle.crt -exec rm -f '{}' \;
+rm -rf ${RPM_BUILD_ROOT}/usr/share/man
+
+%post -n libcurl -p /sbin/ldconfig
+
+%postun -n libcurl -p /sbin/ldconfig
+
+%files
+%{_bindir}/curl
+%license COPYING
+
+%files -n libcurl
+%manifest %{name}.manifest
+%{_libdir}/libcurl.so.*
+%license COPYING
+
+%files -n libcurl-devel
+%{_bindir}/curl-config*
+%{_includedir}/curl
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+%{_datadir}/aclocal/libcurl.m4
curl_SOURCES = $(CURL_FILES)
# This might hold -Werror
-CFLAGS += @CURL_CFLAG_EXTRAS@
+# Enable Position Independent Executable flag
+CFLAGS += @CURL_CFLAG_EXTRAS@ -fPIE
+LDFLAGS += -pie
# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)