Blame SPECS/libssh2.spec

9bf74a
# Fedora 10 onwards support noarch subpackages; by using one, we can
9bf74a
# put the arch-independent docs in a common subpackage and save lots
9bf74a
# of space on the mirrors
9bf74a
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
9bf74a
%global noarch_docs_package 1
9bf74a
%else
9bf74a
%global noarch_docs_package 0
9bf74a
%endif
9bf74a
9bf74a
# Define %%{__isa_bits} for old releases
9bf74a
%{!?__isa_bits: %global __isa_bits %((echo '#include <bits/wordsize.h>'; echo __WORDSIZE) | cpp - | grep -Ex '32|64')}
9bf74a
9bf74a
Name:		libssh2
9bf74a
Version:	1.4.3
c424d3
Release:	8%{?dist}
9bf74a
Summary:	A library implementing the SSH2 protocol
9bf74a
Group:		System Environment/Libraries
9bf74a
License:	BSD
9bf74a
URL:		http://www.libssh2.org/
9bf74a
Source0:	http://libssh2.org/download/libssh2-%{version}.tar.gz
9bf74a
Patch0:		libssh2-1.4.2-utf8.patch
9bf74a
Patch1:		0001-sftp-seek-Don-t-flush-buffers-on-same-offset.patch
9bf74a
Patch2:		0002-sftp-statvfs-Along-error-path-reset-the-correct-stat.patch
9bf74a
Patch3:		0003-sftp-Add-support-for-fsync-OpenSSH-extension.patch
9bf74a
Patch4:		0004-partially-revert-window_size-explicit-adjustments-on.patch
9bf74a
Patch5:		0005-channel.c-fix-a-use-after-free.patch
9bf74a
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
9bf74a
BuildRequires:	openssl-devel
9bf74a
BuildRequires:	zlib-devel
9bf74a
BuildRequires:	/usr/bin/man
9bf74a
9bf74a
# Test suite requirements - we run the OpenSSH server and try to connect to it
9bf74a
BuildRequires:	openssh-server
9bf74a
# We use matchpathcon to get the correct SELinux context for the ssh server
9bf74a
# initialization script so that it can transition correctly in an SELinux
9bf74a
# environment; matchpathcon is only available from FC-4 and moved from the
9bf74a
# libselinux to libselinux-utils package in F-10
9bf74a
%if (0%{?fedora} >= 4 || 0%{?rhel} >= 5) && !(0%{?fedora} >=17 || 0%{?rhel} >=7)
9bf74a
BuildRequires:	/usr/sbin/matchpathcon selinux-policy-targeted
9bf74a
%endif
9bf74a
9bf74a
%description
9bf74a
libssh2 is a library implementing the SSH2 protocol as defined by
9bf74a
Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25),
9bf74a
SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*,
9bf74a
SECSH-DHGEX(04), and SECSH-NUMBERS(10).
9bf74a
9bf74a
%package	devel
9bf74a
Summary:	Development files for libssh2
9bf74a
Group:		Development/Libraries
9bf74a
Requires:	%{name} = %{version}-%{release}
9bf74a
Requires:	pkgconfig
9bf74a
9bf74a
%description	devel
9bf74a
The libssh2-devel package contains libraries and header files for
9bf74a
developing applications that use libssh2.
9bf74a
9bf74a
%package	docs
9bf74a
Summary:	Documentation for libssh2
9bf74a
Group:		Development/Libraries
9bf74a
Requires:	%{name} = %{version}-%{release}
9bf74a
%if %{noarch_docs_package}
9bf74a
BuildArch:	noarch
9bf74a
%endif
9bf74a
9bf74a
%description	docs
9bf74a
The libssh2-docs package contains man pages and examples for
9bf74a
developing applications that use libssh2.
9bf74a
9bf74a
%prep
9bf74a
%setup -q
9bf74a
9bf74a
# Replace hard wired port number in the test suite to avoid collisions
9bf74a
# between 32-bit and 64-bit builds running on a single build-host
9bf74a
sed -i s/4711/47%{?__isa_bits}/ tests/ssh2.{c,sh}
9bf74a
9bf74a
# Make sure things are UTF-8...
9bf74a
%patch0 -p1
9bf74a
9bf74a
# Three upstream patches required for qemu ssh block driver.
9bf74a
%patch1 -p1
9bf74a
%patch2 -p1
9bf74a
%patch3 -p1
9bf74a
9bf74a
# http://thread.gmane.org/gmane.network.ssh.libssh2.devel/6428
9bf74a
%patch4 -p1
9bf74a
9bf74a
# https://trac.libssh2.org/ticket/268
9bf74a
%patch5 -p1
9bf74a
9bf74a
# Make sshd transition appropriately if building in an SELinux environment
9bf74a
%if !(0%{?fedora} >= 17 || 0%{?rhel} >= 7)
9bf74a
chcon $(/usr/sbin/matchpathcon -n /etc/rc.d/init.d/sshd) tests/ssh2.sh || :
9bf74a
chcon -R $(/usr/sbin/matchpathcon -n /etc) tests/etc || :
9bf74a
chcon $(/usr/sbin/matchpathcon -n /etc/ssh/ssh_host_key) tests/etc/{host,user} || :
9bf74a
%endif
9bf74a
9bf74a
%build
9bf74a
%configure --disable-static --enable-shared
9bf74a
make %{?_smp_mflags}
9bf74a
9bf74a
# Avoid polluting libssh2.pc with linker options (#947813)
9bf74a
sed -i -e 's|[[:space:]]-Wl,[^[:space:]]*||' libssh2.pc
9bf74a
9bf74a
%install
9bf74a
rm -rf %{buildroot}
9bf74a
make install DESTDIR=%{buildroot} INSTALL="install -p"
9bf74a
find %{buildroot} -name '*.la' -exec rm -f {} \;
9bf74a
9bf74a
# clean things up a bit for packaging
9bf74a
make -C example clean
9bf74a
rm -rf example/.deps
9bf74a
find example/ -type f '(' -name '*.am' -o -name '*.in' ')' -exec rm -v {} \;
9bf74a
9bf74a
# avoid multilib conflict on libssh2-devel
9bf74a
mv -v example example.%{_arch}
9bf74a
9bf74a
%check
9bf74a
# The SSH test will fail if we don't have /dev/tty, as is the case in some
9bf74a
# versions of mock (#672713)
9bf74a
if [ ! -c /dev/tty ]; then
9bf74a
	echo Skipping SSH test due to missing /dev/tty
