How to depend on a variant (or do I want subports)?
Gregor Jasny
gjasny at googlemail.com
Wed Oct 31 12:30:35 PDT 2012
Hello,
recently I forked Xsnmp because the author completely stepped back from
maintaining it. It can be found here: https://github.com/gjasny/Xsnmp
There is an Xcode project to build a complete installer including a
(IMHO) limited preferences pane to enable the SNMP deamon and the Xsnmp
agent.
For my own servers I'd prefer having Xsnmp in MacPorts. This would ease
starting and upgrading.
Now to my question: xsnmp depends on the libnetsnmp and libnetsnmpagent
libraries and headers. They are provided by MacOS itself. But as an
alternative port I'd have to specify net-snmp. Unfortunately these libs
are only provided in the +server variant.
So how do I achieve the necessary dependency? I read some vague things
about subports but did not find any concrete documentation.
For reference I attached the preliminary Xsnmp Portfile. Once I make a
real 1.2.0 release I'll convert it to using tarballs.
Thanks,
Gregor
PS: How to specify beta version numbers? I assume 1.2.0-beta1 is newer
that 1.2.0. In Debian I'd use 1.2.0~beta1.
-------------- next part --------------
# -*- 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
# $Id$
PortSystem 1.0
name xsnmp
version 1.2.0
revision 1
categories net
license Apache-2
platforms darwin
maintainers googlemail.com:gjasny openmaintainer
description SNMP agent extension to query Mac OS and Apple values
fetch.type git
git.url git://github.com/gjasny/Xsnmp.git
depends_lib port:pcre
depends_lib lib:libnetsnmp:net-snmp
depends_lib lib:libnetsnmpagent:net-snmp
use_autoreconf yes
autoreconf.args -fvi
startupitem.create yes
startupitem.executable ${prefix}/sbin/xsnmp -f
post-destroot {
xinstall -d -m 755 ${destroot}${prefix}/share/snmp/mibs
xinstall -W ${worksrcpath} -m 644 mib/XSNMP-MIB.txt ${destroot}${prefix}/share/snmp/mibs/
}
More information about the macports-dev
mailing list