Variants for local build time paramaters

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Variants for local build time paramaters

Marcus Pallinger
Hi,
I want to create a port for an application that listens on a range of  
ports. These ports can optionally be specified as compile time  
parameters.

Is there a way to create a port file that allows compile time options  
to be supplied,
soemthing like: (I haven't installed a port in quite a while, so the  
syntax can be wrong)
port install foo +lowerPort-5000 +upperport-5100
where the 5000 and 5100 could be different for each installation?  
(the varaiants are, of course, optional)?

Thanks,
Marcus
--
I think it's a beautiful day to go to the zoo and feed the ducks.
To the lions.
-- Brian Kantor

_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Mark Duling
Marcus Pallinger <[hidden email]> writes:

>I want to create a port for an application that listens on a range of  
>ports. These ports can optionally be specified as compile time  
>parameters.
>
>Is there a way to create a port file that allows compile time options  
>to be supplied,
>soemthing like: (I haven't installed a port in quite a while, so the  
>syntax can be wrong)
>port install foo +lowerPort-5000 +upperport-5100
>where the 5000 and 5100 could be different for each installation?  
>(the varaiants are, of course, optional)?

You'd use variants for that.  So you find out how you'd specify this to
the app and then make variants to do it.  So if app foo compiled by
default to listen on port 5000, but that could be overridden with
configure argument

--listenport=xxx

and you wanted to provide 2 non-default port listening options (5010 and
5020) when installing foo then here's how you'd do it.

variant tcp5010 {configure.args   --listenport=5010}
                               
variant tcp5020 {configure.args   --listenport=5020}

Now if the default you'd chosen for port foo was different from the app's
default, you'd have to tell it your selected default in configure.args and
modify this in the variants:

configure.args    --listenport=6000

variant tcp5010 {
        configure.args-delete --listenport=6000
        configure.args-append   --listenport=5010}
                               
variant tcp5020 {
        configure.args-delete --listenport=6000
        configure.args-append   --listenport=5020}


Mark

_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Marcus Pallinger

On 31/03/2006, at 12:25 PM, Mark Duling wrote:

> Marcus Pallinger <[hidden email]> writes:
>> I want to create a port for an application that listens on a range of
>> ports. These ports can optionally be specified as compile time
>> parameters.
>>
>> Is there a way to create a port file that allows compile time options
>> to be supplied,
>> soemthing like: (I haven't installed a port in quite a while, so the
>> syntax can be wrong)
>> port install foo +lowerPort-5000 +upperport-5100
>> where the 5000 and 5100 could be different for each installation?
>> (the varaiants are, of course, optional)?
>
> You'd use variants for that.  So you find out how you'd specify  
> this to
> the app and then make variants to do it.  So if app foo compiled by
> default to listen on port 5000, but that could be overridden with
> configure argument
>
> variant tcp5010 {configure.args   --listenport=5010}
>
> variant tcp5020 {configure.args   --listenport=5020}

I was hoping for something more generic, so each user could specify  
ports for their own situation
Ideally something (hypothetically) like this:


variant tcp x { configure.args   --listenport=x }

so someone could see that their firewall has port 8000 open and could  
do something like
port install foo +tcp=8000

This way, the install can be customised for each user, without having  
to specify every possible port as a different variant (which, I  
suppose, could be done, but will make a very messy port file)

--
Why Windows NT Server 4.0 continues to exist in the enterprise
would be a topic appropriate for an investigative report in the
field of psychology or marketing, not an article on information
technology. -- John Kirch


_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Mark Duling
Marcus Pallinger <[hidden email]> writes:

