Opened 9 years ago

Closed 9 years ago

#48977 closed submission (fixed)

oinkmaster 2.0

Reported by: Schamschula (Marius Schamschula) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: oinkmaster

Description

Oinkmaster is a perl script that will help you update and manage your Snort rules. It is also used to configure suricata, see #42858

Attachments (5)

Portfile (1.1 KB) - added by Schamschula (Marius Schamschula) 9 years ago.
patch-oinkmaster.pl.diff (348 bytes) - added by Schamschula (Marius Schamschula) 9 years ago.
Portfile.2 (1.7 KB) - added by ryandesign (Ryan Carsten Schmidt) 9 years ago.
patch-oinkmaster.1.diff (610 bytes) - added by ryandesign (Ryan Carsten Schmidt) 9 years ago.
patch-oinkmaster.pl.2.diff (959 bytes) - added by ryandesign (Ryan Carsten Schmidt) 9 years ago.

Download all attachments as: .zip

Change History (15)

Changed 9 years ago by Schamschula (Marius Schamschula)

Attachment: Portfile added

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: haspatch removed
Version: 2.3.3

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

Your portfile references a patchfile patch-oinkmaster.pl.diff. Could you attach that too? Please add a comment to the ticket when you do, so I know to check back.

Changed 9 years ago by Schamschula (Marius Schamschula)

Attachment: patch-oinkmaster.pl.diff added

comment:3 Changed 9 years ago by Schamschula (Marius Schamschula)

Sorry, Ryan. I'm not sure why I didn't upload the patch in the first place.

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

No problem; it's easy to forget.

The patch hardcodes the prefix "/opt/local". We must instead arrange to use the user's MacPorts prefix, which might be different.

I'll work on this and commit it shortly.

comment:5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

The port installs oinkmaster.conf. But the user is expected to edit that file, aren't they? If so, it should not be registered to the port. PortfileRecipes#configfiles

Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: Portfile.2 added

Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: patch-oinkmaster.1.diff added

Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: patch-oinkmaster.pl.2.diff added

comment:6 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

I attached a revised portfile and patches. In the portfile, I indicated that the port installs no architecture-specific files. I modified the master_sites to avoid redirects (wiki:howto/AvoidRedirects). I installed the documentation files (PortfileRecipes#doc). I added to your patch to change the file's encoding from ISO8859-1 to UTF-8 both so that reinplace wouldn't fail and so that running "oinkmaster.pl -V" on the command line doesn't produce incorrect output. I installed the conf file as a sample and copied it in post-activate if it's not already there. I added a patch for the manpage so that the default conf file location is correct there.

To do: the sample conf file includes a path directive. Should we patch the MacPorts prefix into that?

# The PATH to use during execution. If you prefer to use external 
# binaries (i.e. use_external_bins=1, see below), tar and gzip must be 
# found, and also wget if downloading via ftp, http or https. All with 
# optional .exe suffix. If you're on Cygwin, make sure that the path 
# contains the Cygwin binaries and not the native Win32 binaries or 
# you will get problems.
# Assume UNIX style by default:
path = /bin:/usr/bin:/usr/local/bin

A related question is whether we should set use_external_bins to 0 or 1, and either way, if we should add the dependencies it's going to use. If it's going to use wget at runtime, for example, we should add a dependency on that, since wget is not part of OS X.

# We normally use external binaries (wget, tar and gzip) since they're 
# already available on most systems and do a good job. If you have the 
# Perl modules Archive::Tar, IO::Zlib and LWP::UserAgent, you can use
# those instead if you like. You can set use_external_bins below to 
# choose which method you prefer. It's set to 0 by default on Win32 
# (i.e. use Perl modules), and 1 on other systems (i.e. use external 
# binaries). The reason for that is that the required Perl modules
# are included on Windows/ActivePerl 5.8.1+, so it's easier to use 
# those than to install the ported Unix tools. (Note that if you're 
# using scp to download the archive, external scp  binary is still 
# used.) 
# use_external_bins = 0

comment:7 Changed 9 years ago by Schamschula (Marius Schamschula)

Yup. That path might need to be updated. Note, however, it works as is.

Now as to the wget runtime dependency - that's one thing that trace mode does not find. Please add that!

comment:8 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

But if it's going to look for a wget binary at runtime, it's not going to find it in /bin:/usr/bin:/usr/local/bin. We would need to add the MacPorts path to that for a MacPorts copy of wget to be found.

comment:9 Changed 9 years ago by Schamschula (Marius Schamschula)

Strange, I suppose it was found on my machine via the PATH of the bash shell.

Adding /opt/local/bin does no harm.

comment:10 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Ok, port added in r141071.

Note: See TracTickets for help on using tickets.