{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/osquery/issues/3389","repository_url":"https://api.github.com/repos/facebook/osquery","labels_url":"https://api.github.com/repos/facebook/osquery/issues/3389/labels{/name}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/3389/comments","events_url":"https://api.github.com/repos/facebook/osquery/issues/3389/events","html_url":"https://github.com/facebook/osquery/pull/3389","id":234596352,"number":3389,"title":"make_osx_package.sh: Add a way to include extra files in the package","user":{"login":"nbigaouette-eai","id":25907218,"avatar_url":"https://avatars0.githubusercontent.com/u/25907218?v=3","gravatar_id":"","url":"https://api.github.com/users/nbigaouette-eai","html_url":"https://github.com/nbigaouette-eai","followers_url":"https://api.github.com/users/nbigaouette-eai/followers","following_url":"https://api.github.com/users/nbigaouette-eai/following{/other_user}","gists_url":"https://api.github.com/users/nbigaouette-eai/gists{/gist_id}","starred_url":"https://api.github.com/users/nbigaouette-eai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbigaouette-eai/subscriptions","organizations_url":"https://api.github.com/users/nbigaouette-eai/orgs","repos_url":"https://api.github.com/users/nbigaouette-eai/repos","events_url":"https://api.github.com/users/nbigaouette-eai/events{/privacy}","received_events_url":"https://api.github.com/users/nbigaouette-eai/received_events","type":"User","site_admin":false},"labels":[{"id":196858822,"url":"https://api.github.com/repos/facebook/osquery/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false},{"id":118805366,"url":"https://api.github.com/repos/facebook/osquery/labels/macOS","name":"macOS","color":"d4c5f9","default":false},{"id":144337630,"url":"https://api.github.com/repos/facebook/osquery/labels/needs%20response","name":"needs response","color":"f7c6c7","default":false},{"id":408447576,"url":"https://api.github.com/repos/facebook/osquery/labels/packaging","name":"packaging","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-08T17:12:22Z","updated_at":"2017-06-16T01:02:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/3389","html_url":"https://github.com/facebook/osquery/pull/3389","diff_url":"https://github.com/facebook/osquery/pull/3389.diff","patch_url":"https://github.com/facebook/osquery/pull/3389.patch"},"body":"We need to customize a little bit the package created by `make_osx_package.sh` to include extra files. With the current structure of the script, it is not possible to inject those files into the package creation steps; the [temporary directory gets deleted](https://github.com/facebook/osquery/blob/e0a24fb0/tools/deployment/make_osx_package.sh#L181-L182) and nothing else can be copied to it before [`pkgbuild` gets called](https://github.com/facebook/osquery/blob/e0a24fb0/tools/deployment/make_osx_package.sh#L239).\r\n\r\nThis PR adds a mechanism to add extra files and directory to the built package. It does so through the `OSQUERY_PKG_INCLUDE_DIRS` environment variable (bash array). A loop will copy the content of every entries of the variable in `$INSTALL_PREFIX/`, overwriting any collision. So for example if `OSQUERY_PKG_INCLUDE_DIRS=(dir1 dir2)` and those two directories have:\r\n```\r\ndir1\r\n└── subdir\r\n    └── sub\r\n        └── sub\r\n            └── testfile1.txt\r\ndir2\r\n└── subdir\r\n    └── sub\r\n        └── sub\r\n            └── testfile2.txt\r\n\r\n6 directories, 2 files\r\n```\r\nThen the package would install the two files `/subdir/sub/sub/testfile1.txt` and `/subdir/sub/sub/testfile2.txt`.\r\n\r\nThis allows us to, for example, add extra configuration files in `/private/var/osquery/osquery.conf.d/`, on top of the custom configuration `/private/var/osquery/osquery.conf` that gets used using the `-c`/`--config` script flag. We might also use it for other purposes, hence the usage of a bash array.\r\n\r\nI haven't modified the Linux nor the Windows scripts though, I wanted to gather advice on this first."},"comment":{"url":"https://api.github.com/repos/facebook/osquery/issues/comments/308904785","html_url":"https://github.com/facebook/osquery/pull/3389#issuecomment-308904785","issue_url":"https://api.github.com/repos/facebook/osquery/issues/3389","id":308904785,"user":{"login":"theopolis","id":981645,"avatar_url":"https://avatars0.githubusercontent.com/u/981645?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolis","html_url":"https://github.com/theopolis","followers_url":"https://api.github.com/users/theopolis/followers","following_url":"https://api.github.com/users/theopolis/following{/other_user}","gists_url":"https://api.github.com/users/theopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolis/subscriptions","organizations_url":"https://api.github.com/users/theopolis/orgs","repos_url":"https://api.github.com/users/theopolis/repos","events_url":"https://api.github.com/users/theopolis/events{/privacy}","received_events_url":"https://api.github.com/users/theopolis/received_events","type":"User","site_admin":false},"created_at":"2017-06-16T01:02:04Z","updated_at":"2017-06-16T01:02:04Z","body":"ok to test"}}
{"actor":{"display_login":"theopolis"}}