Skip to content

Instantly share code, notes, and snippets.

@mkyed
Created January 15, 2016 11:18
Show Gist options
  • Save mkyed/8a317d24b99c960e2546 to your computer and use it in GitHub Desktop.
Save mkyed/8a317d24b99c960e2546 to your computer and use it in GitHub Desktop.
PowerDNS (pdns) server with mysql backend on Mac OS X El Capitan
brew install pdns
@mkyed
Copy link
Author

mkyed commented Jan 15, 2016

El Capitan limits access to /System and there seems to be changes to launchd files. This works in /Library/LaunchDaemons/pdns_server.plist;

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>pdns_server</string>
        <key>ProgramArguments</key>
        <array>
        <string>/usr/local/sbin/pdns_server</string>
        <string>--config-dir=/usr/local/etc/</string>
        </array>
        <key>EnvironmentVariables</key>
        <dict>
                <key>DYLD_LIBRARY_PATH</key>
                <string>/usr/local/mysql/lib</string>
        </dict>
        <key>KeepAlive</key>
        <true/>
</dict>   
</plist> 

@mkyed
Copy link
Author

mkyed commented Jan 15, 2016

$ git diff master Library/Formula/pdns.rb

diff --git a/Library/Formula/pdns.rb b/Library/Formula/pdns.rb
index 5cd05f6..676a403 100644
--- a/Library/Formula/pdns.rb
+++ b/Library/Formula/pdns.rb
@@ -21,13 +21,14 @@ class Pdns < Formula

   option "with-pgsql", "Enable the PostgreSQL backend"

-  deprecated_option "pgsql" => "with-pgsql"
+  option "mysql", "Enable the MySQL backend"

   depends_on "pkg-config" => :build
   depends_on "boost"
   depends_on "lua"
   depends_on "sqlite"
-  depends_on :postgresql if build.with? "pgsql"
+  depends_on "bind"
+  depends_on :mysql if build.include? "mysql"

   def install
     # https://github.com/Homebrew/homebrew/pull/33739
@@ -38,8 +39,8 @@ class Pdns < Formula
             "--with-sqlite3"]

     # Include the PostgreSQL backend if requested
-    if build.with? "pgsql"
-      args << "--with-modules=gsqlite3 gpgsql"
+    if build.include? "mysql"
+      args << "--with-modules=gsqlite3 bind gmysql"
     else
       # SQLite3 backend only is the default
       args << "--with-modules=gsqlite3"

@mkyed
Copy link
Author

mkyed commented Jan 15, 2016

brew reinstall pdns --build-from-source --mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment