# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem      1.0
PortGroup       codeberg 1.0
PortGroup       legacysupport 1.1

# strnlen, getline
legacysupport.newest_darwin_requires_legacy 10

codeberg.setup  IPMITool ipmitool 1_8_19 IPMITOOL_
revision        1
# Distfile changed when the upstream source moved from github to codeberg
# (same git tag, but a different auto-generated tarball).
dist_subdir     ${name}/${codeberg.version}_1
checksums       rmd160  8c1649fdfbe2cedf7c100bc610806ae5a05d86a4 \
                sha256  ce13c710fea3c728ba03a2a65f2dd45b7b13382b6f57e25594739f2e4f20d010 \
                size    641027

version         [string map [list _ .] ${codeberg.version}]
categories      sysutils
license         BSD
maintainers     {dports @drkp} openmaintainer
description     Intelligent Platform Management Interface management utility
long_description \
  IPMItool is a utility for managing and configuring devices that \
  support the Intelligent Platform Management Interface (IPMI) version \
  1.5 and version 2.0 specifications. IPMI is an open standard for \
  monitoring, logging, recovery, inventory, and control of hardware that \
  is implemented independent of the main CPU, BIOS, and OS. The ipmitool \
  program provides a simple command-line interface to the Baseboard \
  Management Controller. It features the ability to read the sensor data \
  repository (SDR) and print sensor values, display the contents of the \
  System Event Log (SEL), print Field Replaceable Unit (FRU) inventory \
  information, read and set LAN configuration parameters, and perform \
  remote chassis power control.

# No configure script in tarball.
use_autoreconf  yes
autoreconf.cmd  ./bootstrap
autoreconf.args

depends_build   port:autoconf \
                port:automake \
                port:libtool \
                path:libexec/coreutils/libstdbuf.so:coreutils
depends_lib     path:lib/libssl.dylib:openssl \
                port:readline
depends_run     port:iana-enterprise-numbers

patchfiles      arm64-delloem.patch \
                enterprise-numbers.patch

configure.args  --enable-intf-lanplus \
                --enable-ipmishell

configure.cppflags-append   -Ds6_addr16=__u6_addr.__u6_addr16

compiler.c_standard    2011
