Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#58822 closed update (fixed)

Update for port nsd

Reported by: gctwnl Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: jmroot (Joshua Root)
Port: nsd

Description

I have updated nsd from 4.1.22 to 4.2.1 and added myself as maintainer. I have added statements to the portfile for a startupitem.

Attachments (1)

change-nsd-maintainer.diff (1.5 KB) - added by gctwnl 5 years ago.
Patch for Portfile

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by gctwnl

Attachment: change-nsd-maintainer.diff added

Patch for Portfile

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Cc: jmroot added

Thanks for working on this. Would it be possible to use startupitem.executable rather than start/stop scripts? Also, minor nitpick, setting startupitem.name is not necessary because it defaults to $name.

comment:2 Changed 5 years ago by gctwnl

No problem, this is a first attempt and I’m learning. So no wonder that my monkey-see-monkey-do approach wasn’t perfect :-) I can experiment with a simpler revision.

I’m willing to help out on this but what stops me is the amount of time to learn all the git (especially) stuff. It is finding out what to do exactly (commands etc.) is what is taking time. I know how version control works basically (worked with sccs, rcs, vcs, svn in the grey past, but always as a single user), but while I have a github (and gitlab) account, I need to know the exact commands to do an update. My experience was Makefiles and the configure (and configure.guess etc.) in the past, always working on my own copy, not having much to do with working in a collaboration with others in a version control system.

I do not understand well enough how everything works. For instance, I still do not feel comfortable with the fact that I have a Portfile separately in a different location and that it actually works outside of the tree. I just have not enough insight in how things work. If someone could take me by the hand so to speak, I could be up an running vry fast and contribute (that I think given my past experience).

comment:3 Changed 5 years ago by jmroot (Joshua Root)

Adding another ports tree to sources.conf scales better than using single portfiles in random locations anyway. :) That's covered here: https://guide.macports.org/chunked/development.local-repositories.html

If you're not aware, we have a guide to using git in a MacPorts context here: wiki:WorkingWithGit

If you need more realtime help, there's often someone able to help in the IRC channel (timezones can be a problem sometimes though with people scattered across the globe.)

comment:4 Changed 5 years ago by gctwnl

Before doing the final work on the nsd Portfile, I'd like to make sure I've got my MacPorts contribution environment setup right.

I've created a local repository. So, now I have

file:///Users/sysbh/MacPortsDev
rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]

in sources.conf

I've created a clone of the MacPorts repo in

/Users/sysbh/MacPortsDev/macports-ports

I've copied my changed Portfile over to

/Users/sysbh/MacPortsDev/macports-ports/net/nsd/Portfile

In that directory, I've ran 'git add Portfile' (it's all coming back to me, last time git was 2006 or so)

And I've edited the stuff about StartupItems to say

startupitem.create	yes
startupitem.executable	"${prefix}/sbin/nsd"

I had to put in a revision statement because otherwise the port would not install. I tried -f and -s to no avail.

I installed the new revision and it works. This is the diff:

diff --git a/net/nsd/Portfile b/net/nsd/Portfile
index 7fc3a3ddb05..a3b1d202688 100644
--- a/net/nsd/Portfile
+++ b/net/nsd/Portfile
@@ -3,11 +3,12 @@
 PortSystem          1.0
 
 name                nsd
-version             4.1.22
+version             4.2.1
+revision            1
 categories          net
 platforms           darwin
 license             BSD
-maintainers         nomaintainer
+maintainers         {rna.nl:gerben.wierda @gctwnl} openmaintainer
 
 description         Authoritative only, high performance, simple name server.
 long_description    NSD is an authoritative only, high performance, simple and \
@@ -19,9 +20,9 @@ set nsdgroup        nsd
 homepage            https://www.nlnetlabs.nl/projects/nsd/about/
 master_sites        https://www.nlnetlabs.nl/downloads/nsd/
 
-checksums           rmd160  f36762fa9b816ba63bf9a39a1df986b435219883 \
-                    sha256  f186e86705768a35ecb6ac18d1ee4eeec2745fcd1feab38e64f89c5eb5aa049c \
-                    size    1099463
+checksums           rmd160  79ba64d55ca1d473be16f00dbedf80e5122a13ce \
+                    sha256  d17c0ea3968cb0eb2be79f2f83eb299b7bfcc554b784007616eed6ece828871f \
+                    size    1145713
 
 depends_lib         port:libevent \
                     path:lib/libssl.dylib:openssl
@@ -57,3 +58,6 @@ variant stats description {Enable BIND8-style statistics} {
 livecheck.type  regex
 livecheck.url   ${master_sites}
 livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
+
+startupitem.create      yes
+startupitem.executable  "${prefix}/sbin/nsd"

I think this is the moment I need to do

git push origin

right? And then create a pull request on GitHub?

comment:5 Changed 5 years ago by gctwnl

Forget this comment. I forgot the -d flag for nsd to remain in the foreground.

Last edited 5 years ago by gctwnl (previous) (diff)

comment:6 in reply to:  4 Changed 5 years ago by jmroot (Joshua Root)

Replying to gctwnl:

I've created a local repository. So, now I have

file:///Users/sysbh/MacPortsDev
rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]

in sources.conf

From the info below it looks like the first line should be file:///Users/sysbh/MacPortsDev/macports-ports.

I've created a clone of the MacPorts repo in

/Users/sysbh/MacPortsDev/macports-ports

Usually you would want to fork the repo on GitHub first, since you won't be able to push to ours, and clone your fork.

I've copied my changed Portfile over to

/Users/sysbh/MacPortsDev/macports-ports/net/nsd/Portfile

In that directory, I've ran 'git add Portfile' (it's all coming back to me, last time git was 2006 or so)

And I've edited the stuff about StartupItems to say

startupitem.create	yes
startupitem.executable	"${prefix}/sbin/nsd"

Looks reasonable (with the -d flag you mentioned in the next comment.) Note that the double quotes are not necessary, but do no harm.

I had to put in a revision statement because otherwise the port would not install. I tried -f and -s to no avail.

If you already had version 4.2.1 installed, running port install again would do nothing. You would have to uninstall first to be able to install again. Please reset the revision to 0 before pushing.

I think this is the moment I need to do

git push origin

right? And then create a pull request on GitHub?

If origin is pointing to your fork, then yes. Normally you would push the specific branch that you made the commit on. (Making PRs from master is possible but you can't have multiple independent PRs going at once that way.)

comment:7 Changed 5 years ago by gctwnl

I've had to revert back to the wrapper for the startupitem. The reason is that daemondo expects the command not to go in the background and for nsd that means the -d flag. But the result of that is logging to stderr instead of to the log file, so no logging. Catching stderr in a startup item is not supported by daemondo and I've never seen it work from launchd (there is an entry in the plist, but it doesn't do anything).

I've given up on unified logging for now. syslog logging I would like to add a log rotation instruction to newsyslog (file in /etc/newsyslog.d/). Is that something that can be done automatically by a port?

comment:8 Changed 5 years ago by gctwnl

I have created a pull request for this update and an unbound issue fix/workaround

https://github.com/macports/macports-ports/pull/5032

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

Resolution: fixed
Status: newclosed
Version: 2.5.4

This got updated at some point, but not with the PR mentioned above.

comment:10 Changed 5 years ago by gctwnl

Correct. As a newbie I made some MacPorts procedural errors and someone (I don't recall who) fixed that so it became fixed in a different way.

Note: See TracTickets for help on using tickets.