toreanderson / clatd

A 464XLAT CLAT implementation for Linux
MIT License
213 stars 19 forks source link

install script at raspbian detects tayga but still tries to install a rpm or source code alternative #15

Closed thomasschaeferm closed 4 years ago

thomasschaeferm commented 4 years ago
root@raspberrypi4:~# make -C clatd install installdeps 
make: Entering directory '/root/clatd'
# Install the main script
install -m0755 clatd /usr/sbin/clatd
# Install manual page if pod2man is installed
pod2man --name clatd --center "clatd - a CLAT implementation for Linux" --section 8 README.pod /usr/share/man/man8/clatd.8 && gzip -f9 /usr/share/man/man8/clatd.8 || echo "pod2man is required to generate manual page"
# Install systemd service file if applicable for this system
if test -x "/bin/systemctl" && test -d "/etc/systemd/system"; then install -m0644 scripts/clatd.systemd /etc/systemd/system/clatd.service && /bin/systemctl daemon-reload; fi
if test -e "/etc/systemd/system/clatd.service" && test ! -e "/etc/systemd/system/multi-user.target.wants/clatd.service"; then /bin/systemctl enable clatd.service; fi
# Install upstart service file if applicable for this system
if test -x "" && test -d "/etc/init"; then install -m0644 scripts/clatd.upstart /etc/init/clatd.conf; fi
# Install NetworkManager dispatcher script if applicable
if test -d /etc/NetworkManager/dispatcher.d; then install -m0755 scripts/clatd.networkmanager /etc/NetworkManager/dispatcher.d/50-clatd; fi
# .deb/apt-get based distros
if test -x "/usr/bin/apt-get"; then /usr/bin/apt-get -y install perl-base perl-modules libnet-ip-perl libnet-dns-perl libio-socket-inet6-perl iproute2 iptables tayga; fi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'perl-modules-5.28' instead of 'perl-modules'
iproute2 is already the newest version (4.20.0-2).
iptables is already the newest version (1.8.2-4).
libio-socket-inet6-perl is already the newest version (2.72-2).
libnet-dns-perl is already the newest version (1.19-1).
libnet-ip-perl is already the newest version (1.26-2).
perl-base is already the newest version (5.28.1-6).
perl-modules-5.28 is already the newest version (5.28.1-6).
tayga is already the newest version (0.9.2-8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
# .rpm/DNF/YUM-based distros
if test -x ""; then  -y install perl perl-Net-IP perl-Net-DNS perl-IO-Socket-INET6 perl-File-Temp iproute2 iptables; fi
# If necessary, try to install the TAYGA .rpm using dnf/yum. It is unfortunately not available in all .rpm based distros (in particular CentOS/RHEL).
if test -x "" && test ! -x "/usr/sbin/tayga"; then  -y install tayga || echo "ERROR: Failed to install TAYGA using dnf/yum, the package is probably not included in your distro. Try enabling the EPEL repo <URL: https://fedoraproject.org/wiki/EPEL> and try again, or install TAYGA <URL: http://www.litech.org/tayga> directly from source."; exit 1; fi
make: Leaving directory '/root/clatd'
root@raspberrypi4:~#
toreanderson commented 4 years ago

I do not see evidence of that in the terminal output you posted. Could you elaborate?

thomasschaeferm commented 4 years ago

I am confused by tayga is already the newest version (0.9.2-8).

and the last lines (of comment / code/ comments with code?)

toreanderson commented 4 years ago

Well, the installdeps target calls apt-get -y install ... tayga unconditionally on Debian-based distros. However, since it was already installed, this becomes a no-op with this message.

The last couple of lines are surrounded by if ..; then ...; fi constructs that make sure that they only run if the distro is using yum or dnf, and if /usr/sbin/tayga isn't installed. To me it appears as if those if conditionals did their job correctly by not actually attempting to install anything on your distribution. (if test -x "" is essentially the same as if false, which means the rest of the line will not be executed.)

It is the default behaviour of make to echo back the entire commands in the Makefile as they are being evaluated, for what it is worth.

thomasschaeferm commented 4 years ago

Thank you for the explanation.