default_install &&

if [[ $INIT_INSTALLED ]]; then
  install_config_file "$SPELL_DIRECTORY/init.d/acpid.conf" \
                      "$INSTALL_ROOT/etc/sysconfig/acpid"
fi &&

if [[ ! -d "$INSTALL_ROOT/etc/acpi" ]]; then
  install -vm 755 -d "$INSTALL_ROOT"/etc/acpi/{events,actions} &&

  install -vm 644 "$SOURCE_DIRECTORY/samples/sample.conf" \
                  "$INSTALL_ROOT/etc/acpi/events" &&

  install -vm 700 "$SOURCE_DIRECTORY/samples/acpi_handler.sh" \
                  "$INSTALL_ROOT/etc/acpi/actions"
else
  if [[ ! -d "$INSTALL_ROOT/etc/acpi/events" ]]; then
    install -vm 755 -d "$INSTALL_ROOT/etc/acpi/events"
  fi &&

  if [[ ! -d "$INSTALL_ROOT/etc/acpi/actions" ]]; then
    install -vm 755 -d "$INSTALL_ROOT/etc/acpi/actions"
  fi
fi
