On Nov 5, 2008, at 23:15, Scott Haneda wrote:

On Nov 5, 2008, at 8:05 PM, Bryan Blackburn wrote:

On Wed, Nov 05, 2008 at 07:08:17PM -0800, Scott Haneda said:
[...]

This is my first effort to make a port update file locally on my machine,
so be gentle :)

For a first Portfile, this is a bad choice, it does nearly all steps
manually (configure, no build, and destroot are all there in the Portfile).

Can you elaborate a little on this, I am not sure I understand what you mean. What would you suggest I do? I already have ASSP running via hand compile, but wanted to use this as a way to possibly supply a working install back to the community. Same with mrtg as well, but I have a feeling mrtg may be a little harder, even though I also have that working as well by hand compiling it and dependencies.

sudo port edit assp
Changed -> version                 1.4.3.0
Changed -> maintainers             [EMAIL PROTECTED]
Added   -> distname                ASSP_${version}-Install

pre-patch seems to run around and look for two files, to rename
file rename "${worksrcpath}/ASSP Documentation.htm" ${worksrcpath}/
ASSPDocumentation.htm
file rename "${worksrcpath}/Regular Expression Tutorial.htm" $
{worksrcpath}/RegularExpressionutorial.htm

Neither of them exist, and even if they did, they would have moved to the docs/ directory. Either way, I am not sure what was bad about spaces in the files anyway, they are html files, and most browsers can deal with
that.

Both appear to be in ASSP/docs though the former is now "Legacy - ..." The pre-patch does hit more than just HTML though, there are also perl and shell scripts in the glob, not sure how well those will run with DOS- style line endings; though the .sh file I looked at was *nix-style, and so is at least
one perl script.
Not sure why the 'file rename' is being used, lots of files with spaces on
Macs.

Ahh nice catch, I did not notice the "Legacy" leading word there. I will simply keep it as is and just reference the correct files. I am pretty sure I can delete the bits about the spaces, as spaces in files should be just fine, and I would rather not change the original file name if possible.

Good idea.

I am not sure what this does:
reinplace "s%^#!.*perl%#![binaryInPath perl]%"

reinplace as a regex-based sed-like replacement tool, that does it
'in-place' as in the result is in the same file as the source. You can
search the guide for reinplace for the full documentation.

This particular reinplace replaces perl shebang lines with the result of [binaryInPath perl] which I actually disagree with; it should be using
${prefix}/bin/perl5 so make sure MacPorts' perl is used:

  reinplace "s%^#!.*perl%#!${prefix}/bin/perl5%"

So the main job is to simply alter the path to perl to that of what OS X wants for the path? However, you would like to force the use of the perl that macports installs?

Its job is to alter the shebang path from (probably) /usr/bin/perl to (if using the default MacPorts prefix) /opt/local/bin/perl so that MacPorts perl, not Apple's Mac OS X perl, get used.


I am ok with that, granted, I was hoping this would be a portable set of files once done, by changing to non OS X built in perl, the files are no longer portable to other systems. I guess I should give up on that.

Portable? MacPorts software is designed to be installed by MacPorts. If you mean you would like to install on one system and then move those files to another system, then that's not how it's meant to be used. Instead, install MacPorts on the other system, and install the ports again there through MacPorts.

Yes, there are packages and archive mode and etc etc but the most straightforward is to install MacPorts on the systems where you want to use the software, and install it through MacPorts.

ASSP has a few non mandatory dependencies. One is email::validate or something similar, and the other is net:LDAP or similar, I am assuming these are not installed.

What is the procedure for me making sure those get added. I know that CPAN makes it pretty trivial to get them, as I have done that before. I want them included in this port as well, as they are small, and eventually very useful.

Declare dependencies on those ports in the assp port. For example, if they are library dependencies, write:

depends_lib-append port:p5-perl-ldap

You can discover that the port p5-perl-ldap exists by typing "port search ldap" and looking through the results.


Is the idea to include them in the portfile, and there is no option to not install them, or do they need to be supplied as arguments to the port install command?

For small dependencies, like most perl modules are, simply depend on them unconditionally and don't make it an option.

If they are installed, it means some changes to the config file that is the default file for ASSP, which makes me think I may be getting in a little too deep on this one.

ClamAV is another optional component as well, how would I go about that intrgration? I assume clamAV is part of the ports files already, so I just need to hook it in somehow.

For starters, depend on port:clamav. Not sure if assp will need a configure option to tell it to use clamav.

Hopefully I have troubleshot this as best as I can, I am stuck at this point, with this being my first attempt to make a port update file. Any
help is appreciated.

Again, this definitely isn't the simplest one. Almost seems like it could be easier to create a new Portfile for it, start fleshing that out and use
the old one for hints on a few things.

I am willing to give it a try, I just have a feeling it may end up making me ask even more questions. What is the best guide for starting from scratch?

The MacPorts Guide.

http://guide.macports.org/

Or read existing Portfiles. Unfortunately it will be a matter of trial and error, reading various Portfiles, to see which ones are "simple" and which are "complex". Just dive in.


_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to