make DESTDIR="$INSTALL_ROOT" install &&

install -vm 644 doc/docbook/*.8 "$INSTALL_ROOT/usr/share/man/man8" &&
install -vm 644 doc/docbook/*.5 "$INSTALL_ROOT/usr/share/man/man5" &&

install -vm 755 -d "$INSTALL_ROOT/usr/share/doc/wpa_supplicant" &&
install -vm 644 wpa_supplicant.conf "$INSTALL_ROOT/usr/share/doc/wpa_supplicant" &&

if is_depends_enabled $SPELL qt-x11; then
  install -vm 755 wpa_gui/wpa_gui "$INSTALL_ROOT/usr/sbin"
fi &&

if is_depends_enabled $SPELL dbus; then
  install -vm 755 -d "$INSTALL_ROOT/usr/share/dbus-1/system-services" &&

  DBUS_FILE="$INSTALL_ROOT/usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service" &&

  if [[ $WPA_RELEASE == legacy ]]; then
    install -Tvm 644 dbus-wpa_supplicant.service "$DBUS_FILE"
  else
    install -Tvm 644 dbus/fi.epitest.hostap.WPASupplicant.service "$DBUS_FILE"
  fi
fi &&

if [[ $WPA_CONFIG_FILE == y ]] || list_find "$INIT_INSTALLED" wpa_supplicant; then
  install_config_file "$SPELL_DIRECTORY/wpa_supplicant.conf" \
                      "$INSTALL_ROOT/etc/wpa_supplicant.conf"
fi
