Tag Archives: packaging

Using munki-pkg

pkg-235

Greg Neagle released a new tool named munki-pkg, that gives Admins a super quick way to create packages for deployments. it’s not a replacement for the luggage if you’re already using it. But for me, it’s exactly what I needed. I’ve tried the luggage on more then one occasion and just can’t seem to get it down.

So taking my last post about creating a Policy Banner. I’m going to use munki-pkg to create a pkg so I can deploy it to lab machines. Once you’ve downloaded munki-pkg. I moved the executable to /usr/local/bin so it’s in my search path. other wise you simply have to drag the executable to terminal to get the path.

To create a new project, open Terminal and run “munkipkg –create name_of_folder”. For me it looks like this.

cd ~/Desktop
munkipkg --create PolicyBanner

That should create a new folder with the following:

– build (directory)
– build-info.plist
– payload (directory)
– scripts (directory)

Screen Shot 2015-07-31 at 7.39.43 PM

build: Don’t touch this folder. This is where the newly creating package will go.

build-info.plist: This is a default template that should be edited. Open it in a text editor or Xcode. I typically edit “identifier” and change it to something appropriate for my company. Like, com.company.pkg.PolicyBanner. For other options check out the munki-pkg page for usage and instructions.

payload: Inside the payload folder create the folder structure you need. For my example it looks like: payload > Library > Security > PolicyBanner.rtfd

Screen Shot 2015-07-31 at 7.52.13 PM

scripts: If you have a preinstall or postnatal script, put them in this folder with those exact names and make sure they are executable

Then open terminal and run the command, “munkipkg pathtofolder”, my example is:

munkipkg /Users/nscott/Desktop/PolicyBanner

You should see some random output and the terminal should come back to the prompt. Check the build folder. You should see a pkg file that can be deployed via your favorite software distribution tool (don’t forget to test, test, test).

Screen Shot 2015-07-31 at 7.55.09 PM

That’s the quick and dirty. That’s it!

if you’ve never ventured into the world of packaging your own apps and scripts. Other tools can be very intimidating for beginners … so try munki-pkg and start packaging like a MacAdmin.