Files

92 lines
3.5 KiB
Tcl
Raw Permalink Normal View History

2022-01-23 14:25:22 +08:00
# -*- 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
2026-02-16 15:30:29 +08:00
PortSystem 1.0
PortGroup github 1.0
2022-01-23 14:25:22 +08:00
2026-03-31 22:46:00 +11:00
github.setup brona iproute2mac 1.7.4 v
2026-02-16 15:30:29 +08:00
revision 0
supported_archs noarch
categories net python
maintainers {i0ntempest @i0ntempest} openmaintainer
license MIT
2022-01-23 14:25:22 +08:00
2026-02-16 15:30:29 +08:00
description CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.
long_description {*}${description} \
Provided functionality is limited and command output is not fully compatible with iproute2. \
Goal of this project is to make basic network configuration/debug tasks on Mac OS X easy \
for admins who already use Linux systems.
2022-01-23 14:25:22 +08:00
2026-02-16 15:30:29 +08:00
github.tarball_from releases
2024-07-31 15:47:36 -04:00
2026-03-31 22:46:00 +11:00
checksums rmd160 2e37841b5e41ce296fbd87812071473dec393155 \
sha256 8850fb1e0e18f525bd4f4b43d9e2a072a730b8f19e9a24b00713f8e43c1e1392 \
size 21364
2022-01-23 14:25:22 +08:00
pre-configure {
2025-11-18 21:28:21 +11:00
if {![variant_isset python310] && ![variant_isset python311] && ![variant_isset python312] && \
![variant_isset python313] && ![variant_isset python314]} {
2022-01-23 14:25:22 +08:00
ui_error "${name} requires Python, please use a Python variant."
return -code error
}
}
2026-02-16 15:30:29 +08:00
use_configure no
2022-01-23 14:25:22 +08:00
build {}
destroot {
2024-08-01 00:45:33 -04:00
xinstall -d ${destroot}${prefix}/libexec/${name}
xinstall -m 755 {*}[glob ${worksrcpath}/src/*.py] ${destroot}${prefix}/libexec/${name}
foreach cmd {ip bridge} {
2025-01-07 00:59:20 +08:00
ln -s ${prefix}/libexec/${name}/${cmd}.py ${destroot}${prefix}/sbin/${cmd}
2024-08-01 00:45:33 -04:00
}
2026-02-15 22:18:00 +08:00
foreach cmd {ss} {
ln -s ${prefix}/libexec/${name}/${cmd}.py ${destroot}${prefix}/bin/${cmd}
}
2024-08-01 00:45:33 -04:00
xinstall -d ${destroot}${prefix}/share/doc/${name}
2022-02-15 14:37:30 +08:00
xinstall -m 644 -W ${worksrcpath} README.md LICENSE AUTHORS ${destroot}${prefix}/share/doc/${name}
2022-01-23 14:25:22 +08:00
}
proc python-depends {python_branch} {
set python_version [string map {. ""} ${python_branch}]
depends_run-append port:python${python_version}
post-patch {
2024-08-03 20:46:34 -04:00
reinplace "s|#!/usr/bin/env python3|#!${prefix}/bin/python${python_branch}|" {*}[glob ${worksrcpath}/src/*.py]
2022-01-23 14:25:22 +08:00
}
}
2025-11-18 21:28:21 +11:00
variant python314 conflicts python310 python311 python312 python313 description {Use Python 3.14 as interpreter} {
set ::python_branch 3.14
python-depends ${::python_branch}
}
variant python313 conflicts python310 python311 python312 python314 description {Use Python 3.13 as interpreter} {
2024-11-28 16:51:24 +08:00
set ::python_branch 3.13
python-depends ${::python_branch}
}
2025-11-18 21:28:21 +11:00
variant python312 conflicts python310 python311 python313 python314 description {Use Python 3.12 as interpreter} {
2023-12-06 19:58:01 -05:00
set ::python_branch 3.12
python-depends ${::python_branch}
}
2025-11-18 21:28:21 +11:00
variant python311 conflicts python310 python312 python313 python314 description {Use Python 3.11 as interpreter} {
2022-10-25 18:15:28 -04:00
set ::python_branch 3.11
python-depends ${::python_branch}
}
2025-11-18 21:28:21 +11:00
variant python310 conflicts python311 python312 python313 python314 description {Use Python 3.10 as interpreter} {
set ::python_branch 3.10
python-depends ${::python_branch}
}
2026-01-19 12:06:39 +08:00
if {![variant_isset python310] && ![variant_isset python311] && ![variant_isset python312] && ![variant_isset python313]} {
default_variants +python314
2022-01-23 14:25:22 +08:00
}
variant mpsudo description {Use sudo command provided by MacPorts instead of the system} {
depends_run-append port:sudo
post-patch {
2024-07-31 15:47:36 -04:00
reinplace "s|/usr/bin/sudo|${prefix}/bin/sudo|g" ${worksrcpath}/src/iproute2mac.py
2022-01-23 14:25:22 +08:00
}
}