From f5f312587247bdc63ae42dee1699f4c88c15ed51 Mon Sep 17 00:00:00 2001 From: Geoff Nixon Date: Thu, 23 Apr 2015 04:23:39 -0700 Subject: [PATCH] mandoc 1.13.3 Closes Homebrew/homebrew#38968. Signed-off-by: Misty De Meo --- Aliases/mdocml | 1 + Formula/mandoc.rb | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 120000 Aliases/mdocml create mode 100644 Formula/mandoc.rb diff --git a/Aliases/mdocml b/Aliases/mdocml new file mode 120000 index 0000000000..f9b7c26144 --- /dev/null +++ b/Aliases/mdocml @@ -0,0 +1 @@ +../Formula/mandoc.rb \ No newline at end of file diff --git a/Formula/mandoc.rb b/Formula/mandoc.rb new file mode 100644 index 0000000000..480faa5f49 --- /dev/null +++ b/Formula/mandoc.rb @@ -0,0 +1,78 @@ +class Mandoc < Formula + desc "The mandoc UNIX manpage compiler toolset" + homepage "http://mdocml.bsd.lv" + url "http://mdocml.bsd.lv/snapshots/mdocml-1.13.3.tar.gz" + sha256 "23ccab4800d50bf4c327979af5d4aa1a6a2dc490789cb67c4c3ac1bd40b8cad8" + + head "anoncvs@mdocml.bsd.lv:/cvs", :module => "mdocml", :using => :cvs + + option "without-sqlite", "Only install the mandoc/demandoc utilities." + option "without-cgi", "Don't build man.cgi (and extra CSS files)." + + depends_on "sqlite" => :recommended + + def install + localconfig = [ + + # Sane prefixes. + "PREFIX=#{prefix}", + "INCLUDEDIR=#{include}", + "LIBDIR=#{lib}", + "MANDIR=#{man}", + "WWWPREFIX=#{prefix}/var/www", + "EXAMPLEDIR=#{share}/examples", + + # Executable names, where utilities would be replaced/duplicated. + # The mdocml versions of the utilities are definitely *not* ready + # for prime-time on Darwin, though some changes in HEAD are promising. + # The "bsd" prefix (like bsdtar, bsdmake) is more informative than "m". + "BINM_MAN=bsdman", + "BINM_APROPOS=bsdapropos", + "BINM_WHATIS=bsdwhatis", + "BINM_MAKEWHATIS=bsdmakewhatis", # default is "makewhatis". + + # These are names for *section 7* pages only. Several other pages are + # prefixed "mandoc_", similar to the "groff_" pages. + "MANM_MAN=man", + "MANM_MDOC=mdoc", + "MANM_ROFF=mandoc_roff", # This is the only one that conflicts (groff). + "MANM_EQN=eqn", + "MANM_TBL=tbl", + + "OSNAME='Mac OS X #{MacOS.version}'", # Bottom corner signature line. + + # Not quite sure what to do here. The default ("/usr/share", etc.) needs + # sudoer privileges, or will error. So just brew's manpages for now? + "MANPATH_DEFAULT=#{HOMEBREW_PREFIX}/share/man", + + "HAVE_MANPATH=0", # Our `manpath` is a symlink to system `man`. + "STATIC=", # No static linking on Darwin. + + "HOMEBREWDIR=#{HOMEBREW_CELLAR}" # ? See configure.local.example, NEWS. + ] + + localconfig << "BUILD_DB=1" if build.with? "db" + localconfig << "BUILD_CGI=1" if build.with? "cgi" + File.rename("cgi.h.example", "cgi.h") # For man.cgi, harmless in any case. + + (buildpath/"configure.local").write localconfig.join("\n") + system "./configure" + + # I've tried twice to send a bug report on this to tech@mdocml.bsd.lv. + # In theory, it should show up with: + # search.gmane.org/?query=jobserver&group=gmane.comp.tools.mdocml.devel + ENV.deparallelize do + system "make" + system "make", "install" + end + + system "make", "manpage" # Left out of the install for some reason. + bin.install "manpage" + end + + test do + system "mandoc", "-Thtml", + "-Ostyle=#{share}/examples/example.style.css", + "#{HOMEBREW_PREFIX}/share/man/man1/brew.1" + end +end