>
>On 31/03/2006, at 12:25 PM, Mark Duling wrote:
>
>> Marcus Pallinger <[hidden email]> writes:
>>> I want to create a port for an application that listens on a range of
>>> ports. These ports can optionally be specified as compile time
>>> parameters.
>>>
>>> Is there a way to create a port file that allows compile time options
>>> to be supplied,
>>> soemthing like: (I haven't installed a port in quite a while, so the
>>> syntax can be wrong)
>>> port install foo +lowerPort-5000 +upperport-5100
>>> where the 5000 and 5100 could be different for each installation?
>>> (the varaiants are, of course, optional)?
>>
>> You'd use variants for that.  So you find out how you'd specify  
>> this to
>> the app and then make variants to do it.  So if app foo compiled by
>> default to listen on port 5000, but that could be overridden with
>> configure argument
>>
>> variant tcp5010 {configure.args   --listenport=5010}
>>
>> variant tcp5020 {configure.args   --listenport=5020}
>
>I was hoping for something more generic, so each user could specify  
>ports for their own situation
>Ideally something (hypothetically) like this:
>
>
>variant tcp x { configure.args   --listenport=x }
>
>so someone could see that their firewall has port 8000 open and could  
>do something like
>port install foo +tcp=8000
>
>This way, the install can be customised for each user, without having  
>to specify every possible port as a different variant (which, I  
>suppose, could be done, but will make a very messy port file)

DarwinPorts has no means of user interactivity; at least none beyond
variants.  But it sounds to me like an app where it is useful to specify
ranges of tcp ports would be highly deficient if it didn't allow user's to
specify that at time of program execution.  Doing things like that at
build time seems highly inflexible.

Mark

_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Jeff Johnson-12
Add a patch to the program to read the port(s) on which to listen  
from a config file.

There's little reason to compile a tcp port number into a program in  
the first place if the
port number needs changing.

Using port variants to accomplish adding a --listenport=5020 option to
configure is like killing a mosquito with tactical nukes.

Sure the mosquito is gonna die, but ... ;-)

73 de Jeff

On Mar 31, 2006, at 12:17 AM, Mark Duling wrote:

> Marcus Pallinger <[hidden email]> writes:
>>
>> On 31/03/2006, at 12:25 PM, Mark Duling wrote:
>>
>>> Marcus Pallinger <[hidden email]> writes:
>>>> I want to create a port for an application that listens on a  
>>>> range of
>>>> ports. These ports can optionally be specified as compile time
>>>> parameters.
>>>>
>>>> Is there a way to create a port file that allows compile time  
>>>> options
>>>> to be supplied,
>>>> soemthing like: (I haven't installed a port in quite a while, so  
>>>> the
>>>> syntax can be wrong)
>>>> port install foo +lowerPort-5000 +upperport-5100
>>>> where the 5000 and 5100 could be different for each installation?
>>>> (the varaiants are, of course, optional)?
>>>
>>> You'd use variants for that.  So you find out how you'd specify
>>> this to
>>> the app and then make variants to do it.  So if app foo compiled by
>>> default to listen on port 5000, but that could be overridden with
>>> configure argument
>>>
>>> variant tcp5010 {configure.args   --listenport=5010}
>>>
>>> variant tcp5020 {configure.args   --listenport=5020}
>>
>> I was hoping for something more generic, so each user could specify
>> ports for their own situation
>> Ideally something (hypothetically) like this:
>>
>>
>> variant tcp x { configure.args   --listenport=x }
>>
>> so someone could see that their firewall has port 8000 open and could
>> do something like
>> port install foo +tcp=8000
>>
>> This way, the install can be customised for each user, without having
>> to specify every possible port as a different variant (which, I
>> suppose, could be done, but will make a very messy port file)
>
> DarwinPorts has no means of user interactivity; at least none beyond
> variants.  But it sounds to me like an app where it is useful to  
> specify
> ranges of tcp ports would be highly deficient if it didn't allow  
> user's to
> specify that at time of program execution.  Doing things like that at
> build time seems highly inflexible.
>
> Mark
>
> _______________________________________________
> Darwinports mailing list
> [hidden email]
> http://www.opendarwin.org/mailman/listinfo/darwinports

_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Marcus Pallinger
I'd much rather patch DP to allow a syntax to allow variants to  
accept variable values than to patch the program to require a config  
file than to change a program that rarely needs it's ports changed  
once it's installed, and in fact hasn't been updated since 1995.

So I guess it's time to ask what kind of syntax would be best to do  
this?
Perhaps something like:
port install foo +lowerport=3555 +upperport=3699

and perhaps define a variable so the port file would contain

variant lowerport { configure.args   --listenportmin= ${lowerport} }
variant upperport { configure.args   --listenportmax= ${upperport} }

