Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Operating System (http://www.mac-forums.com/forums/os-x-operating-system/)
-   -   How do I create a package (http://www.mac-forums.com/forums/os-x-operating-system/241113-how-do-i-create-package.html)

aecaudel 06-12-2011 12:49 AM

How do I create a package
 
First of all, let me say I'm aware of PackageManager. But as best as I can tell that app is for creating an application. The type of package I want to create will simply hold files. VMWare uses these as do some DVD creators.

MacsWork 06-12-2011 08:44 PM

You may have heard of PackageManager, but have you heard of Google?

Google

aecaudel 06-12-2011 09:20 PM

OF COURSE! Most of the results referred to PackageManager. No Help.

Slydude 06-13-2011 12:55 AM

What are you trying to distribute? Could you do it as a zip archive?

vansmith 06-13-2011 01:10 AM

You'll need to be more specific especially if a zip archive is insufficient. What are you trying to accomplish? What kind of files are you working with? There are some other compression formats available to you beyond zip (tar, gunzip, bunzip2) if an archive is needed and zip doesn't work.

MacsWork 06-13-2011 08:29 AM

How to Programmatically Create a Mac OS X Package (from the command-line or a shell script).

Note that any lines ending with a backslash should be one line; they've been broken here for a narrower display width.
Set up the files you want to package in a folder called dstroot:
% mkdir ./dstroot
% mkdir -p ./dstroot/usr/local/bin/ \
dstroot/usr/local/share/man/man1/
% install -m 755 myprog ./dstroot/usr/local/bin/
% install -m 644 myprog.1 \
./dstroot/usr/local/share/man/man1/
Create a package info file (this has nothing to do with Fink info files). Either copy one from another .pkg to use as a template, or see this pkg info file from osxutils.

Make the package:
% find dstroot -name .DS_Store -delete
% sudo chown -R root:staff dstroot
% package dstroot mypackage-0.1.info -d . -ignoreDSStore
% rm -f 1
% install -m 644 README.txt \
mypackage-0.1.pkg/Contents/Resources/ReadMe.txt
% install -m 644 LICENSE.txt \
mypackage-0.1.pkg/Contents/Resources/License.txt
% sudo chown -R root:staff \
mypackage-0.1.pkg/Contents/Resource
% tar -h mypackage-0.1.pkg -cf mypackage-0.1.pkg.tar
% gzip -9 mypackage-0.1.pkg.tar
See an example Makefile from the osxutils package which builds a .pkg from the command line at SourceForge.


All times are GMT -4. The time now is 05:31 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.