edbbfd7
# Fedora 10 onwards support noarch subpackages; by using one, we can
edbbfd7
# put the arch-independent docs in a common subpackage and save lots
edbbfd7
# of space on the mirrors
edbbfd7
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
edbbfd7
%global noarch_docs_package 1
edbbfd7
%else
edbbfd7
%global noarch_docs_package 0
edbbfd7
%endif
edbbfd7
2981c21
Name:		libssh2
8e792e7
Version:	1.4.2
8576e20
Release:	3%{?dist}
2981c21
Summary:	A library implementing the SSH2 protocol
2981c21
Group:		System Environment/Libraries
2981c21
License:	BSD
2981c21
URL:		http://www.libssh2.org/
2981c21
Source0:	http://libssh2.org/download/libssh2-%{version}.tar.gz
2981c21
Patch0:		libssh2-1.2.9-utf8.patch
8576e20
Patch1:		libssh2-1.4.2-fips.patch
2981c21
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
2981c21
BuildRequires:	openssl-devel
2981c21
BuildRequires:	zlib-devel
d2c802f
BuildRequires:	/usr/bin/man
Chris Weyl 579bb92
edbbfd7
# Test suite requirements - we run the OpenSSH server and try to connect to it
2981c21
BuildRequires:	openssh-server
edbbfd7
# We use matchpathcon to get the correct SELinux context for the ssh server
edbbfd7
# initialization script so that it can transition correctly in an SELinux
edbbfd7
# environment; matchpathcon is only available from FC-4 and moved from the
edbbfd7
# libselinux to libselinux-utils package in F-10
edbbfd7
%if 0%{?fedora} >= 4 || 0%{?rhel} >= 5
2981c21
BuildRequires:	/usr/sbin/matchpathcon selinux-policy-targeted
edbbfd7
%endif
Chris Weyl ce5ce38
Chris Weyl 579bb92
%description
Chris Weyl 579bb92
libssh2 is a library implementing the SSH2 protocol as defined by
Chris Weyl 579bb92
Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25),
Chris Weyl 579bb92
SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*,
Chris Weyl 579bb92
SECSH-DHGEX(04), and SECSH-NUMBERS(10).
Chris Weyl 579bb92
2981c21
%package	devel
2981c21
Summary:	Development files for libssh2
2981c21
Group:		Development/Libraries
2981c21
Requires:	%{name} = %{version}-%{release}
2981c21
Requires:	pkgconfig
Chris Weyl 579bb92
2981c21
%description	devel
edbbfd7
The libssh2-devel package contains libraries and header files for
edbbfd7
developing applications that use libssh2.
Chris Weyl 579bb92
2981c21
%package	docs
2981c21
Summary:	Documentation for libssh2
2981c21
Group:		Development/Libraries
2981c21
Requires:	%{name} = %{version}-%{release}
edbbfd7
%if %{noarch_docs_package}
2981c21
BuildArch:	noarch
edbbfd7
%endif
Chris Weyl 579bb92
2981c21
%description	docs
edbbfd7
The libssh2-docs package contains man pages and examples for
edbbfd7
developing applications that use libssh2.
Chris Weyl 579bb92
Chris Weyl 579bb92
%prep
Chris Weyl 579bb92
%setup -q
Chris Weyl 579bb92
edbbfd7
# Make sure things are UTF-8...
edbbfd7
%patch0 -p1
Chris Weyl 579bb92
8576e20
# Make sure libssh2 works in FIPS mode...
8576e20
%patch1 -p1
8576e20
edbbfd7
# Make sshd transition appropriately if building in an SELinux environment
edbbfd7
chcon $(/usr/sbin/matchpathcon -n /etc/rc.d/init.d/sshd) tests/ssh2.sh || :
edbbfd7
chcon -R $(/usr/sbin/matchpathcon -n /etc) tests/etc || :
edbbfd7
chcon $(/usr/sbin/matchpathcon -n /etc/ssh/ssh_host_key) tests/etc/{host,user} || :
9936af4
Chris Weyl 579bb92
%build
Chris Weyl 579bb92
%configure --disable-static --enable-shared
Chris Weyl 579bb92
make %{?_smp_mflags}
Chris Weyl 579bb92
Chris Weyl 579bb92
%install
Chris Weyl 579bb92
rm -rf %{buildroot}
Chris Weyl 579bb92
make install DESTDIR=%{buildroot} INSTALL="install -p"
edbbfd7
find %{buildroot} -name '*.la' -exec rm -f {} \;
Chris Weyl 579bb92
Chris Weyl 579bb92
# clean things up a bit for packaging
edbbfd7
make -C example clean
edbbfd7
rm -rf example/.deps
edbbfd7
find example/ -type f '(' -name '*.am' -o -name '*.in' ')' -exec rm -v {} \;
Chris Weyl 579bb92
980b476
# avoid multilib conflict on libssh2-devel
a352ea2
mv -v example example.%{_arch}
9936af4
Chris Weyl 579bb92
%check
edbbfd7
# The SSH test will fail if we don't have /dev/tty, as is the case in some
edbbfd7
# versions of mock (#672713)
edbbfd7
if [ ! -c /dev/tty ]; then
2981c21
	echo Skipping SSH test due to missing /dev/tty