which will install foo @1.0+lowerport-3555+upperport-3699

On 31/03/2006, at 7:21 PM, Jeff Johnson wrote:

> Add a patch to the program to read the port(s) on which to listen  
> from a config file.
>
> There's little reason to compile a tcp port number into a program  
> in the first place if the
> port number needs changing.
>
> Using port variants to accomplish adding a --listenport=5020 option to
> configure is like killing a mosquito with tactical nukes.
>
> Sure the mosquito is gonna die, but ... ;-)
>
> 73 de Jeff
>
> On Mar 31, 2006, at 12:17 AM, Mark Duling wrote:
>
>> Marcus Pallinger <[hidden email]> writes:
>>>
>>> On 31/03/2006, at 12:25 PM, Mark Duling wrote:
>>>
>>>> Marcus Pallinger <[hidden email]> writes:
>>>>> I want to create a port for an application that listens on a  
>>>>> range of
>>>>> ports. These ports can optionally be specified as compile time
>>>>> parameters.
>>>>>
>>>>> Is there a way to create a port file that allows compile time  
>>>>> options
>>>>> to be supplied,
>>>>> soemthing like: (I haven't installed a port in quite a while,  
>>>>> so the
>>>>> syntax can be wrong)
>>>>> port install foo +lowerPort-5000 +upperport-5100
>>>>> where the 5000 and 5100 could be different for each installation?
>>>>> (the varaiants are, of course, optional)?
>>>>
>>>> You'd use variants for that.  So you find out how you'd specify
>>>> this to
>>>> the app and then make variants to do it.  So if app foo compiled by
>>>> default to listen on port 5000, but that could be overridden with
>>>> configure argument
>>>>
>>>> variant tcp5010 {configure.args   --listenport=5010}
>>>>
>>>> variant tcp5020 {configure.args   --listenport=5020}
>>>
>>> I was hoping for something more generic, so each user could specify
>>> ports for their own situation
>>> Ideally something (hypothetically) like this:
>>>
>>>
>>> variant tcp x { configure.args   --listenport=x }
>>>
>>> so someone could see that their firewall has port 8000 open and  
>>> could
>>> do something like
>>> port install foo +tcp=8000
>>>
>>> This way, the install can be customised for each user, without  
>>> having
>>> to specify every possible port as a different variant (which, I
>>> suppose, could be done, but will make a very messy port file)
>>
>> DarwinPorts has no means of user interactivity; at least none beyond
>> variants.  But it sounds to me like an app where it is useful to  
>> specify
>> ranges of tcp ports would be highly deficient if it didn't allow  
>> user's to
>> specify that at time of program execution.  Doing things like that at
>> build time seems highly inflexible.
>>
>> Mark
>>
>> _______________________________________________
>> Darwinports mailing list
>> [hidden email]
>> http://www.opendarwin.org/mailman/listinfo/darwinports
>

--
Eeeeeew!  I've never seen anyone try it! I've never considered
trying it myself.  It scares me!
-- Sylvia Sawczuk's comments on my SQL abuse


_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

Marcus Pallinger
I've mostly got this working without having to modify ports

variant lowerport { configure.args   --listenportmin= ${lowerport} }

works, and has to be invoked with port install +lowerport lowerport=3555

Is there any way that I can change the name that the port number  
appears in the package name? such as
foo @1.0+lowerport3555
rather than foo @1.0+lowerport

On 01/04/2006, at 9:18 AM, Marcus Pallinger wrote:


