my first port - how to
Greetings, I'm attempting to write my first port. Writing the portfile is not too difficult, as there's lots of good examples. However, actually making it install is a lot tougher. I am making it work by: - adding the portfile in the right place in /opt/local - changing the portindex file to add the port info manually (and making up a number for it) However, these things seem really kludgey. Is it not possible to have a local portfile somewhere and install it using a command line "port" command? That would seem much better, but I can't find any documentation on how that's done. (For instance, there's a local "~/.portsrc" file? but I can't find any docs on it.) I think this is the sort of thing that really ought to be on the wiki - the barrier to entry of adding a portfile is really very high, and a short guide would be helpful. What it should say: - "So you've written a Portfile. Here's how you test it locally." - "Here's how you prevent it from being clobbered when you selfupdate." - "Here's where you put it if you're testing it locally, and want to leave it local for a while." - "Your Portfile is awesome. It works. Here's how to add it to the MacPorts repository." - "... and here's how you update it." - "Your Portfile probably has lots of dependencies. Here's how you tell what they are." - "Here are naming conventions for ports." etc. Especially the first one right now would be very useful for me. JDO
On 10.12.2006, at 14:48, John Owens wrote:
However, these things seem really kludgey. Is it not possible to have a local portfile somewhere and install it using a command line "port" command?
Just cd to the directory where you've put the Portfile (*outside* of / opt/local) and try "sudo port -d install". That should work. Or you could set up a local repository: sudo port install subversion mkdir -p /Users/Shared/dports/x11/myport # and put your portfile there sudo sed -e '1i\ file:///Users/Shared/dports' -i~ /opt/local/etc/ports/sources.conf portindex /Users/Shared/dports sudo port install myport Regards, Marc
Citando John Owens :
Greetings, I'm attempting to write my first port. Writing the portfile is not too difficult, as there's lots of good examples. However, actually making it install is a lot tougher.
I am making it work by:
- adding the portfile in the right place in /opt/local - changing the portindex file to add the port info manually (and making up a number for it)
However, these things seem really kludgey. Is it not possible to have a local portfile somewhere and install it using a command line "port" command? That would seem much better, but I can't find any documentation on how that's done. (For instance, there's a local "~/.portsrc" file? but I can't find any docs on it.)
I think this is the sort of thing that really ought to be on the wiki - the barrier to entry of adding a portfile is really very high, and a short guide would be helpful.
It used to be in the documentation: http://darwinports.opendarwin.org/docs/ch03s05.html#local_repository In two words, you just edit sources.conf and use the 'portindex' command in the right place. Most configuration files are in ${prefix}/etc/ports/. For information about ~/.portsrc, have a look at 'man ports.conf' Emmanuel
John Owens <john_owens@yahoo.com> on Sunday, December 10, 2006 at 5:48 AM -0800 wrote:
Is it not possible to have a local portfile somewhere and install it using a command line "port" command? That would seem much better, but I can't find any documentation on how that's done. (For instance, there's a local "~/.portsrc" file? but I can't find any docs on it.)
I think this is the sort of thing that really ought to be on the wiki - the barrier to entry of adding a portfile is really very high, and a short guide would be helpful. What it should say:
You're right. Our documentation is woefully inadequate at present, and even the legacy reference docs missed some of the obviouspoints you mention. I've contributed a few minor documentaton items and I've had in mind the local repository item as the next one as the most needed individual item, lacking more comprehensive developer docs that might contain it. If no one else does I'll do it soon. The thing that this link http://darwinports.opendarwin.org/docs/ch03s05.html#local_repository doesn't say is that if you put the line specifying your local portfile *before* the normal rsync one, then duplicates (if you are doing develoment work on an existing port) the local port will be the one that shows up first when you run /port search foo' and gets installed when 'port install foo' is run. In other words, /opt/local/etc/ports/sources.conf looks like this: file:///Users/billy/dports rsync://rsync.darwinports.org/dpupdate/dports Mark
Emmanuel Hainry <ehainry <at> free.fr> writes:
In two words, you just edit sources.conf and use the 'portindex' command in the right place.
Most configuration files are in ${prefix}/etc/ports/. For information about ~/.portsrc, have a look at 'man ports.conf'
I found sources.conf, but would have found it useful if it indicated that I could have both a file:// AND rsync:// line. It has no indication that I can have more than one uncommented line. That would be a nice addition to the default sources.conf file, also with a line that says what overrides what (does the first line override the second or vice versa). Thank you for the pointer to man ports.conf. JDO
participants (4)
-
Emmanuel Hainry
-
John Owens
-
Marc André Selig
-
Mark Duling