2981c21
	echo "exit 0" > tests/ssh2.sh
edbbfd7
fi
4256e1a
# Apparently it fails in the sparc and arm buildsystems too
d70bd6d
%ifarch %{sparc} %{arm}
4256e1a
echo Skipping SSH test on sparc/arm
d8deb37
echo "exit 0" > tests/ssh2.sh
d8deb37
%endif
edbbfd7
make -C tests check
Chris Weyl 579bb92
Chris Weyl 579bb92
%clean
Chris Weyl 579bb92
rm -rf %{buildroot}
Chris Weyl 579bb92
Chris Weyl 579bb92
%post -p /sbin/ldconfig
Chris Weyl 579bb92
Chris Weyl 579bb92
%postun -p /sbin/ldconfig
Chris Weyl 579bb92
Chris Weyl 579bb92
%files
Chris Weyl 579bb92
%doc AUTHORS ChangeLog COPYING README NEWS
edbbfd7
%{_libdir}/libssh2.so.1
edbbfd7
%{_libdir}/libssh2.so.1.*
Chris Weyl 579bb92
Chris Weyl 579bb92
%files docs
980b476
%doc HACKING
edbbfd7
%{_mandir}/man3/libssh2_*.3*
Chris Weyl 579bb92
Chris Weyl 579bb92
%files devel
a352ea2
%doc example.%{_arch}/
edbbfd7
%{_includedir}/libssh2.h
edbbfd7
%{_includedir}/libssh2_publickey.h
edbbfd7
%{_includedir}/libssh2_sftp.h
edbbfd7
%{_libdir}/libssh2.so
edbbfd7
%{_libdir}/pkgconfig/libssh2.pc
Chris Weyl 579bb92
Chris Weyl 579bb92
%changelog
8576e20
* Wed Sep 26 2012 Kamil Dudka <kdudka@redhat.com> 1.4.2-3
8576e20
- fix basic functionality of libssh2 in FIPS mode
8576e20
b1dbb78
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.2-2
b1dbb78
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b1dbb78
8e792e7
* Sun May 20 2012 Paul Howarth <paul@city-fan.org> 1.4.2-1
8e792e7
- Update to 1.4.2
8e792e7
  - Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
8e792e7
  - userauth.c: fread() from public key file to correctly detect any errors
8e792e7
  - configure.ac: add option to disable build of the example applications
8e792e7
  - added 'Requires.private:' line to libssh2.pc
8e792e7
  - SFTP: filter off incoming "zombie" responses
8e792e7
  - gettimeofday: no need for a replacement under cygwin
8e792e7
  - SSH_MSG_CHANNEL_REQUEST: default to want_reply
8e792e7
  - win32/libssh2_config.h: remove hardcoded #define LIBSSH2_HAVE_ZLIB
