Spec clean-up

- make docs package noarch where possible
- use patch rather than scripted iconv to fix character encoding
- don't make assumptions about SELinux context types used for the ssh server
  in the test suite
- skip the ssh test if /dev/tty isn't present, as in some versions of mock
- make the %files list more explicit
epel9
Paul Howarth 13 years ago
parent b46de2ab55
commit edbbfd779a

@ -0,0 +1,11 @@
--- libssh2/NEWS
+++ libssh2/NEWS
@@ -2507,7 +2507,7 @@
- support arcfour128 cipher per RFC 4345
Daniel Stenberg (21 Oct 2009)
-- [Cristian Rodríguez brought this change]
+- [Cristian Rodríguez brought this change]
add support for GCC visibility features

@ -1,19 +1,34 @@
# Fedora 10 onwards support noarch subpackages; by using one, we can
# put the arch-independent docs in a common subpackage and save lots
# of space on the mirrors
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
%global noarch_docs_package 1
%else
%global noarch_docs_package 0
%endif
Name: libssh2 Name: libssh2
Version: 1.3.0 Version: 1.3.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: A library implementing the SSH2 protocol Summary: A library implementing the SSH2 protocol
Group: System Environment/Libraries Group: System Environment/Libraries
License: BSD License: BSD
URL: http://www.libssh2.org URL: http://www.libssh2.org/
Source0: http://libssh2.org/download/libssh2-%{version}.tar.gz Source0: http://libssh2.org/download/libssh2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Patch0: libssh2-1.2.9-utf8.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
# tests # Test suite requirements - we run the OpenSSH server and try to connect to it
BuildRequires: openssh-server BuildRequires: openssh-server
# We use matchpathcon to get the correct SELinux context for the ssh server
# initialization script so that it can transition correctly in an SELinux
# environment; matchpathcon is only available from FC-4 and moved from the
# libselinux to libselinux-utils package in F-10
%if 0%{?fedora} >= 4 || 0%{?rhel} >= 5
BuildRequires: /usr/sbin/matchpathcon selinux-policy-targeted
%endif
%description %description
libssh2 is a library implementing the SSH2 protocol as defined by libssh2 is a library implementing the SSH2 protocol as defined by
@ -21,104 +36,112 @@ Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25),
SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*, SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*,
SECSH-DHGEX(04), and SECSH-NUMBERS(10). SECSH-DHGEX(04), and SECSH-NUMBERS(10).
%package devel %package devel
Summary: Development files for %{name} Summary: Development files for libssh2
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: pkgconfig Requires: pkgconfig
%description devel %description devel
The %{name}-devel package contains libraries and header files for The libssh2-devel package contains libraries and header files for
developing applications that use %{name}. developing applications that use libssh2.
%package docs %package docs
Summary: Documentation for %{name} Summary: Documentation for libssh2
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
%if %{noarch_docs_package}
BuildArch: noarch
%endif
%description docs %description docs
The %{name}-docs package contains man pages and examples for The libssh2-docs package contains man pages and examples for
developing applications that use %{name}. developing applications that use libssh2.
%prep %prep
%setup -q %setup -q
# make sure things are UTF-8... # Make sure things are UTF-8...
for i in ChangeLog NEWS ; do %patch0 -p1
iconv --from=ISO-8859-1 --to=UTF-8 $i > new
mv new $i
done
# make it possible to launch OpenSSH server for testing purposes # Make sshd transition appropriately if building in an SELinux environment
chcon -t initrc_exec_t tests/ssh2.sh || : chcon $(/usr/sbin/matchpathcon -n /etc/rc.d/init.d/sshd) tests/ssh2.sh || :
chcon -Rt etc_t tests/etc || : chcon -R $(/usr/sbin/matchpathcon -n /etc) tests/etc || :
chcon -t sshd_key_t tests/etc/{host,user} || : chcon $(/usr/sbin/matchpathcon -n /etc/ssh/ssh_host_key) tests/etc/{host,user} || :
%build %build
%configure --disable-static --enable-shared %configure --disable-static --enable-shared
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL="install -p" make install DESTDIR=%{buildroot} INSTALL="install -p"
find %{buildroot} -name '*.la' -exec rm -f {} + find %{buildroot} -name '*.la' -exec rm -f {} \;
# clean things up a bit for packaging # clean things up a bit for packaging
( cd example && make clean ) make -C example clean
find example/ -type d -name .deps -exec rm -rf {} + rm -rf example/.deps
find example/ -type f '(' -name '*.am' -o -name '*.in' ')' -exec rm -v {} + find example/ -type f '(' -name '*.am' -o -name '*.in' ')' -exec rm -v {} \;
# avoid multilib conflict on libssh2-docs # avoid multilib conflict on libssh2-docs
mv -v example/Makefile example/Makefile.%{_arch} mv -v example/Makefile example/Makefile.%{_arch}
%check %check
# sshd/loopback test fails under local build, with selinux enforcing # The SSH test will fail if we don't have /dev/tty, as is the case in some
%{?_without_sshd_tests:echo "Skipping sshd tests" ; echo "exit 0" > tests/ssh2.sh } # versions of mock (#672713)
# sshd/loopback test fails in the sparc buildsystem if [ ! -c /dev/tty ]; then
echo Skipping SSH test due to missing /dev/tty
echo "exit 0" > tests/ssh2.sh
fi
# Apparently it fails in the sparc buildsystem too
%ifarch %{sparc} %ifarch %{sparc}
echo Skipping SSH test on sparc
echo "exit 0" > tests/ssh2.sh echo "exit 0" > tests/ssh2.sh
%endif %endif
(cd tests && make check) make -C tests check
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README NEWS %doc AUTHORS ChangeLog COPYING README NEWS
%{_libdir}/*.so.* %{_libdir}/libssh2.so.1
%{_libdir}/libssh2.so.1.*
%files docs %files docs
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING HACKING example/ %doc HACKING example/
%{_mandir}/man?/* %{_mandir}/man3/libssh2_*.3*
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING %{_includedir}/libssh2.h
%{_includedir}/* %{_includedir}/libssh2_publickey.h
%{_libdir}/*.so %{_includedir}/libssh2_sftp.h
%{_libdir}/pkgconfig/* %{_libdir}/libssh2.so
%{_libdir}/pkgconfig/libssh2.pc
%changelog %changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-2 * Fri Jan 13 2012 Paul Howarth <paul@city-fan.org> 1.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - make docs package noarch where possible
- use patch rather than scripted iconv to fix character encoding
- don't make assumptions about SELinux context types used for the ssh server
in the test suite
- skip the ssh test if /dev/tty isn't present, as in some versions of mock
- make the %%files list more explicit
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 1.3.0-2
- rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Sep 08 2011 Kamil Dudka <kdudka@redhat.com> 1.3.0-1 * Thu Sep 08 2011 Kamil Dudka <kdudka@redhat.com> 1.3.0-1
- update to 1.3.0 - update to 1.3.0
* Sat Jun 25 2011 Dennis Gilmore <dennis@ausil.us> - 1.2.7-2 * Sat Jun 25 2011 Dennis Gilmore <dennis@ausil.us> 1.2.7-2
- sshd/loopback test fails in the sparc buildsystem - sshd/loopback test fails in the sparc buildsystem
* Tue Oct 12 2010 Kamil Dudka <kdudka@redhat.com> 1.2.7-1 * Tue Oct 12 2010 Kamil Dudka <kdudka@redhat.com> 1.2.7-1

Loading…
Cancel
Save