{"action":"created","comment":{"url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/comments/77864839","id":77864839,"diff_hunk":"@@ -0,0 +1,331 @@\n+#!/bin/bash\n+\n+# Put everything in one big function so that if this script is executed after a\n+# partial download it doesn't do anything.\n+function build_ngx_pagespeed() {\n+  getopt --test\n+  if [ \"$?\" != 4 ]; then\n+    echo \"Your version of getopt is too old.  Exiting with no changes made.\"\n+    # Even Centos 5 and Ubuntu 10 LTS have new-style getopt, so I don't expect\n+    # this to be hit in practice on systems that are actually able to run\n+    # PageSpeed.\n+    exit 1\n+  fi\n+\n+  # If we set -e or -u then users of this script will see it silently exit on\n+  # failure.  Instead we need to check the exit status of each command\n+  # manually.  The run function (see below) handles exit-status checking for\n+  # system-changing commands.\n+\n+  function usage() {\n+    echo \"\n+Usage: build_ngx_pagespeed.sh [options]\n+Options:\n+  -v, --version <ngx_pagespeed version>\n+      What version of ngx_pagespeed to build.  Required.\n+\n+  -n, --nginx <nginx version>\n+      What version of nginx to build.  If not set, this script only prepares the\n+      ngx_pagespeed module, and expects you to handle including it when you\n+      build nginx.\n+\n+  -b, --builddir <directory>\n+      Where to build.  Defaults to \\$HOME.\n+\n+  -p, --depsinstalled\n+      By default, this script checks for the packages it depends on and tries to\n+      install them.  If you have installed dependencies from source or are on a\n+      non-deb non-rpm system, this won't work.  In that case, you can install\n+      the dependencies yourself and pass in --depsinstalled to skip this check.\n+\n+  -d, --dryrun\n+      Don't make any changes to the system, just print what changes you\n+      would have made.\n+\n+  -h, --help\n+      Print this message and exit.\"\n+  }\n+\n+  opts=$(getopt -o v:n:b:pdh \\\n+    --longoptions version:,nginx:,buildir:,depsinstalled,dryrun,help \\\n+    -n \"$(basename \"$0\")\" -- \"$@\")\n+  if [ $? != 0 ]; then\n+    usage\n+    exit 1\n+  fi\n+  eval set -- \"$opts\"\n+\n+  NPS_VERSION=\"\"\n+  NGINX_VERSION=\"\"\n+  BUILDDIR=\"$HOME\"\n+  DEPSINSTALLED=false\n+  DRYRUN=false\n+  while true; do\n+    case \"$1\" in\n+      -v | --version) shift\n+        NPS_VERSION=\"$1\"\n+        shift\n+        ;;\n+      -n | --nginx) shift\n+        NGINX_VERSION=\"$1\"\n+        shift\n+        ;;\n+      -b | --builddir) shift\n+        BUILDDIR=\"$1\"\n+        shift\n+        ;;\n+      -p | --depsinstalled) shift\n+        DEPSINSTALLED=true\n+        ;;\n+      -d | --dryrun) shift\n+        DRYRUN=\"true\"\n+        ;;\n+      -h | --help) shift\n+        usage\n+        exit 0\n+        ;;\n+      --) shift\n+        break\n+        ;;\n+      *)\n+        echo \"Invalid argument: $1\"\n+        usage\n+        exit 1\n+        ;;\n+    esac\n+  done\n+\n+  if [ -z \"$NPS_VERSION\" ]; then\n+    echo \"Please pass --version <ngx_pagespeed version>\"\n+    usage\n+    exit 1\n+  fi\n+\n+  # We pass all commands through run() so that in a dryrun we don't actually\n+  # make any changes.\n+  function run() {\n+    if \"$DRYRUN\"; then\n+      echo \"would run $@\"\n+    else\n+      if ! \"$@\"; then\n+        echo \"Failure running $@, exiting.\"\n+        exit 1\n+      fi\n+    fi\n+  }\n+\n+  function redhat_is_installed() {\n+    local package_name=\"$1\"\n+    rpm -qa $package_name | grep -q .\n+  }\n+\n+  function debian_is_installed() {\n+    local package_name=\"$1\"\n+    dpkg -l $package_name | grep ^ii | grep -q .\n+  }\n+\n+  function install_dependencies() {\n+    local install=\"$1\"","path":"scripts/build_ngx_pagespeed.sh","position":128,"original_position":128,"commit_id":"753de64ff55529b2a98c5d05ef74e6ee5122f48f","original_commit_id":"753de64ff55529b2a98c5d05ef74e6ee5122f48f","user":{"login":"hillsp","id":7683950,"avatar_url":"https://avatars.githubusercontent.com/u/7683950?v=3","gravatar_id":"","url":"https://api.github.com/users/hillsp","html_url":"https://github.com/hillsp","followers_url":"https://api.github.com/users/hillsp/followers","following_url":"https://api.github.com/users/hillsp/following{/other_user}","gists_url":"https://api.github.com/users/hillsp/gists{/gist_id}","starred_url":"https://api.github.com/users/hillsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hillsp/subscriptions","organizations_url":"https://api.github.com/users/hillsp/orgs","repos_url":"https://api.github.com/users/hillsp/repos","events_url":"https://api.github.com/users/hillsp/events{/privacy}","received_events_url":"https://api.github.com/users/hillsp/received_events","type":"User","site_admin":false},"body":"Better: install_pkg_cmd, is_pkg_installed_cmd","created_at":"2016-09-07T17:08:17Z","updated_at":"2016-09-07T17:08:17Z","html_url":"https://github.com/pagespeed/ngx_pagespeed/pull/1263#discussion_r77864839","pull_request_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263","_links":{"self":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/comments/77864839"},"html":{"href":"https://github.com/pagespeed/ngx_pagespeed/pull/1263#discussion_r77864839"},"pull_request":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263"}}},"pull_request":{"url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263","id":83822066,"html_url":"https://github.com/pagespeed/ngx_pagespeed/pull/1263","diff_url":"https://github.com/pagespeed/ngx_pagespeed/pull/1263.diff","patch_url":"https://github.com/pagespeed/ngx_pagespeed/pull/1263.patch","issue_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/1263","number":1263,"state":"open","locked":false,"title":"install: add script to install nginx_pagespeed","user":{"login":"jeffkaufman","id":262566,"avatar_url":"https://avatars.githubusercontent.com/u/262566?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffkaufman","html_url":"https://github.com/jeffkaufman","followers_url":"https://api.github.com/users/jeffkaufman/followers","following_url":"https://api.github.com/users/jeffkaufman/following{/other_user}","gists_url":"https://api.github.com/users/jeffkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffkaufman/subscriptions","organizations_url":"https://api.github.com/users/jeffkaufman/orgs","repos_url":"https://api.github.com/users/jeffkaufman/repos","events_url":"https://api.github.com/users/jeffkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/jeffkaufman/received_events","type":"User","site_admin":false},"body":"Automated version of the instructions on https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source\r\n\r\nTested on fresh vms of debian8, centos 6 and 7, rhel 6 and 7, and ubuntu lts 12, 14, and 16\r\n\r\nFixes https://github.com/pagespeed/ngx_pagespeed/issues/1262","created_at":"2016-09-02T15:37:08Z","updated_at":"2016-09-07T17:08:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"740580ee47443b75431a3e9606b7b76c4adba316","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263/commits","review_comments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263/comments","review_comment_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/1263/comments","statuses_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/statuses/753de64ff55529b2a98c5d05ef74e6ee5122f48f","head":{"label":"pagespeed:jefftk-build-nps","ref":"jefftk-build-nps","sha":"753de64ff55529b2a98c5d05ef74e6ee5122f48f","user":{"login":"pagespeed","id":1880112,"avatar_url":"https://avatars.githubusercontent.com/u/1880112?v=3","gravatar_id":"","url":"https://api.github.com/users/pagespeed","html_url":"https://github.com/pagespeed","followers_url":"https://api.github.com/users/pagespeed/followers","following_url":"https://api.github.com/users/pagespeed/following{/other_user}","gists_url":"https://api.github.com/users/pagespeed/gists{/gist_id}","starred_url":"https://api.github.com/users/pagespeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagespeed/subscriptions","organizations_url":"https://api.github.com/users/pagespeed/orgs","repos_url":"https://api.github.com/users/pagespeed/repos","events_url":"https://api.github.com/users/pagespeed/events{/privacy}","received_events_url":"https://api.github.com/users/pagespeed/received_events","type":"Organization","site_admin":false},"repo":{"id":4766638,"name":"ngx_pagespeed","full_name":"pagespeed/ngx_pagespeed","owner":{"login":"pagespeed","id":1880112,"avatar_url":"https://avatars.githubusercontent.com/u/1880112?v=3","gravatar_id":"","url":"https://api.github.com/users/pagespeed","html_url":"https://github.com/pagespeed","followers_url":"https://api.github.com/users/pagespeed/followers","following_url":"https://api.github.com/users/pagespeed/following{/other_user}","gists_url":"https://api.github.com/users/pagespeed/gists{/gist_id}","starred_url":"https://api.github.com/users/pagespeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagespeed/subscriptions","organizations_url":"https://api.github.com/users/pagespeed/orgs","repos_url":"https://api.github.com/users/pagespeed/repos","events_url":"https://api.github.com/users/pagespeed/events{/privacy}","received_events_url":"https://api.github.com/users/pagespeed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pagespeed/ngx_pagespeed","description":"Automatic PageSpeed optimization module for Nginx","fork":false,"url":"https://api.github.com/repos/pagespeed/ngx_pagespeed","forks_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/forks","keys_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/teams","hooks_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/hooks","issue_events_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/events{/number}","events_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/events","assignees_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/assignees{/user}","branches_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/branches{/branch}","tags_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/tags","blobs_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/refs{/sha}","trees_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/statuses/{sha}","languages_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/languages","stargazers_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/stargazers","contributors_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/contributors","subscribers_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/subscribers","subscription_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/subscription","commits_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/commits{/sha}","git_commits_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/commits{/sha}","comments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/comments{/number}","issue_comment_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/comments{/number}","contents_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/contents/{+path}","compare_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/merges","archive_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/downloads","issues_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues{/number}","pulls_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls{/number}","milestones_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/milestones{/number}","notifications_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/labels{/name}","releases_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/releases{/id}","deployments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/deployments","created_at":"2012-06-23T18:30:14Z","updated_at":"2016-09-06T15:39:54Z","pushed_at":"2016-09-07T08:49:57Z","git_url":"git://github.com/pagespeed/ngx_pagespeed.git","ssh_url":"git@github.com:pagespeed/ngx_pagespeed.git","clone_url":"https://github.com/pagespeed/ngx_pagespeed.git","svn_url":"https://github.com/pagespeed/ngx_pagespeed","homepage":"http://ngxpagespeed.com/","size":44675,"stargazers_count":3151,"watchers_count":3151,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"open_issues_count":196,"forks":236,"open_issues":196,"watchers":3151,"default_branch":"master"}},"base":{"label":"pagespeed:trunk-tracking","ref":"trunk-tracking","sha":"94dde75a86c00a2614305cd09283f0f3a70ff25b","user":{"login":"pagespeed","id":1880112,"avatar_url":"https://avatars.githubusercontent.com/u/1880112?v=3","gravatar_id":"","url":"https://api.github.com/users/pagespeed","html_url":"https://github.com/pagespeed","followers_url":"https://api.github.com/users/pagespeed/followers","following_url":"https://api.github.com/users/pagespeed/following{/other_user}","gists_url":"https://api.github.com/users/pagespeed/gists{/gist_id}","starred_url":"https://api.github.com/users/pagespeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagespeed/subscriptions","organizations_url":"https://api.github.com/users/pagespeed/orgs","repos_url":"https://api.github.com/users/pagespeed/repos","events_url":"https://api.github.com/users/pagespeed/events{/privacy}","received_events_url":"https://api.github.com/users/pagespeed/received_events","type":"Organization","site_admin":false},"repo":{"id":4766638,"name":"ngx_pagespeed","full_name":"pagespeed/ngx_pagespeed","owner":{"login":"pagespeed","id":1880112,"avatar_url":"https://avatars.githubusercontent.com/u/1880112?v=3","gravatar_id":"","url":"https://api.github.com/users/pagespeed","html_url":"https://github.com/pagespeed","followers_url":"https://api.github.com/users/pagespeed/followers","following_url":"https://api.github.com/users/pagespeed/following{/other_user}","gists_url":"https://api.github.com/users/pagespeed/gists{/gist_id}","starred_url":"https://api.github.com/users/pagespeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagespeed/subscriptions","organizations_url":"https://api.github.com/users/pagespeed/orgs","repos_url":"https://api.github.com/users/pagespeed/repos","events_url":"https://api.github.com/users/pagespeed/events{/privacy}","received_events_url":"https://api.github.com/users/pagespeed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pagespeed/ngx_pagespeed","description":"Automatic PageSpeed optimization module for Nginx","fork":false,"url":"https://api.github.com/repos/pagespeed/ngx_pagespeed","forks_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/forks","keys_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/teams","hooks_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/hooks","issue_events_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/events{/number}","events_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/events","assignees_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/assignees{/user}","branches_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/branches{/branch}","tags_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/tags","blobs_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/refs{/sha}","trees_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/statuses/{sha}","languages_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/languages","stargazers_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/stargazers","contributors_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/contributors","subscribers_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/subscribers","subscription_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/subscription","commits_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/commits{/sha}","git_commits_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/git/commits{/sha}","comments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/comments{/number}","issue_comment_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/comments{/number}","contents_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/contents/{+path}","compare_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/merges","archive_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/downloads","issues_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues{/number}","pulls_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls{/number}","milestones_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/milestones{/number}","notifications_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/labels{/name}","releases_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/releases{/id}","deployments_url":"https://api.github.com/repos/pagespeed/ngx_pagespeed/deployments","created_at":"2012-06-23T18:30:14Z","updated_at":"2016-09-06T15:39:54Z","pushed_at":"2016-09-07T08:49:57Z","git_url":"git://github.com/pagespeed/ngx_pagespeed.git","ssh_url":"git@github.com:pagespeed/ngx_pagespeed.git","clone_url":"https://github.com/pagespeed/ngx_pagespeed.git","svn_url":"https://github.com/pagespeed/ngx_pagespeed","homepage":"http://ngxpagespeed.com/","size":44675,"stargazers_count":3151,"watchers_count":3151,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"open_issues_count":196,"forks":236,"open_issues":196,"watchers":3151,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263"},"html":{"href":"https://github.com/pagespeed/ngx_pagespeed/pull/1263"},"issue":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/1263"},"comments":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/issues/1263/comments"},"review_comments":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263/comments"},"review_comment":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/pulls/1263/commits"},"statuses":{"href":"https://api.github.com/repos/pagespeed/ngx_pagespeed/statuses/753de64ff55529b2a98c5d05ef74e6ee5122f48f"}}}}
{"actor":{"display_login":"hillsp"}}