8e792e7
a352ea2
* Fri Apr 27 2012 Paul Howarth <paul@city-fan.org> 1.4.1-2
a352ea2
- Fix multi-arch conflict again (#816969)
a352ea2
e3d0f1a
* Thu Apr  5 2012 Paul Howarth <paul@city-fan.org> 1.4.1-1
e3d0f1a
- Update to 1.4.1
e3d0f1a
  - Build error with gcrypt backend
e3d0f1a
  - Always do "forced" window updates to avoid corner case stalls
e3d0f1a
  - aes: the init function fails when OpenSSL has AES support
e3d0f1a
  - transport_send: finish in-progress key exchange before sending data
e3d0f1a
  - channel_write: acknowledge transport errors
e3d0f1a
  - examples/x11.c: make sure sizeof passed to read operation is correct
e3d0f1a
  - examples/x11.c: fix suspicious sizeof usage
e3d0f1a
  - sftp_packet_add: verify the packet before accepting it
e3d0f1a
  - SFTP: preserve the original error code more
e3d0f1a
  - sftp_packet_read: adjust window size as necessary
e3d0f1a
  - Use safer snprintf rather then sprintf in several places
e3d0f1a
  - Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET
e3d0f1a
  - sftp_write: cannot return acked data *and* EAGAIN
e3d0f1a
  - sftp_read: avoid data *and* EAGAIN
e3d0f1a
  - libssh2.h: add missing prototype for libssh2_session_banner_set()
e3d0f1a
- Drop upstream patches now included in release tarball
e3d0f1a
8e8214a
* Mon Mar 19 2012 Kamil Dudka <kdudka@redhat.com> 1.4.0-4
8e8214a
- Don't ignore transport errors when writing to channel (#804150)
8e8214a
1d6da84
* Sun Mar 18 2012 Paul Howarth <paul@city-fan.org> 1.4.0-3
1d6da84
- Don't try to use openssl's AES-CTR functions
1d6da84
  (http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml)
1d6da84
12e9f5a
* Fri Mar 16 2012 Paul Howarth <paul@city-fan.org> 1.4.0-2
12e9f5a
- fix libssh2 failing key re-exchange when write channel is saturated (#804156)
12e9f5a
- drop %%defattr, redundant since rpm 4.4
12e9f5a
d2c802f
* Wed Feb  1 2012 Paul Howarth <paul@city-fan.org> 1.4.0-1
d2c802f
- update to 1.4.0
d2c802f
  - added libssh2_session_supported_algs()
d2c802f
  - added libssh2_session_banner_get()
d2c802f
  - added libssh2_sftp_get_channel()
d2c802f
  - libssh2.h: bump the default window size to 256K
d2c802f
  - sftp-seek: clear EOF flag
d2c802f
  - userauth: provide more informations if ssh pub key extraction fails
d2c802f
  - ssh2_exec: skip error outputs for EAGAIN
d2c802f
  - LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000
d2c802f
  - knownhost_check(): don't dereference ext if NULL is passed
d2c802f
  - knownhost_add: avoid dereferencing uninitialized memory on error path
d2c802f
  - OpenSSL EVP: fix threaded use of structs
d2c802f
  - _libssh2_channel_read: react on errors from receive_window_adjust
d2c802f
  - sftp_read: cap the read ahead maximum amount
d2c802f
  - _libssh2_channel_read: fix non-blocking window adjusting 
d2c802f
- add upstream patch fixing undefined function reference in libgcrypt backend
d2c802f
- BR: /usr/bin/man for test suite
d2c802f
d70bd6d
* Sun Jan 15 2012 Peter Robinson <pbrobinson@fedoraproject.org> 1.3.0-4
4256e1a
- skip the ssh test on ARM too
d70bd6d
edbbfd7
* Fri Jan 13 2012 Paul Howarth <paul@city-fan.org> 1.3.0-3
edbbfd7
- make docs package noarch where possible
980b476
- example includes arch-specific bits, so move to devel package
edbbfd7
- use patch rather than scripted iconv to fix character encoding
edbbfd7
- don't make assumptions about SELinux context types used for the ssh server
edbbfd7
  in the test suite
edbbfd7
- skip the ssh test if /dev/tty isn't present, as in some versions of mock
edbbfd7
- make the %%files list more explicit
2981c21
- use tabs for indentation
edbbfd7
edbbfd7
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 1.3.0-2
edbbfd7
- rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
b46de2a
13e3a89
* Thu Sep 08 2011 Kamil Dudka <kdudka@redhat.com> 1.3.0-1
13e3a89
- update to 1.3.0
13e3a89
edbbfd7
* Sat Jun 25 2011 Dennis Gilmore <dennis@ausil.us> 1.2.7-2
d8deb37
- sshd/loopback test fails in the sparc buildsystem
d8deb37
9936af4
* Tue Oct 12 2010 Kamil Dudka <kdudka@redhat.com> 1.2.7-1
9936af4
- update to 1.2.7 (#632916)
9936af4
- avoid multilib conflict on libssh2-docs
9936af4
- avoid build failure in mock with SELinux in the enforcing mode (#558964)
9936af4
Chris Weyl 92c18b1
* Fri Mar 12 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.4-1
Chris Weyl 92c18b1
- update to 1.2.4
Chris Weyl 92c18b1
- drop old patch0
Chris Weyl 92c18b1
- be more aggressive about keeping .deps from intruding into -docs
Chris Weyl 92c18b1
Chris Weyl e9dc94c
* Wed Jan 20 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-5
Chris Weyl e9dc94c
- pkgconfig dep should be with -devel, not -docs
Chris Weyl e9dc94c
Chris Weyl ce5ce38
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-4
Chris Weyl ce5ce38
- enable tests; conditionalize sshd test, which fails with a funky SElinux
Chris Weyl ce5ce38
  error when run locally
Chris Weyl ce5ce38
Chris Weyl 8d25ddb
* Mon Jan 18 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-3
Chris Weyl 8d25ddb
- patch w/1aba38cd7d2658146675ce1737e5090f879f306; not yet in a GA release
Chris Weyl 8d25ddb
Chris Weyl 4358534
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-2
Chris Weyl 4358534
- correct bad file entry under -devel
Chris Weyl 4358534
Chris Weyl 3265846
* Thu Jan 14 2010 Chris Weyl <cweyl@alumni.drew.edu> 1.2.2-1
Chris Weyl 3265846
- update to 1.2.2
Chris Weyl 3265846
- drop old patch now in upstream
Chris Weyl 3265846
- add new pkgconfig file to -devel
Chris Weyl 3265846
Chris Weyl 6b0d8a1
* Mon Sep 21 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-2
Chris Weyl 6b0d8a1
- patch based on 683aa0f6b52fb1014873c961709102b5006372fc
Chris Weyl 6b0d8a1
- disable tests (*sigh*)
Chris Weyl 6b0d8a1
Chris Weyl 6b0d8a1
* Tue Aug 25 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.2-1
Chris Weyl 6b0d8a1
- update to 1.2
Chris Weyl 6b0d8a1
8eb74aa
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.0-4
8eb74aa
- rebuilt with new openssl
8eb74aa
b0c3267
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
b0c3267
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
b0c3267
ea10ac3
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
ea10ac3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
ea10ac3
Chris Weyl 5f58f79
* Mon Feb 16 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.0-1
Chris Weyl 5f58f79
- update to 1.0
Chris Weyl 5f58f79
5bb5071
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.18-8
5bb5071
- rebuild with new openssl
5bb5071
2572431
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.18-7
2572431
- Autorebuild for GCC 4.3
2572431
Chris Weyl a74497a
* Wed Dec 05 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-6
Chris Weyl a74497a
- rebuild for new openssl...
Chris Weyl a74497a
Chris Weyl ca69061
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-5
Chris Weyl ca69061
- bump
Chris Weyl ca69061
Chris Weyl 579bb92
* Tue Nov 27 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-4
Chris Weyl 579bb92
- add INSTALL arg to make install vs env. var
Chris Weyl 579bb92
Chris Weyl 579bb92
* Mon Nov 26 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-3
Chris Weyl 579bb92
- run tests; don't package test
Chris Weyl 579bb92
Chris Weyl 579bb92
* Sun Nov 18 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-2
Chris Weyl 579bb92
- split docs into -docs (they seemed... large.)
Chris Weyl 579bb92
Chris Weyl 579bb92
* Tue Nov 13 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.18-1
Chris Weyl 579bb92
- update to 0.18
Chris Weyl 579bb92
Chris Weyl 579bb92
* Sun Oct 14 2007 Chris Weyl <cweyl@alumni.drew.edu> 0.17-1
Chris Weyl 579bb92
- update to 0.17
Chris Weyl 579bb92
- many spec file changes
Chris Weyl 579bb92
Chris Weyl 579bb92
* Wed May 23 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.2.20070506
Chris Weyl 579bb92
- Fix release tag
Chris Weyl 579bb92
- Move manpages to -devel package
Chris Weyl 579bb92
- Add Examples dir to -devel package
Chris Weyl 579bb92
Chris Weyl 579bb92
* Sun May 06 2007 Sindre Pedersen Bjørdal <foolish[AT]guezz.net> - 0.15-0.20070506.1
Chris Weyl 579bb92
- Initial build