Index: files/patch-man_Makefile.in.diff
===================================================================
--- files/patch-man_Makefile.in.diff	(revision 0)
+++ files/patch-man_Makefile.in.diff	(revision 0)
@@ -0,0 +1,55 @@
+--- man/Makefile.in.orig	2016-05-28 19:57:27.000000000 -0400
++++ man/Makefile.in	2016-05-28 19:58:17.000000000 -0400
+@@ -544,40 +544,40 @@
+ 
+ 
+ w_of_z.3 : w_of_z.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ im_w_of_x.3 : w_of_z.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ dawson.3 : dawson.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ cdawson.3 : dawson.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ cerf.3 : cerf.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ cerfc.3 : cerf.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ erfcx.3 : erfcx.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ cerfcx.3 : erfcx.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ erfi.3 : erfi.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ cerfi.3 : erfi.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ voigt.3 : voigt.pod
+-	pod2man -s 3 -c "libcerf manual" $< > $@
++	pod2man5.10.0 -s 3 -c "libcerf manual" $< > $@
+ 
+ %.html : %.pod
+-	pod2html --title="libcerf - Complex error, Faddeeva, Dawson, and Voigt functions" --noindex $< > $@
++	pod2html5.10.0 --title="libcerf - Complex error, Faddeeva, Dawson, and Voigt functions" --noindex $< > $@
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
Index: Portfile
===================================================================
--- Portfile	(revision 149079)
+++ Portfile	(working copy)
@@ -17,6 +17,11 @@
 master_sites        http://apps.jcns.fz-juelich.de/src/libcerf \
                     http://apps.jcns.fz-juelich.de/src/libcerf/old
 
+# see https://trac.macports.org/ticket/51505
+if {[file exists /usr/bin/pod2man5.10.0] && [file exists /usr/bin/pod2html5.10.0]} {
+    patchfiles-append   patch-man_Makefile.in.diff
+}
+
 checksums           rmd160  d90dd82fd0561e0070dbf736b268a5b1e8d1a148 \
                     sha256  101265dd1e1b10339adb70b22b60e65ef12c4e01c4a3f52e508562eceef62272
 extract.suffix      .tgz
