Usually it’s not required to start from scratch, since most tools are already packaged for other systems. As a quick example:
I downloaded the nmap source RPM from here.
After logging in to my XA2 I first had to install rpmbuild
and install the source package:
# zypper install rpm-build
# rpm -i /tmp/nmap-7.91-3.fc34.src.rpm
The sources and required patches are now in /root/rpmbuild/SOURCES
and the spec file in SPECS
. The first attempt to build nmap
failed with lots of missing dependencies.
# zypper in autoconf automake gcc-c++ gettext-devel libpcap-devel libtool lua-devel openssl-devel pcre-devel zlib-devel
fixed that. After that, rpm
complained about the macro %{gpgverify}
. I simply removed the corresponding line from the spec file. Now
# rpmbuild -bb nmap.spec
produced packages ‘nmap-7.91-3.armv7hl.rpm’ and nmap-ncat-7.91-3.armv7hl.rpm
which I immediately installed:
# rpm -i nmap-7.91-3.armv7hl.rpm nmap-ncat-7.91-3.armv7hl.rpm
# nmap -V
Nmap version 7.91 ( https://nmap.org )
Platform: armv7l-unknown-linux-gnueabi
Compiled with: nmap-liblua-5.3.5 openssl-1.0.2o libz-1.2.11 libpcre-8.42 libpcap-1.9.1 nmap-libdnet-1.12 ipv6
Compiled without: libssh2
Available nsock engines: epoll poll select