# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define _libdir64 %{_prefix}/lib64 Summary: Check of TCP connection to a given IP/Port Name: tcping Version: 1.3.5 Release: 1 License: LGPLv3 Group: Development/Languages URL: http://github.com/mkirchner/tcping Source0: https://github.com/mkirchner/tcping/archive/1.3.5.tar.gz BuildRequires: gcc >= 8.3.0 %description tcping does a TCP connect to the given ip/port combination. The user can specify a timeout in seconds. This is useful in shell scripts running in firewalled environments. Often SYNs are just being dropped by firewalls, thus connection establishment will be retried several times (for minutes) until a TCP timeout is reached. %prep %setup -q %build export CC="/opt/freeware/bin/gcc -O2 -maix64" # First build 64 bit export CFLAGS="-O2" export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" make CC="$CC" CCFLAGS="${CFLAGS} ${LDFLAGS}" %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} install -Dp -m 0755 %{name} ${RPM_BUILD_ROOT}%{_bindir}/%{name} /usr/bin/strip -X64 ${RPM_BUILD_ROOT}%{_bindir}/%{name} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE README %{_bindir}/%{name} %changelog * Tue Dec 16 2020 Ashwini Chandrappa - 1.35.0-1 - Initial build