6.4. Packaging Tools
- Download this app from Microsoft Store for Windows 10, Windows 8.1. See screenshots, read the latest customer reviews, and compare ratings for Gzip File Opener.
- Support for packages has been discontinued on Sunfreeware. Please Visit our New Website - UNIXPackages.com UNIX packages provides full package support for all levels of Solaris from 2.5, 2.6, 7. Through to Solaris 11 SVR4 style and *NEW* Solaris 11 IPS packages.
Before Introducing 7-Zip Alternatives, Let’s Get to Know What’s 7Z. 7z is the new archive format, providing high compression ratio. 7z has open architecture, so it can support any new compression methods.
6.4.1. Using PackageMaker
Gzip App For Mac
6.4.1.1. Setting up the directory
To demonstrate how to create a package, we'll use the hellow.c and hellow.1 examples shown earlier in this chapter (in Example 6-1 and Example 6-2).
PackageMaker expects you to set up the files using a directory structure that mirrors your intended installation. So, if you plan to install hellow into /usr/bin, and hellow.1 into /usr/share/man/man1, you'll need to create the appropriate subdirectories under your working directory.
Suppose that your hellow project resides in ~/src/hellow. To keep things organized, you can create a subdirectory called stage that contains the installation directory. In that case, you'd want to place the hellow binary in ~/src/hellow/stage/bin and the hellow.1 manpage in ~/src/hellow/stage/share/man/man1. The makefile shown in Example 6-4 compiles hellow.c, creates the stage directory and its subdirectories, and copies the distribution files into those directories when you run the command make prep.
WARNING: The directories you create in the stage directory should have the same permissions as the directories into which you are installing the package. If your umask is set so that the permissions are not right, use chmod in your makefile to correct the permissions after you create the staging directories.
To get started, you need only hellow.c, hellow.1, and makefile. When you run the command make prep, it compiles the program and copies the files to their locations in the stage directory. After that, you're ready to launch PackageMaker and bundle up the application.
6.4.1.2. Creating the package
Run PackageMaker and set the options as appropriate for your package. Figure 6-2 through Figure 6-6 show the settings for the hellow sample. The options are as follows:
- Description tab
- Contains items that describe the package so the person installing the package can find its name and version.
- Title
- The title, or name, of the package.
- Version
- The version number of the package.
- Description
- A description of the package.
- Delete Warning
- A custom warning message to display when a user removes the package. Mac OS X does not have a utility to uninstall a package, though.
Figure 6-2. PackageMaker's Description tab
- Files tab
- Contains information related to file locations and compression.
- Root
- This option indicates where PackageMaker can find the top-level staging directory.
- Compress Archive
- Resources tab
- Specifies the location of extra resources.
- Resources
- Info tab
- Specifies miscellaneous package options.
- Default Location
- This option indicates the default target location for the package.
- Restart Action
- If this option is set to Required Restart, the system must be rebooted when the installation is finished. Other options include No Restart Required, Recommended Restart, and Shutdown Required.
- Authorization Action
- Set this option to Root Authorization if the user needs to supply authentication to install the package. (This escalates the user's privileges to root temporarily.) Other options include No Authorization Required and Admin Authorization (if the user needs only to be an Admin user, but does not need to escalate privileges). If the package will be installed into a protected directory (such as /usr), you should use Root Authorization.
- Allows Back Rev.
- This option allows the user to install an older version of the package over a newer one.
- Install Fat
- This option supports multiple architecture binaries.
- Relocatable
- This option allows the user to choose an alternate location for the installed files.
- Required
- This option implies that certain packages (when installed as part of a larger install) are required.
- Root Volume Only
- This option requires that the user install the package on the current root volume (the volume from which you booted Mac OS X).
- Update Installed Languages Only
- When you update a package, this option will only update the currently installed localization projects.
- Overwrite Permissions
- Version tab
- Specifies detailed version information.
- Display name
- The name of the package to use when reporting its version
- Identifier
- A unique package name
- Get-Info string
- The version number to use when inspecting the package in the Finder with Get Info
- Short version
- An abbreviated version number
- Version: Major
- A major version number (the 1 in 1.0)
- Version: Minor
6.4.2. Using GNU tar
6.4.3. Disk Images
Many applications in Mac OS X do not require a special installer. Often, they can be installed by simply dragging the application's folder or icon to a convenient location in the directory structure, usually the /Applications folder. Applications that are distributed this way are typically packaged as a disk image. A disk image is a file that, when double-clicked, creates a virtual volume that is mounted on the user's desktop, as shown in Figure 6-7.
Figure 6-7. A disk image and its mounted volume
Inside ApplicationsActually, an application is a folder with the extension .app, which is typically hidden from the user. This folder contains all of the application's resources. To view the contents of an application bundle, Control-click on the application icon and select Show Package Contents from the pop-up menu. This will open the application's Contents folder in the Finder. |

The Unix command df will reveal a disk image as a mounted volume, and it will appear in the /Volumes directory. When you are done with the mounted volume, it can be ejected to unmount it. This is accomplished by clicking on the volume (in Figure 6-7, the mounted volume is named Fink 0.4.0a Installer) to select it and going to File Eject (-E). You could also drag the mounted volume to the Trash.
TIP: If you've used earlier versions of the Mac OS, you're probably familiar with the Put Away command (-Y); however, that command no longer exists for Mac OS X. Instead, you must use Eject to unmount a disk image.
6.4.3.1. Creating a disk image with Disk Copy
To create a disk image using Disk Copy, perform the following steps:
Launch Disk Copy (/Applications/Utilities).
Select File New Blank Image. Disk Copy prompts you for a name, location, size (the maximum size is limited by available disk space), volume name, format, and encryption options, as shown in Figure 6-8. If you choose to enable encryption, Disk Copy will prompt you for a passphrase.
Figure 6-8. Creating a new blank image with Disk Copy
Double-click on the disk icon to open the empty volume in a Finder window, as shown in Figure 6-9.
Figure 6-9. A blank disk image, ready to be loaded up with files
Select File New Finder Window (or -N) to open a new Finder window, where you can select the files you want to place in the disk image, as shown in Figure 6-10.
Figure 6-10. Copying a file to the disk image
Return to the Disk Copy application, select File Convert Image, locate the disk image file in the Convert Image window, and click on the Convert button, as shown in Figure 6-11.
Figure 6-11. Choosing the image to convert
The Convert Image window will change. Enter either a new name or the same name in the Save As field, and then select read-only from the Image Format pull-down menu, as shown in Figure 6-12. (You can also compress the disk image from this selection.)
Figure 6-12. Converting an image
6.4.4. Distributing Your Image
Copyright © 2003 O'Reilly & Associates. All rights reserved.
Free and low-cost third-party compression apps are available for the Mac, but Mac OS X and macOS both come with a built-in compression system that can zip and unzip files. This integrated system is relatively basic, which is why many third-party apps are also available. A quick look at the Mac App Store revealed more than 50 apps for zipping and unzipping files.
Before you download a third-party app, learn how to compress and decompress files and folders using the Archive Utility built into the Mac. It's a basic tool, but it gets the job done.
OS X and macOS Compression
The Archive Utility includes options that you can modify, but don't bother to look for it in the Applications folder; it's not there. Apple hides the utility because it's a core service of the operating system. Apple and app developers use core services to enhance an application's capabilities. For example, Mac Mail uses the Archive Utility to compress and decompress attachments; Safari uses it to decompress files you download.
The Archive Utility has settings you can modify, but most users never need them. Right now it is a better idea to get used to the utility as configured in its default state. You can always try new settings later.
The Archive Utility may be hidden away, but that doesn't mean you can't access its services. Apple makes zipping and unzipping files and folders extremely easy by selecting them in the Finder and using the Archive Utility.
Zipping a Single File or Folder
Open a Finder window and navigate to the file or folder you want to compress.
Control-click (or right-click if you have a mouse with that capability) the item and select Compress from the pop-up menu. The name of the item you select appears after the word Compress, so the actual menu item reads Compress 'item name.'
The Archive Utility zips the selected file. The original file or folder is left intact. The compressed version is in the same folder as the original file (or on the desktop, if that's where the file or folder is located), It has the same name as the original file with a .zip extension.
Zipping Multiple Files and Folders
Compressing multiple files and folders works about the same as compressing a single item. The only differences are in the names of the items that appear in the pop-up menu and the name of the zip file that is created.
Open the folder that contains the files or folders you want to compress.
Select the items you want to include in the zip file. Shift-click to select a range of files or Command-click to select nonadjacent items.
After you select all the files and folders you want to include in the zip file, right-click or Control-click on any one of the items and select Compress from the pop-up menu. This time, the word Compress is followed by the number of items you selected, such as Compress 5 Items.
When the compression is finished, the items are stored in a file called Archive.zip, which is located in the same folder as the original items.
If you already have an item in that folder named Archive.zip, a number is appended to the new archive's name. For example, you could have Archive.zip, Archive 2.zip, Archive 3.zip, and so on.
One curious aspect of the numbering system is that if you delete the Archive.zip files at a later date, and then compress multiple files in the same folder, the new Archive.zip file has the next number in the sequence appended to it; it doesn't start over. For example, if you compress three groups of multiple items in a folder, you end up with files called Archive.zip, Archive 2.zip, and Archive 3.zip. If you delete the zip files from the folder, and then zip another group of items, the new file is named Archive 4.zip, even though Archive.zip, Archive 2.zip, and Archive 3.zip no longer exist in that folder.
Itool For Mac
Unzipping a File

Gzip Tool For Mac
Unzipping a file or folder couldn't be easier. Double-click the zip file, and the file or folder decompressed in the same folder as the compressed file.
If the item you are decompressing contains a single file, the new decompressed item has the same name as the original file.
Unzip Tool For Mac
If a file with the same name is already present in the current folder, the decompressed file has a number appended to its name.
Folder for Multiple Unzipped Items
When a zip file contains multiple items, the unzipped files are stored in a folder that has the same name as the zip file. For example, if you unzip a file called Archive.zip, the files are placed in a folder called Archive. This folder is located in the same folder as the Archive.zip file. If the folder already contains a folder called Archive, a number is appended to the new folder, such as Archive 2.
Gzip Utility For Mac
Apps for Compressing or Decompressing Mac Files
Gzip Software For Mac
If you want more file compression features than Apple offers in its Archive Utility, third-party apps are available. They include: