Hi,
Just for the record, MacOSX does not use .app directories, it uses .dmg files for distribution. But at the end, it doesn't really matter, as all (either directory, dmg, zip, tar, cpio, apk, pkg, deb, rpm) serve only one purpose: group files together.
If you think it that way, things became simple. One big difference is how the files are extracted:
1. into one directory (as in Mac's .app)
2. into separate directories (see
FHS)
Both has advantages and disadvantages. One directory is easier to handle, but it can't use shared libraries (as all application have to include it's own version of the library, so we can't call them shared). On the other hand placing files into different directories solves that problem, and with proper dependency handling you don't have to boundle libraries with your application (meaning smaller distribution files). Extracting files into several directories is only problematic on Windows, where you don't have a standard location for your files. On Linux, using the aforementioned File Hierarchy Standard, it's quite straightforward.
About sending a directory over email: this should be implemented as an application feature. So user sees it exactly as if it were a single file (just like in MacOSX), and file grouping is done with mime parts in this case. In other words it's solved at a higher level: the user clicks on a file/folder to send it via email, and it's the MUA's job to create the proper attachment(s) (either one mime part, or more
related parts). On Linux, you can use munpack or mimedecode to extract those from an attachment into files.
Finally referring to @onlyonemac: you're right, that's why they use a different extension, although apk, deb, rpm etc. are simple archives nothing more. When I had to develop a packaging system, I've used a different approach than renaming: for your application you'll need meta information (like license, dependencies, version etc.). You can check (as I did) the existence of a file containing those meta information to distinguish normal archives from "application packages" (I mean the archive should have metainf.xml or meta.json or whatever as the first file in the archive. Or even a directory as in deb).