9bf74a
	echo "exit 0" > tests/ssh2.sh
9bf74a
fi
9bf74a
# Apparently it fails in the sparc and arm buildsystems too
9bf74a
%ifarch %{sparc} %{arm}
9bf74a
echo Skipping SSH test on sparc/arm
9bf74a
echo "exit 0" > tests/ssh2.sh
9bf74a
%endif
9bf74a
make -C tests check
9bf74a
9bf74a
%clean
9bf74a
rm -rf %{buildroot}
9bf74a
9bf74a
%post -p /sbin/ldconfig
9bf74a
9bf74a
%postun -p /sbin/ldconfig
9bf74a
9bf74a
%files
9bf74a
%doc AUTHORS ChangeLog COPYING README NEWS
9bf74a
%{_libdir}/libssh2.so.1
9bf74a
%{_libdir}/libssh2.so.1.*
9bf74a
9bf74a
%files docs
9bf74a
%doc HACKING
9bf74a
%{_mandir}/man3/libssh2_*.3*
9bf74a
9bf74a
%files devel
9bf74a
%doc example.%{_arch}/
9bf74a
%{_includedir}/libssh2.h
9bf74a
%{_includedir}/libssh2_publickey.h
9bf74a
%{_includedir}/libssh2_sftp.h
9bf74a
%{_libdir}/libssh2.so
9bf74a
%{_libdir}/pkgconfig/libssh2.pc
9bf74a
9bf74a
%changelog
c424d3
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.4.3-8
c424d3
- Mass rebuild 2014-01-24
c424d3
c424d3
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.4.3-7
c424d3
- Mass rebuild 2013-12-27
c424d3
9bf74a
* Wed Aug 14 2013 Kamil Dudka <kdudka@redhat.com> 1.4.3-6
9bf74a
- fix very slow sftp upload to localhost
9bf74a
- fix a use after free in channel.c
9bf74a
9bf74a
* Tue Apr  9 2013 Richard W.M. Jones <rjones@redhat.com> 1.4.3-5
9bf74a
- Add three patches from upstream git required for qemu ssh block driver.
9bf74a
9bf74a
* Wed Apr  3 2013 Paul Howarth <paul@city-fan.org> 1.4.3-4
9bf74a
- Avoid polluting libssh2.pc with linker options (#947813)
9bf74a
9bf74a
* Tue Mar 26 2013 Kamil Dudka <kdudka@redhat.com> 1.4.3-3
9bf74a
- Avoid collisions between 32-bit and 64-bit builds running on a single build
9bf74a
  host
9bf74a
9bf74a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-2
9bf74a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9bf74a
9bf74a
* Wed Nov 28 2012 Paul Howarth <paul@city-fan.org> 1.4.3-1
9bf74a
- Update to 1.4.3
9bf74a
  - compression: add support for zlib@openssh.com
9bf74a
  - sftp_read: return error if a too large package arrives
9bf74a
  - libssh2_hostkey_hash.3: update the description of return value
9bf74a
  - Fixed MSVC NMakefile
9bf74a
  - examples: use stderr for messages, stdout for data
9bf74a
  - openssl: do not leak memory when handling errors
9bf74a
  - improved handling of disabled MD5 algorithm in OpenSSL
9bf74a
  - known_hosts: Fail when parsing unknown keys in known_hosts file
9bf74a
  - configure: gcrypt doesn't come with pkg-config support
9bf74a
  - session_free: wrong variable used for keeping state
9bf74a
  - libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL
9bf74a
  - comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating
9bf74a
- Drop upstreamed patches
9bf74a
9bf74a
* Wed Nov 07 2012 Kamil Dudka <kdudka@redhat.com> 1.4.2-4
9bf74a
- examples: use stderr for messages, stdout for data (upstream commit b31e35ab)
9bf74a
- Update libssh2_hostkey_hash(3) man page (upstream commit fe8f3deb)
9bf74a
9bf74a
* Wed Sep 26 2012 Kamil Dudka <kdudka@redhat.com> 1.4.2-3
9bf74a
- Fix basic functionality of libssh2 in FIPS mode
9bf74a
- Skip SELinux-related quirks on recent distros to prevent a test-suite failure
9bf74a
9bf74a
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.2-2
9bf74a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9bf74a
9bf74a
* Sun May 20 2012 Paul Howarth <paul@city-fan.org> 1.4.2-1
9bf74a
- Update to 1.4.2
9bf74a
  - Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
9bf74a
  - userauth.c: fread() from public key file to correctly detect any errors
9bf74a
  - configure.ac: add option to disable build of the example applications
9bf74a
  - added 'Requires.private:' line to libssh2.pc
9bf74a
  - SFTP: filter off incoming "zombie" responses
9bf74a
  - gettimeofday: no need for a replacement under cygwin
9bf74a
  - SSH_MSG_CHANNEL_REQUEST: default to want_reply
9bf74a
  - win32/libssh2_config.h: remove hardcoded #define LIBSSH2_HAVE_ZLIB
9bf74a
9bf74a
* Fri Apr 27 2012 Paul Howarth <paul@city-fan.org> 1.4.1-2
9bf74a
- Fix multi-arch conflict again (#816969)
9bf74a
9bf74a
* Thu Apr  5 2012 Paul Howarth <paul@city-fan.org> 1.4.1-1
9bf74a
- Update to 1.4.1
9bf74a
  - Build error with gcrypt backend
9bf74a
  - Always do "forced" window updates to avoid corner case stalls
9bf74a
  - aes: the init function fails when OpenSSL has AES support
9bf74a
  - transport_send: finish in-progress key exchange before sending data
9bf74a
  - channel_write: acknowledge transport errors
9bf74a
  - examples/x11.c: make sure sizeof passed to read operation is correct
9bf74a
  - examples/x11.c: fix suspicious sizeof usage
9bf74a
  - sftp_packet_add: verify the packet before accepting it
9bf74a
  - SFTP: preserve the original error code more
9bf74a
  - sftp_packet_read: adjust window size as necessary
9bf74a
  - Use safer snprintf rather then sprintf in several places
9bf74a
  - Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET
9bf74a
  - sftp_write: cannot return acked data *and* EAGAIN
9bf74a
  - sftp_read: avoid data *and* EAGAIN
9bf74a
  - libssh2.h: add missing prototype for libssh2_session_banner_set()
9bf74a
- Drop upstream patches now included in release tarball
9bf74a
9bf74a
* Mon Mar 19 2012 Kamil Dudka <kdudka@redhat.com> 1.4.0-4
9bf74a
- Don't ignore transport errors when writing to channel (#804150)
9bf74a
9bf74a
* Sun Mar 18 2012 Paul Howarth <paul@city-fan.org> 1.4.0-3
9bf74a
- Don't try to use openssl's AES-CTR functions
9bf74a
  (http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml)
9bf74a
9bf74a
* Fri Mar 16 2012 Paul Howarth <paul@city-fan.org> 1.4.0-2
9bf74a
- fix libssh2 failing key re-exchange when write channel is saturated (#804156)
9bf74a
- drop %%defattr, redundant since rpm 4.4
9bf74a
9bf74a
* Wed Feb  1 2012 Paul Howarth <paul@city-fan.org> 1.4.0-1
9bf74a
- update to 1.4.0
9bf74a
  - added libssh2_session_supported_algs()
9bf74a
  - added libssh2_session_banner_get()
9bf74a
  - added libssh2_sftp_get_channel()
9bf74a
  - libssh2.h: bump the default window size to 256K
9bf74a
  - sftp-seek: clear EOF flag
9bf74a
  - userauth: provide more informations if ssh pub key extraction fails
9bf74a
  - ssh2_exec: skip error outputs for EAGAIN
9bf74a
  - LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000
9bf74a
  - knownhost_check(): don't dereference ext if NULL is passed
9bf74a
  - knownhost_add: avoid dereferencing uninitialized memory on error path
9bf74a
  - OpenSSL EVP: fix threaded use of structs
9bf74a
  - _libssh2_channel_read: react on errors from receive_window_adjust
9bf74a
  - sftp_read: cap the read ahead maximum amount
9bf74a
  - _libssh2_channel_read: fix non-blocking window adjusting 
9bf74a
- add upstream patch fixing undefined function reference in libgcrypt backend
9bf74a
- BR: /usr/bin/man for test suite
9bf74a
9bf74a
* Sun Jan 15 2012 Peter Robinson <pbrobinson@fedoraproject.org> 1.3.0-4
9bf74a
- skip the ssh test on ARM too
9bf74a
9bf74a
* Fri Jan 13 2012 Paul Howarth <paul@city-fan.org> 1.3.0-3
9bf74a
- make docs package noarch where possible
9bf74a
- example includes arch-specific bits, so move to devel package
9bf74a
- use patch rather than scripted iconv to fix character encoding
9bf74a
- don't make assumptions about SELinux context types used for the ssh server
9bf74a
  in the test suite
9bf74a
- skip the ssh test if /dev/tty isn't present, as in some versions of mock
9bf74a
- make the %%files list more explicit
9bf74a
- use tabs for indentation
9bf74a
9bf74a
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 1.3.0-2
9bf74a
- rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
9bf74a
9bf74a
* Thu Sep 08 2011 Kamil Dudka <kdudka@redhat.com> 1.3.0-1
9bf74a
- update to 1.3.0
9bf74a
9bf74a
* Sat Jun 25 2011 Dennis Gilmore <dennis@ausil.us> 1.2.7-2
9bf74a
- sshd/loopback test fails in the sparc buildsystem
9bf74a
9bf74a
* Tue Oct 12 2010 Kamil Dudka <kdudka@redhat.com> 1.2.7-1
9bf74a
- update to 1.2.7 (#632916)
9bf74a
- avoid multilib conflict on libssh2-docs
9bf74a
- avoid build failure in mock with SELinux in the enforcing mode (#558964)
9bf74a
9bf74a
* Fri Mar 12 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.4-1
9bf74a
- update to 1.2.4
9bf74a
- drop old patch0
9bf74a
- be more aggressive about keeping .deps from intruding into -docs
9bf74a
9bf74a
* Wed Jan 20 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-5
9bf74a
- pkgconfig dep should be with -devel, not -docs
9bf74a
9bf74a
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-4
9bf74a
- enable tests; conditionalize sshd test, which fails with a funky SElinux
9bf74a
  error when run locally
9bf74a
9bf74a
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-3
9bf74a
- patch w/1aba38cd7d2658146675ce1737e5090f879f306; not yet in a GA release
9bf74a
9bf74a
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-2
9bf74a
- correct bad file entry under -devel
9bf74a
9bf74a
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-1
9bf74a
- update to 1.2.2
9bf74a
- drop old patch now in upstream
9bf74a
- add new pkgconfig file to -devel
9bf74a
9bf74a
* Mon Sep 21 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-2
9bf74a
- patch based on 683aa0f6b52fb1014873c961709102b5006372fc
9bf74a
- disable tests (*sigh*)
9bf74a
9bf74a
* Tue Aug 25 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-1
9bf74a
- update to 1.2
9bf74a
9bf74a
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.0-4
9bf74a
- rebuilt with new openssl
9bf74a
9bf74a
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
9bf74a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
9bf74a
9bf74a
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
9bf74a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
9bf74a
9bf74a
* Mon Feb 16 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.0-1
9bf74a
- update to 1.0
9bf74a
9bf74a
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.18-8
9bf74a
- rebuild with new openssl
9bf74a
9bf74a
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.18-7
9bf74a
- Autorebuild for GCC 4.3
9bf74a
9bf74a
* Wed Dec 05 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-6
9bf74a
- rebuild for new openssl...
9bf74a
9bf74a
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-5
9bf74a
- bump
9bf74a
9bf74a
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-4
9bf74a
- add INSTALL arg to make install vs env. var
9bf74a
9bf74a
* Mon Nov 26 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-3
9bf74a
- run tests; don't package test
9bf74a
9bf74a
* Sun Nov 18 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-2
9bf74a
- split docs into -docs (they seemed... large.)
9bf74a
9bf74a
* Tue Nov 13 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-1
9bf74a
- update to 0.18
9bf74a
9bf74a
* Sun Oct 14 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.17-1
9bf74a
- update to 0.17
9bf74a
- many spec file changes
9bf74a
9bf74a
* Wed May 23 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.2.20070506
9bf74a
- Fix release tag
9bf74a
- Move manpages to -devel package
9bf74a
- Add Examples dir to -devel package
9bf74a
9bf74a
* Sun May 06 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.20070506.1
9bf74a
- Initial build