# # spec file for package netcat-openbsd # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Url: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/ Name: netcat-openbsd Version: 1.89 Release: 108.11 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake PreReq: update-alternatives Summary: TCP/IP swiss army knife License: BSD-3-Clause Group: Productivity/Networking/Other Source: %{name}-%{version}.tar.bz2 Source1: CMakeLists.txt Patch0: netcat-openbsd-openbsd-compat.patch Patch1: socks-b64-prototype.patch Patch2: silence-z.patch Patch3: glib-strlcpy.patch Patch4: no-strtonum.patch Patch5: pollhup.patch Patch6: reuseaddr.patch Patch7: connect-timeout.patch Patch8: udp-scan-timeout.patch Patch9: verbose-numeric-port.patch Patch10: send-crlf.patch Patch11: help-version-exit.patch Patch12: quit-timer.patch Patch13: getservbyname.patch Patch14: gcc-warnings.patch Patch15: verbose-message-to-stderr.patch Patch16: netcat-info.patch Patch17: dccp.patch #These are patches, but as they aren't applied list them as source Source2: nc-1.84-udp_stop.patch Source3: netcat-openbsd-debian.patch Source4: netcat-openbsd-examples.patch Provides: nc6 = %{version} Provides: netcat = %{version} Obsoletes: nc6 <= 1.0 Obsoletes: netcat <= 1.10 %description A simple Unix utility which reads and writes data across network connections using TCP or UDP protocol. It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts. At the same time it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities. This package contains the OpenBSD rewrite of netcat, including support for IPv6, proxies, and Unix sockets. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 cp %{S:1} . %build export CFLAGS="%{optflags}" cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} . make %{?jobs:-j%{jobs}} %install make DESTDIR=%{buildroot} install mkdir -p %{buildroot}/etc/alternatives touch %{buildroot}/etc/alternatives/netcat \ %{buildroot}/etc/alternatives/netcat.1.gz ln -s -f %{_bindir}/nc %{buildroot}/%{_bindir}/netcat ln -s -f nc.1.gz %{buildroot}/%{_mandir}/man1/netcat.1.gz %clean %files %defattr(-,root,root) %{_bindir}/nc %{_bindir}/netcat %{_mandir}/man1/nc.1.gz %ghost %{_mandir}/man1/netcat.1.gz %ghost /etc/alternatives/netcat %ghost /etc/alternatives/netcat.1.gz %post /usr/sbin/update-alternatives --install \ %{_bindir}/netcat netcat %{_bindir}/nc 10 \ --slave %{_mandir}/man1/netcat.1.gz netcat.1.gz %{_mandir}/man1/nc.1.gz %preun if [ "$1" = 0 ] ; then /usr/sbin/update-alternatives --remove \ netcat %{_bindir}/nc fi %changelog * Fri Jan 17 2014 crrodriguez@opensuse.org - drop dependency on glib, strlcpy can be implemented with snprintf with glibc/linux - drop "quilt" from buildrequires, no longer used. - Use fvisibiliy=hidden to build, this is a program not a library and no symbols should be exported. - modified patches: * glib-strlcpy.patch * Mon Sep 2 2013 pth@suse.de - Split up the huge ubuntu patch into a debian specific patch, a patch that creates the examples, a patch with the openbasd-compat stuff and single files for each of the patches in debian/patches. This hugely eases maintainabilty: connect-timeout.patch, dccp.patch, gcc-warnings.patch, getservbyname.patch, glib-strlcpy.patch, help-version-exit.patch, nc-1.84-udp_stop.patch, netcat-info.patch, netcat-openbsd-debian.patch, netcat-openbsd-examples.patch, netcat-openbsd-openbsd-compat.patch, no-strtonum.patch, pollhup.patch, quit-timer.patch, reuseaddr.patch, send-crlf.patch, silence-z.patch, socks-b64-prototype.patch, udp-scan-timeout.patch, verbose-message-to-stderr.patch, verbose-numeric-port.patch. * Sat Dec 10 2011 crrodriguez@opensuse.org - Update xbuntu patches. - Ensure we have large file support in 32 bit builds - Fix rpmlint warnings * Sat Jul 16 2011 andrea.turrini@gmail.com - Fixed typos in description of netcat-openbsd.spec * Fri Jun 25 2010 lmuelle@suse.de - Use update-alternatives to set netcat symbolic links for compatibility. - Provides and obsoltes netcat. * Fri May 28 2010 cristian.rodriguez@opensuse.org - Obsolete nc6 * Tue May 18 2010 cristian.rodriguez@opensuse.org - sync recent bugfixes from Ubuntu * Fri Feb 20 2009 crrodriguez@suse.de - sync most recent bugfixes from debian/Ubuntu * Sat Jul 5 2008 crrodriguez@suse.de - netcat-openbsd conflicts with netcat but it should not [BNC#406581] * Sun Apr 13 2008 crrodriguez@suse.de - initial version for the OBS