Last active
August 3, 2016 05:57
-
-
Save oswalpalash/02e1d015a23af5216cb75c1be5dbc7ae to your computer and use it in GitHub Desktop.
Generate curl rpm with OpenSSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[palash@localhost SPECS]$ cat curl.spec | |
%define name owncurl | |
%define tarball curl | |
%define version 7.50.0 | |
%define release 1 | |
%define curlroot %{_builddir}/%{tarball}-%{version} | |
%define curlprefix /opt/owncurl | |
Summary: get a file from an FTP or HTTP server. | |
Name: %{name} | |
Version: %{version} | |
License: MIT | |
Release: %{release} | |
Vendor: Daniel Stenberg <Daniel.Stenberg@haxx.se> | |
Packager: Troy Engel <tengel@sonic.net> | |
Group: Utilities/Console | |
Source: %{tarball}-%{version}.tar.gz | |
URL: http://curl.haxx.se/ | |
BuildRoot: %{_tmppath}/%{tarball}-%{version}-root | |
Requires: libssh2 | |
AutoReqProv: no | |
%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 devel | |
Summary: The includes, libs, and man pages to develop with libcurl | |
Group: Development/Libraries | |
Provides: curl-devel | |
AutoReqProv: no | |
%description 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 -n %{tarball}-%{version} | |
%build | |
cd %{curlroot} && (if [ -f configure.in ]; then mv -f configure.in configure.in.rpm; fi) | |
%define CONFIG_FLAGS --prefix=%{curlprefix} --with-ssl=/opt/alt-openssl/ --enable-http --enable-ftp | |
%define LDFLAGS -L/opt/alt-openssl/lib | |
%define CPP_FLAGS -I/opt/alt-openssl/include | |
%define SSL_LDFLAGS -L/opt/alt-openssl/lib | |
%define SSL_CPPFLAGS -I/opt/alt-openssl/include | |
./configure %{CONFIG_FLAGS} | |
cd %{curlroot} && (if [ -f configure.in.rpm ]; then mv -f configure.in.rpm configure.in; fi) | |
make | |
%install | |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} | |
make DESTDIR=%{buildroot} install-strip | |
%clean | |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} | |
[ "%{curlroot}" != "/" ] && rm -rf %{curlroot} | |
%post | |
/sbin/ldconfig | |
%postun | |
/sbin/ldconfig | |
%files | |
%defattr(-,root,root) | |
%attr(0755,root,root) %{curlprefix}/bin/curl | |
%attr(0644,root,root) %{curlprefix}/share/man/man1/curl.1* | |
%{curlprefix}/lib/libcurl.so* | |
%{curlprefix}/lib/pkgconfig/libcurl.pc* | |
%{curlprefix}/lib/libcurl.so* | |
%{curlprefix}/share/aclocal/libcurl.m4 | |
#%{_datadir}/curl/curl-ca-bundle.crt | |
%doc CHANGES COPYING README docs/BUGS docs/SSLCERTS | |
%doc docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/HISTORY docs/INSTALL | |
%doc docs/KNOWN_BUGS docs/MANUAL docs/RESOURCES docs/THANKS | |
%doc docs/TODO docs/VERSIONS docs/TheArtOfHttpScripting tests | |
%files devel | |
%defattr(-,root,root) | |
%attr(0755,root,root) %{curlprefix}/bin/curl-config | |
%attr(0644,root,root) %{curlprefix}/share/man/man1/curl-config.1* | |
%attr(0644,root,root) %{curlprefix}/share/man/man3/* | |
%attr(0644,root,root) %{curlprefix}/include/curl/* | |
%{curlprefix}/lib/libcurl.a | |
%{curlprefix}/lib/libcurl.la | |
%doc docs/BINDINGS docs/INTERNALS docs/examples/* | |
[palash@localhost ~]$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment