{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/46688780","id":46688780,"diff_hunk":"@@ -0,0 +1,106 @@\n+class Apcupsd < Formula\n+  desc \"Daemon for controlling APC UPSes\"\n+  homepage \"http://www.apcupsd.org\"\n+  url \"https://downloads.sourceforge.net/project/apcupsd/apcupsd%20-%20Stable/3.14.13/apcupsd-3.14.13.tar.gz\"\n+  sha256 \"57ecbde01d0448bf8c4dbfe0ad016724ae66ab98adf2de955bf2be553c5d03f9\"\n+\n+  option \"with-usb\", \"Build with support for USB UPSes.\"\n+\n+  depends_on \"gd\"\n+  depends_on \"libusb-compat\"\n+\n+  def install\n+    cd \"src/apcagent\" do\n+      # Install apcagent.app to `prefix` instead of /Applications.\n+      inreplace \"Makefile\", \"Applications\", \"#{\"#{prefix}\".gsub(%r{/^\\//}, \"\")}\"\n+    end\n+\n+    sysconfdir = \"#{etc}/apcupsd\"\n+\n+    cd \"platforms/darwin\" do\n+      # Install binaries to `prefix`.\n+      # Patch submitted to upstream repo:\n+      #   https://sourceforge.net/p/apcupsd/mailman/message/34627459/\n+      inreplace \"Makefile\", \"/sbin\", \"$(sbindir)\"\n+\n+      # Install the LaunchDaemon and kernel extension to `prefix`.\n+      inreplace \"Makefile\", \"/Library/LaunchDaemons\", \"#{prefix}/Library/LaunchDaemons\"\n+      inreplace \"Makefile\", \"/System/Library/Extensions\", kext_prefix\n+\n+      # Tell the launch script and LaunchDaemon to use the appropriate sbin and config directories.\n+      inreplace \"apcupsd-start\", \"/sbin\", opt_sbin\n+      inreplace \"apcupsd-start\", \"/etc/apcupsd\", sysconfdir\n+      inreplace \"org.apcupsd.apcupsd.plist\", \"/sbin\", opt_sbin\n+      inreplace \"org.apcupsd.apcupsd.plist\", \"/etc/apcupsd\", sysconfdir\n+\n+      # Custom uninstaller is not needed as everything is installed to `prefix`.\n+      inreplace \"Makefile\", /.*apcupsd-uninstall.*/, \"\"\n+    end\n+\n+    args = [\n+      \"--disable-option-checking\",\n+      \"--prefix=#{prefix}\",\n+      \"--sbindir=#{sbin}\",\n+      \"--sysconfdir=#{sysconfdir}\",\n+      \"--with-cgi-bin=#{sysconfdir}\",\n+      \"--enable-cgi\",\n+    ]\n+\n+    args << \"--enable-usb\" << \"--enable-modbus-usb\" if build.with? \"usb\"\n+\n+    system \"./configure\", *args\n+    system \"make\", \"install\"\n+  end\n+\n+  def caveats\n+    s = <<-EOS.undent\n+      The #{name} configuration files are located here:\n+        #{etc}/apcupsd\n+\n+    EOS\n+\n+    if build.with? \"usb\"\n+      if MacOS.version >= :el_capitan\n+        s += <<-EOS.undent\n+          Note: On OS X El Capitan and above, System Integrity Protection (SIP)\n+          prevents the #{name} kernel extension from loading, which is needed\n+          to communicate with UPSes connected via USB.\n+\n+          You will have to unplug and plug the USB cable back in after each\n+          reboot in order for #{name} to be able to connect to the UPS.\n+\n+        EOS\n+      else\n+        s += <<-EOS.undent\n+          For #{name} to be able to communicate with UPSes connected via USB,\n+          the #{name} kernel extension must be installed by the root user:\n+\n+            sudo cp -pR #{kext_prefix}/ApcupsdDummy.kext /System/Library/Extensions/\n+            sudo chown -R root:wheel /System/Library/Extensions/ApcupsdDummy.kext\n+            sudo touch /System/Library/Extensions/","path":"Library/Formula/apcupsd.rb","position":80,"original_position":80,"commit_id":"dab9eaa27f8840ed8ba6c9826a932496b9fe7383","original_commit_id":"dab9eaa27f8840ed8ba6c9826a932496b9fe7383","user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"body":"We'll need to verify if this works on 10.11 with SIP enabled.","created_at":"2015-12-04T14:50:45Z","updated_at":"2015-12-04T14:50:45Z","html_url":"https://github.com/Homebrew/homebrew/pull/45899#discussion_r46688780","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/46688780"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/45899#discussion_r46688780"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899","id":50437583,"html_url":"https://github.com/Homebrew/homebrew/pull/45899","diff_url":"https://github.com/Homebrew/homebrew/pull/45899.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/45899.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/45899","number":45899,"state":"open","locked":false,"title":"apcupsd 3.14.13 (new formula)","user":{"login":"reitermarkus","id":1309829,"avatar_url":"https://avatars.githubusercontent.com/u/1309829?v=3","gravatar_id":"","url":"https://api.github.com/users/reitermarkus","html_url":"https://github.com/reitermarkus","followers_url":"https://api.github.com/users/reitermarkus/followers","following_url":"https://api.github.com/users/reitermarkus/following{/other_user}","gists_url":"https://api.github.com/users/reitermarkus/gists{/gist_id}","starred_url":"https://api.github.com/users/reitermarkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reitermarkus/subscriptions","organizations_url":"https://api.github.com/users/reitermarkus/orgs","repos_url":"https://api.github.com/users/reitermarkus/repos","events_url":"https://api.github.com/users/reitermarkus/events{/privacy}","received_events_url":"https://api.github.com/users/reitermarkus/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-11T21:18:39Z","updated_at":"2015-12-04T14:50:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78ddc79b8da12cfa89883ac9d4fdee8cb32a6131","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/45899/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/dab9eaa27f8840ed8ba6c9826a932496b9fe7383","head":{"label":"reitermarkus:apcupsd","ref":"apcupsd","sha":"dab9eaa27f8840ed8ba6c9826a932496b9fe7383","user":{"login":"reitermarkus","id":1309829,"avatar_url":"https://avatars.githubusercontent.com/u/1309829?v=3","gravatar_id":"","url":"https://api.github.com/users/reitermarkus","html_url":"https://github.com/reitermarkus","followers_url":"https://api.github.com/users/reitermarkus/followers","following_url":"https://api.github.com/users/reitermarkus/following{/other_user}","gists_url":"https://api.github.com/users/reitermarkus/gists{/gist_id}","starred_url":"https://api.github.com/users/reitermarkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reitermarkus/subscriptions","organizations_url":"https://api.github.com/users/reitermarkus/orgs","repos_url":"https://api.github.com/users/reitermarkus/repos","events_url":"https://api.github.com/users/reitermarkus/events{/privacy}","received_events_url":"https://api.github.com/users/reitermarkus/received_events","type":"User","site_admin":false},"repo":{"id":43597478,"name":"homebrew","full_name":"reitermarkus/homebrew","owner":{"login":"reitermarkus","id":1309829,"avatar_url":"https://avatars.githubusercontent.com/u/1309829?v=3","gravatar_id":"","url":"https://api.github.com/users/reitermarkus","html_url":"https://github.com/reitermarkus","followers_url":"https://api.github.com/users/reitermarkus/followers","following_url":"https://api.github.com/users/reitermarkus/following{/other_user}","gists_url":"https://api.github.com/users/reitermarkus/gists{/gist_id}","starred_url":"https://api.github.com/users/reitermarkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reitermarkus/subscriptions","organizations_url":"https://api.github.com/users/reitermarkus/orgs","repos_url":"https://api.github.com/users/reitermarkus/repos","events_url":"https://api.github.com/users/reitermarkus/events{/privacy}","received_events_url":"https://api.github.com/users/reitermarkus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reitermarkus/homebrew","description":":beer: The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/reitermarkus/homebrew","forks_url":"https://api.github.com/repos/reitermarkus/homebrew/forks","keys_url":"https://api.github.com/repos/reitermarkus/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reitermarkus/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reitermarkus/homebrew/teams","hooks_url":"https://api.github.com/repos/reitermarkus/homebrew/hooks","issue_events_url":"https://api.github.com/repos/reitermarkus/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/reitermarkus/homebrew/events","assignees_url":"https://api.github.com/repos/reitermarkus/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/reitermarkus/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/reitermarkus/homebrew/tags","blobs_url":"https://api.github.com/repos/reitermarkus/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reitermarkus/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reitermarkus/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/reitermarkus/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reitermarkus/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/reitermarkus/homebrew/languages","stargazers_url":"https://api.github.com/repos/reitermarkus/homebrew/stargazers","contributors_url":"https://api.github.com/repos/reitermarkus/homebrew/contributors","subscribers_url":"https://api.github.com/repos/reitermarkus/homebrew/subscribers","subscription_url":"https://api.github.com/repos/reitermarkus/homebrew/subscription","commits_url":"https://api.github.com/repos/reitermarkus/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/reitermarkus/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/reitermarkus/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/reitermarkus/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/reitermarkus/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/reitermarkus/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reitermarkus/homebrew/merges","archive_url":"https://api.github.com/repos/reitermarkus/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reitermarkus/homebrew/downloads","issues_url":"https://api.github.com/repos/reitermarkus/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/reitermarkus/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/reitermarkus/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/reitermarkus/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reitermarkus/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/reitermarkus/homebrew/releases{/id}","created_at":"2015-10-03T11:53:39Z","updated_at":"2015-10-03T11:54:07Z","pushed_at":"2015-12-01T16:00:31Z","git_url":"git://github.com/reitermarkus/homebrew.git","ssh_url":"git@github.com:reitermarkus/homebrew.git","clone_url":"https://github.com/reitermarkus/homebrew.git","svn_url":"https://github.com/reitermarkus/homebrew","homepage":"http://brew.sh","size":62225,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"5171f2a0b280fa8675f23f67ba85b99810d1cc44","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-12-04T14:35:22Z","pushed_at":"2015-12-04T14:32:02Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1407335,"stargazers_count":27645,"watchers_count":27645,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":13708,"mirror_url":null,"open_issues_count":536,"forks":13708,"open_issues":536,"watchers":27645,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/45899"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/45899"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/45899/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/45899/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/dab9eaa27f8840ed8ba6c9826a932496b9fe7383"}}}}