> I'd much rather patch DP to allow a syntax to allow variants to  
> accept variable values than to patch the program to require a  
> config file than to change a program that rarely needs it's ports  
> changed once it's installed, and in fact hasn't been updated since  
> 1995.
>
> So I guess it's time to ask what kind of syntax would be best to do  
> this?
> Perhaps something like:
> port install foo +lowerport=3555 +upperport=3699
>
> and perhaps define a variable so the port file would contain
>
> variant lowerport { configure.args   --listenportmin= ${lowerport} }
> variant upperport { configure.args   --listenportmax= ${upperport} }
>
> which will install foo @1.0+lowerport-3555+upperport-3699
>
> On 31/03/2006, at 7:21 PM, Jeff Johnson wrote:
>
>
>> Add a patch to the program to read the port(s) on which to listen  
>> from a config file.
>>
>> There's little reason to compile a tcp port number into a program  
>> in the first place if the
>> port number needs changing.
>>
>> Using port variants to accomplish adding a --listenport=5020  
>> option to
>> configure is like killing a mosquito with tactical nukes.
>>
>> Sure the mosquito is gonna die, but ... ;-)
>>
>> 73 de Jeff
>>
>> On Mar 31, 2006, at 12:17 AM, Mark Duling wrote:
>>
>>
>>> Marcus Pallinger <[hidden email]> writes:
>>>
>>>>
>>>> On 31/03/2006, at 12:25 PM, Mark Duling wrote:
>>>>
>>>>
>>>>> Marcus Pallinger <[hidden email]> writes:
>>>>>
>>>>>> I want to create a port for an application that listens on a  
>>>>>> range of
>>>>>> ports. These ports can optionally be specified as compile time
>>>>>> parameters.
>>>>>>
>>>>>> Is there a way to create a port file that allows compile time  
>>>>>> options
>>>>>> to be supplied,
>>>>>> soemthing like: (I haven't installed a port in quite a while,  
>>>>>> so the
>>>>>> syntax can be wrong)
>>>>>> port install foo +lowerPort-5000 +upperport-5100
>>>>>> where the 5000 and 5100 could be different for each installation?
>>>>>> (the varaiants are, of course, optional)?
>>>>>>
>>>>>
>>>>> You'd use variants for that.  So you find out how you'd specify
>>>>> this to
>>>>> the app and then make variants to do it.  So if app foo  
>>>>> compiled by
>>>>> default to listen on port 5000, but that could be overridden with
>>>>> configure argument
>>>>>
>>>>> variant tcp5010 {configure.args   --listenport=5010}
>>>>>
>>>>> variant tcp5020 {configure.args   --listenport=5020}
>>>>>
>>>>
>>>> I was hoping for something more generic, so each user could specify
>>>> ports for their own situation
>>>> Ideally something (hypothetically) like this:
>>>>
>>>>
>>>> variant tcp x { configure.args   --listenport=x }
>>>>
>>>> so someone could see that their firewall has port 8000 open and  
>>>> could
>>>> do something like
>>>> port install foo +tcp=8000
>>>>
>>>> This way, the install can be customised for each user, without  
>>>> having
>>>> to specify every possible port as a different variant (which, I
>>>> suppose, could be done, but will make a very messy port file)
>>>>
>>>
>>> DarwinPorts has no means of user interactivity; at least none beyond
>>> variants.  But it sounds to me like an app where it is useful to  
>>> specify
>>> ranges of tcp ports would be highly deficient if it didn't allow  
>>> user's to
>>> specify that at time of program execution.  Doing things like  
>>> that at
>>> build time seems highly inflexible.


--
"We are losing the 'War on Drugs,' which means there's a war
going on and people on drugs are winning it."
-- Bill Hicks


_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports
Reply | Threaded
Open this post in threaded view
|

Re: Variants for local build time paramaters

James Berry-3

On Mar 31, 2006, at 6:52 PM, Marcus Pallinger wrote:

> I've mostly got this working without having to modify ports
>
> variant lowerport { configure.args   --listenportmin= ${lowerport} }
>
> works, and has to be invoked with port install +lowerport  
> lowerport=3555
>
> Is there any way that I can change the name that the port number  
> appears in the package name? such as
> foo @1.0+lowerport3555
> rather than foo @1.0+lowerport

Marcus,

You really don't want to do what you're doing. For one thing,  
metadata like this won't survive upgrade.

If you need static configuration like this you should provide some  
means to set a reasonable default (in the Portfile, if necessary) and  
be able to change it later (using a config file, or something).

Don't try to change a parameter like this using either a variant or  
an environment/option variable.

James.


>
> On 01/04/2006, at 9:18 AM, Marcus Pallinger wrote:
>
>
>> I'd much rather patch DP to allow a syntax to allow variants to  
>> accept variable values than to patch the program to require a  
>> config file than to change a program that rarely needs it's ports  
>> changed once it's installed, and in fact hasn't been updated since  
>> 1995.
>>
>> So I guess it's time to ask what kind of syntax would be best to  
>> do this?
>> Perhaps something like:
>> port install foo +lowerport=3555 +upperport=3699
>>
>> and perhaps define a variable so the port file would contain
>>
>> variant lowerport { configure.args   --listenportmin= ${lowerport} }
>> variant upperport { configure.args   --listenportmax= ${upperport} }
>>
>> which will install foo @1.0+lowerport-3555+upperport-3699
>>
>> On 31/03/2006, at 7:21 PM, Jeff Johnson wrote:
>>
>>
>>> Add a patch to the program to read the port(s) on which to listen  
>>> from a config file.
>>>
>>> There's little reason to compile a tcp port number into a program  
>>> in the first place if the
>>> port number needs changing.
>>>
>>> Using port variants to accomplish adding a --listenport=5020  
>>> option to
>>> configure is like killing a mosquito with tactical nukes.
>>>
>>> Sure the mosquito is gonna die, but ... ;-)
>>>
>>> 73 de Jeff
>>>
>>> On Mar 31, 2006, at 12:17 AM, Mark Duling wrote:
>>>
>>>
>>>> Marcus Pallinger <[hidden email]> writes:
>>>>
>>>>>
>>>>> On 31/03/2006, at 12:25 PM, Mark Duling wrote:
>>>>>
>>>>>
>>>>>> Marcus Pallinger <[hidden email]> writes:
>>>>>>
>>>>>>> I want to create a port for an application that listens on a  
>>>>>>> range of
>>>>>>> ports. These ports can optionally be specified as compile time
>>>>>>> parameters.
>>>>>>>
>>>>>>> Is there a way to create a port file that allows compile time  
>>>>>>> options
>>>>>>> to be supplied,
>>>>>>> soemthing like: (I haven't installed a port in quite a while,  
>>>>>>> so the
>>>>>>> syntax can be wrong)
>>>>>>> port install foo +lowerPort-5000 +upperport-5100
>>>>>>> where the 5000 and 5100 could be different for each  
>>>>>>> installation?
>>>>>>> (the varaiants are, of course, optional)?
>>>>>>>
>>>>>>
>>>>>> You'd use variants for that.  So you find out how you'd specify
>>>>>> this to
>>>>>> the app and then make variants to do it.  So if app foo  
>>>>>> compiled by
>>>>>> default to listen on port 5000, but that could be overridden with
>>>>>> configure argument
>>>>>>
>>>>>> variant tcp5010 {configure.args   --listenport=5010}
>>>>>>
>>>>>> variant tcp5020 {configure.args   --listenport=5020}
>>>>>>
>>>>>
>>>>> I was hoping for something more generic, so each user could  
>>>>> specify
>>>>> ports for their own situation
>>>>> Ideally something (hypothetically) like this:
>>>>>
>>>>>
>>>>> variant tcp x { configure.args   --listenport=x }
>>>>>
>>>>> so someone could see that their firewall has port 8000 open and  
>>>>> could
>>>>> do something like
>>>>> port install foo +tcp=8000
>>>>>
>>>>> This way, the install can be customised for each user, without  
>>>>> having
>>>>> to specify every possible port as a different variant (which, I
>>>>> suppose, could be done, but will make a very messy port file)
>>>>>
>>>>
>>>> DarwinPorts has no means of user interactivity; at least none  
>>>> beyond
>>>> variants.  But it sounds to me like an app where it is useful to  
>>>> specify
>>>> ranges of tcp ports would be highly deficient if it didn't allow  
>>>> user's to
>>>> specify that at time of program execution.  Doing things like  
>>>> that at
>>>> build time seems highly inflexible.
>
>
> --
> "We are losing the 'War on Drugs,' which means there's a war
> going on and people on drugs are winning it."
> -- Bill Hicks
>
>
> _______________________________________________
> Darwinports mailing list
> [hidden email]
> http://www.opendarwin.org/mailman/listinfo/darwinports

_______________________________________________
Darwinports mailing list
[hidden email]
http://www.opendarwin.org/mailman/listinfo/darwinports