{"action":"created","issue":{"url":"https://api.github.com/repos/rebar/rebar3/issues/808","labels_url":"https://api.github.com/repos/rebar/rebar3/issues/808/labels{/name}","comments_url":"https://api.github.com/repos/rebar/rebar3/issues/808/comments","events_url":"https://api.github.com/repos/rebar/rebar3/issues/808/events","html_url":"https://github.com/rebar/rebar3/issues/808","id":106486334,"number":808,"title":"Support for pulling in application specific vars from file","user":{"login":"zugolosian","id":1028354,"avatar_url":"https://avatars.githubusercontent.com/u/1028354?v=3","gravatar_id":"","url":"https://api.github.com/users/zugolosian","html_url":"https://github.com/zugolosian","followers_url":"https://api.github.com/users/zugolosian/followers","following_url":"https://api.github.com/users/zugolosian/following{/other_user}","gists_url":"https://api.github.com/users/zugolosian/gists{/gist_id}","starred_url":"https://api.github.com/users/zugolosian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zugolosian/subscriptions","organizations_url":"https://api.github.com/users/zugolosian/orgs","repos_url":"https://api.github.com/users/zugolosian/repos","events_url":"https://api.github.com/users/zugolosian/events{/privacy}","received_events_url":"https://api.github.com/users/zugolosian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-15T06:03:42Z","updated_at":"2015-09-15T20:19:52Z","closed_at":null,"body":"I'd like to use the rebar3 templating system to create a template for building a debian package in a similar way to https://github.com/basho/node_package/blob/develop/priv/templates/deb/Makefile.bootstrap\r\n\r\nBecause making a debian package requires a fair number of variables that aren't global It'd be nice to have a way to pull those variables from a file. If this is already possible and I'm just not reading the documentation correctly feel free to give me a virtual slap and a point in the right direction.\r\n\r\nCheers"},"comment":{"url":"https://api.github.com/repos/rebar/rebar3/issues/comments/140525564","html_url":"https://github.com/rebar/rebar3/issues/808#issuecomment-140525564","issue_url":"https://api.github.com/repos/rebar/rebar3/issues/808","id":140525564,"user":{"login":"zugolosian","id":1028354,"avatar_url":"https://avatars.githubusercontent.com/u/1028354?v=3","gravatar_id":"","url":"https://api.github.com/users/zugolosian","html_url":"https://github.com/zugolosian","followers_url":"https://api.github.com/users/zugolosian/followers","following_url":"https://api.github.com/users/zugolosian/following{/other_user}","gists_url":"https://api.github.com/users/zugolosian/gists{/gist_id}","starred_url":"https://api.github.com/users/zugolosian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zugolosian/subscriptions","organizations_url":"https://api.github.com/users/zugolosian/orgs","repos_url":"https://api.github.com/users/zugolosian/repos","events_url":"https://api.github.com/users/zugolosian/events{/privacy}","received_events_url":"https://api.github.com/users/zugolosian/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T20:19:52Z","updated_at":"2015-09-15T20:19:52Z","body":"So what I'm wanting to do is create a skeleton of what's required to make a debian package out of a release. So you'd use `rebar3 tar` to create a tarball of the release and then use `rebar3 new deb` to make the required files to make a debian package. Here's an example template\r\n```\r\n%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-\r\n%%\r\n{variables, [\r\n             {package_name, \"package_name\"},\r\n             {package_install_name, \"package_install_name\"},\r\n             {package_install_user, \"package_install_user\"},\r\n             {package_install_user_desc, \"package_install_user_desc\"},\r\n             {package_install_group, \"package_install_group\"},\r\n             {package_replacement_line, \"{{package_replacement_line_debian}}\"},\r\n             {package_conflicts_line, \"{{package_conflicts_line_debian}}\"},\r\n             {vendor_name, \"vendor_name\"},\r\n             {vendor_url, \"vendor_url\"},\r\n             {vendor_contact_name, \"vendor_contact_name\"},\r\n             {vendor_contact_email, \"vendor_contact_email\"},\r\n             {copyright, \"copyright\"},\r\n             {license_type, \"license_type\"},\r\n             {license_full_text, \"\"},\r\n             {bin_or_sbin, \"bin\"},\r\n\r\n             %% Platform Specific Settings\r\n             {platform_bin_dir,  \"/usr/{{bin_or_sbin}}\"},\r\n             {platform_data_dir, \"/var/lib/{{package_install_name}}\"},\r\n             {platform_etc_dir,  \"/etc/{{package_install_name}}\"},\r\n             {platform_base_dir, \"/usr/lib/{{package_install_name}}\"},\r\n             {platform_lib_dir,  \"/usr/lib/{{package_install_name}}/lib\"},\r\n             {platform_log_dir,  \"/var/log/{{package_install_name}}\"}\r\n            ]\r\n}.\r\n{template, \"Makefile\", \"Makefile\"}.\r\n{template, \"compat\", \"compat\"}.\r\n{template, \"control\", \"control\"}.\r\n{template, \"copyright\", \"copyright\"}.\r\n{template, \"dirs\", \"dirs\"}.\r\n{template, \"postinst\", \"postinst\"}.\r\n{template, \"postrm\", \"postrm\"}.\r\n{template, \"rules\", \"rules\"}.\r\n{template, \"vars.config\", \"vars.config\"}.\r\n{template, \"init.script\", \"init.script\"}.\r\n```\r\nAnd here's an example of the vars\r\n```\r\n%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-\r\n%% ex: ts=4 sw=4 et\r\n\r\n%%\r\n%% Packaging\r\n%%\r\n{package_name, \"stanchion\"}.\r\n{package_install_name, \"stanchion\"}.\r\n{package_install_user, \"stanchion\"}.\r\n{package_install_group, \"riak\"}.\r\n{package_install_user_desc, \"Stanchion user\"}.\r\n{package_shortdesc, \"Request Serialization Application\"}.\r\n{package_desc, \"Request Serialization Application\"}.\r\n{package_commands, {list, [[{name, \"stanchion\"}]]}}.\r\n{package_patch_dir, \"basho-patches\"}.\r\n{bin_or_sbin, \"sbin\"}.\r\n{license_type, \"Apache 2\"}.\r\n{copyright, \"2013 Basho Technologies, Inc\"}.\r\n{vendor_name, \"Basho Technologies, Inc\"}.\r\n{vendor_url, \"http://basho.com\"}.\r\n{vendor_contact_name, \"Basho Package Maintainer\"}.\r\n{vendor_contact_email, \"packaging@basho.com\"}.\r\n{license_full_text,\r\n \"This file is provided to you under the Apache License,\\n\"\r\n \"Version 2.0 (the \\\"License\\\"); you may not use this file\\n\"\r\n \"except in compliance with the License. You may obtain\\n\"\r\n \"a copy of the License at\\n\"\r\n \"\\n\"\r\n \" http://www.apache.org/licenses/LICENSE-2.0\\n\"\r\n \"\\n\"\r\n \"Unless required by applicable law or agreed to in writing,\\n\"\r\n \"software distributed under the License is distributed on an\\n\"\r\n \"\\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\n\"\r\n \"KIND, either express or implied. See the License for the\\n\"\r\n \"specific language governing permissions and limitations\\n\"\r\n \"under the License.\"}.\r\n{solaris_pkgname, \"BASHOstanchion\"}.\r\n```"}}