代码拉取完成,页面将自动刷新
同步操作将从 src-oepkgs/netcat 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%global commit bc5a8259a456844c67e446bf6bd66575acc64837
%if 0%{?fedora} || 0%{?rhel} > 8
%global link_bin nc
%global link_man nc-man
%else
%global link_bin nmap
%global link_man ncman
%endif
Summary: OpenBSD netcat to read and write data across connections using TCP or UDP
Name: netcat
# Version from CVS revision of OpenBSD netcat.c
Version: 1.218
Release: 5%{?dist}
License: BSD
URL: https://man.openbsd.org/nc.1
Source0: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/netcat.c
Source1: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/nc.1
Source2: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/atomicio.c
Source3: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/atomicio.h
Source4: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/socks.c
Source5: https://raw.githubusercontent.com/openbsd/src/%{commit}/usr.bin/nc/Makefile
# Port peculiarities from OpenBSD to Linux
Patch0: https://salsa.debian.org/debian/netcat-openbsd/-/raw/9de0012ffa88e80abf582456eea1454f2ecb69f8/debian/patches/port-to-linux-with-libsd.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: libbsd-devel
BuildRequires: libretls-devel
Requires(post): %{_sbindir}/alternatives
Requires(preun): %{_sbindir}/alternatives
Obsoletes: nc < 1.109.20120711-2
Obsoletes: nc6 < 1.00-22
Provides: nc = %{version}-%{release}
Provides: nc6 = %{version}-%{release}
%description
The OpenBSD nc (or netcat) utility can be used for just about anything involving
TCP, UDP, or UNIX-domain sockets. It can open TCP connections, send UDP packets,
listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4
and IPv6. Unlike telnet(1), nc scripts nicely, and separates error messages onto
standard error instead of sending them to standard output, as telnet(1) might do
with some.
%prep
%setup -q -T -c
cp -pf %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} .
%patch0 -p1 -b .port-to-linux-with-libsd
sed -e '1i #define unveil(path, permissions) 0' \
-e '1i #define pledge(request, paths) 0' \
-i netcat.c
sed -e 's/^\(LIBS=.*\)/\1 -ltls/' -i Makefile
dnf config-manager --add-repo https://repo.oepkgs.net/openeuler/rpm/openEuler-20.03-LTS-SP1/compatible/c7/aarch64/
dnf clean all && dnf makecache
yum install -y libbsd-devel --nogpgcheck
yum install -y libretls-devel --nogpgcheck
%build
%make_build CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
%install
install -D -p -m 0755 nc $RPM_BUILD_ROOT%{_bindir}/%{name}
install -D -p -m 0644 nc.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
touch $RPM_BUILD_ROOT%{_bindir}/nc
touch $RPM_BUILD_ROOT%{_mandir}/man1/nc.1.gz
%post
%{_sbindir}/alternatives --install %{_bindir}/nc %{link_bin} %{_bindir}/%{name} 10 \
--slave %{_mandir}/man1/nc.1.gz %{link_man} %{_mandir}/man1/%{name}.1.gz
%preun
if [ $1 -eq 0 ]; then
%{_sbindir}/alternatives --remove %{link_bin} %{_bindir}/%{name}
fi
%files
%ghost %{_bindir}/nc
%ghost %{_mandir}/man1/nc.1.gz
%{_bindir}/netcat
%{_mandir}/man1/netcat.1*
%changelog
* Sat May 14 2022 Robert Scheck <[email protected]> 1.218-5
- Rebuilt for libretls 3.5.2
* Sun Feb 27 2022 Robert Scheck <[email protected]> 1.218-4
- Rebuilt for libretls 3.5.0
* Thu Jan 20 2022 Fedora Release Engineering <[email protected]> - 1.218-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Oct 16 2021 Robert Scheck <[email protected]> 1.218-2
- Rebuilt for libretls 3.4.1
* Mon Aug 30 2021 Robert Scheck <[email protected]> 1.218-1
- Upgrade to 1.218 (#1993735)
* Thu Jul 22 2021 Fedora Release Engineering <[email protected]> - 1.217-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Mar 17 2021 Robert Scheck <[email protected]> 1.217-3
- Changes to match the Fedora Packaging Guidelines (#1939769 #c1)
* Wed Mar 17 2021 Robert Scheck <[email protected]> 1.217-2
- Changes to match the Fedora Packaging Guidelines (#1939769)
* Sun Mar 07 2021 Robert Scheck <[email protected]> 1.217-1
- Upgrade to 1.217
- Initial spec file for Fedora and Red Hat Enterprise Linux
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。