Added hardening compiler flags in the spec file.
[platform/upstream/curl.git] / packaging / curl.spec
1 Name:       curl
2 Summary:    A utility for getting files from remote servers (FTP, HTTP, and others)
3 Version:    7.53.1
4 Release:    1
5 Group:      Applications/Internet
6 License:    MIT
7 URL:        http://curl.haxx.se/
8 #Source0:    http://curl.haxx.se/download/%{name}-%{version}.tar.bz2
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001:     %{name}.manifest
11
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(openssl)
14 BuildRequires:  pkgconfig(zlib)
15 BuildRequires:  pkgconfig(libcares)
16 BuildRequires:  pkgconfig(libnghttp2)
17
18 Provides:   webclient
19
20
21 %description
22 curl is a client to get documents/files from servers, using any of the
23 supported protocols. The command is designed to work without user
24 interaction or any kind of interactivity.
25
26 curl offers a busload of useful tricks like proxy support, user
27 authentication, ftp upload, HTTP post, file transfer resume and more.
28
29 %package -n libcurl
30 Summary:    A library for getting files from web servers
31 Group:      System/Libraries
32 License:    MIT
33 Requires(post): /sbin/ldconfig
34 Requires(postun): /sbin/ldconfig
35
36 %description -n libcurl
37 This package provides a way for applications to use FTP, HTTP, Gopher and
38 other servers for getting files.
39
40
41 %package -n libcurl-devel
42 Summary:    Files needed for building applications with libcurl
43 Group:      Development/Libraries
44 License:    MIT
45 Requires:   libcurl = %{version}-%{release}
46 Requires:   glib2-devel
47 Provides:   curl-devel = %{version}-%{release}
48 Obsoletes:   curl-devel < %{version}-%{release}
49
50 %description -n libcurl-devel
51 libcurl is the core engine of curl; this packages contains all the libs,
52 headers, and manual pages to develop applications using libcurl.
53
54 %package -n libcurl-extension-dlp
55 Summary:        Extensions for Tizen OS
56 Provides:       libcurl-extension-dlp = %{version}-%{release}
57 Requires(post): /sbin/ldconfig
58 Requires(postun): /sbin/ldconfig
59
60 %description -n libcurl-extension-dlp
61 libcurl extensions for Tinen OS.
62
63 %prep
64 %setup -q
65 cp %{SOURCE1001} .
66
67 #%patch01 -p1
68 #%patch02 -p1
69
70 %build
71
72 export CPPFLAGS="-DHAVE_PK11_CREATEGENERICOBJECT"
73 CFLAGS+=" -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE -pie"
74 %if "%{TIZEN_PROFILE_TV}" == "1"
75 CFLAGS+=" -DTIZEN_TV_EXT"
76 %reconfigure --without-nss --without-gnutls --with-openssl --disable-ipv6 \
77 %else
78 %reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \
79 %endif
80 --with-ca-path==/etc/ssl/certs \
81 --with-ca-bundle=/etc/ssl/ca-bundle.pem \
82 --with-glib2 \
83 --with-lber-lib=lber \
84 --enable-manual --enable-versioned-symbols --enable-ares --enable-debug --enable-curldebug \
85 --disable-static \
86 --with-nghttp2 \
87 --without-zsh-functions-dir \
88 --enable-dlp \
89
90 #--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt 
91
92 sed -i -e 's,-L/usr/lib ,,g;s,-L/usr/lib64 ,,g;s,-L/usr/lib$,,g;s,-L/usr/lib64$,,g' \
93 Makefile libcurl.pc
94 # Remove bogus rpath
95 sed -i \
96 -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
97 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
98
99 make %{?_smp_mflags}
100
101 %install
102 rm -rf %{buildroot}
103
104 rm -rf $RPM_BUILD_ROOT
105
106 make DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" install
107
108 rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl{,_extension_dlp}.la
109 install -d $RPM_BUILD_ROOT/%{_datadir}/aclocal
110 install -m 644 docs/libcurl/libcurl.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
111
112
113 # don't need curl's copy of the certs; use openssl's
114 find ${RPM_BUILD_ROOT} -name ca-bundle.crt -exec rm -f '{}' \;
115 rm -rf ${RPM_BUILD_ROOT}/usr/share/man
116
117 %post -n libcurl -p /sbin/ldconfig
118
119 %postun -n libcurl -p /sbin/ldconfig
120
121 %files
122 %{_bindir}/curl
123 %license COPYING
124
125 %files -n libcurl
126 %manifest %{name}.manifest
127 %{_libdir}/libcurl.so.*
128 %license COPYING
129
130 %files -n libcurl-devel
131 %{_bindir}/curl-config*
132 %{_includedir}/curl
133 %{_libdir}/*.so
134 %{_libdir}/pkgconfig/*.pc
135 %{_datadir}/aclocal/libcurl.m4
136
137 %files -n libcurl-extension-dlp
138 %manifest %{name}.manifest
139 %{_libdir}/libcurl_extension_dlp.so.*
140 %license COPYING