• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Use --define 'nossl 1' on the command line to disable SSL detection
2%{!?nossl:%define SSL 1}
3%{?nossl:%define SSL 0}
4
5%define name curl
6%define version @VERSION@
7%define release 1%{!?nossl:ssl}
8
9%define curlroot %{_builddir}/%{name}-%{version}
10
11Summary: get a file from a FTP or HTTP server.
12Name: %{name}
13Version: %{version}
14Release: %{release}
15License: MIT/X derivate
16Vendor: Daniel Stenberg <Daniel.Stenberg@haxx.se>
17Group: Applications/Internet
18Source: %{name}-%{version}.tar.bz2
19URL: https://curl.haxx.se/
20Provides: curl
21BuildRoot: %{_tmppath}/%{name}-%{version}-root
22Prefix: %{_prefix}
23
24%description
25curl is a client to get documents/files from servers, using any of the
26supported protocols.  The command is designed to work without user
27interaction or any kind of interactivity.
28
29curl offers many useful tricks like proxy support, user authentication,
30ftp upload, HTTP post, file transfer resume and more.
31
32%if %{SSL} == 1
33Note: this version is compiled with SSL support.
34%else
35Note: this version is compiled without SSL support.
36%endif
37
38%package	devel
39Summary:	Development files for the curl library
40Group:		Development/Libraries
41%if %{SSL} == 1
42Requires: openssl >= 0.9.5
43%endif
44Requires:	curl = %{version}
45Provides:	curl-devel
46
47%description devel
48libcurl is the core engine of curl; this packages contains all the
49libs, headers, and manual pages to develop applications using libcurl.
50
51%define DEFCC xlc
52
53%prep
54rm -rf %{curlroot}
55%setup -q
56
57%build
58
59# Use the default compiler for this platform - gcc otherwise
60if [[ -z "$CC" ]]
61then
62    if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then
63       export CC=%{DEFCC}
64    else
65       export CC=gcc
66    fi
67fi
68
69cd %{curlroot} && (if [ -f configure.in ]; then mv -f configure.in configure.in.
70rpm; fi)
71
72./configure --prefix=%{prefix} \
73%if %{SSL} == 1
74        --with-ssl
75%else
76        --without-ssl
77%endif
78
79make
80
81%install
82[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
83make DESTDIR=%{buildroot} install-strip
84
85( cd $RPM_BUILD_ROOT   # same as %{buildroot}
86
87 for dir in bin include
88 do
89    mkdir -p usr/$dir
90    cd usr/$dir
91    ln -sf ../..%{prefix}/$dir/* .
92    cd -
93 done
94
95 mkdir -p usr/lib
96 cd usr/lib
97 ln -sf ../..%{prefix}/lib/* .
98 cd -
99)
100
101%clean
102[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
103
104%files
105%defattr(-,root,root)
106%attr(0755,root,root) %{_bindir}/curl
107%attr(0644,root,root) %{_mandir}/man1/curl.1*
108%attr(0644,root,root) %{_mandir}/man1/mk-ca-bundle.1
109%{_libdir}/libcurl.a
110%if %{SSL} == 1
111%{_datadir}/curl/curl-ca-bundle.crt
112%endif
113%doc CHANGES COPYING README RELEASE-NOTES
114%doc docs/BUGS docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/HISTORY
115%doc docs/INSTALL docs/KNOWN_BUGS
116%doc docs/MANUAL docs/RESOURCES docs/THANKS docs/VERSIONS docs/TODO
117%doc docs/TheArtOfHttpScripting
118%if %{SSL} == 1
119%doc docs/SSLCERTS
120%endif
121/usr/bin/curl
122/usr/lib/libcurl.a
123
124%files devel
125%defattr(-,root,root)
126%attr(0755,root,root) %{_bindir}/curl-config
127%attr(0644,root,root) %{_mandir}/man1/curl-config.1*
128%attr(0644,root,root) %{_mandir}/man1/mk-ca-bundle.1
129%attr(0644,root,root) %{_mandir}/man3/*
130%attr(0644,root,root) %{_includedir}/curl/*
131%{_libdir}/libcurl.la
132%doc docs/BINDINGS docs/INTERNALS docs/LICENSE-MIXING
133/usr/bin/curl-config
134/usr/include/curl
135