OS X 10.3 (Panther) provides unzip 5.20, but some packages depend on later versions. And since there are some directory-traversal security holes in 5.20 (see http://example/), it's worth installing the latest version of unzip. Three modifications are needed to get app-arch/unzip-5.50-r2 to install on my OS X system. First, the call to sed in src_unpack() needs to call gsed instead, as the Panther-provided sed doesn't understand the -i option. Second, the makefile target in src_compile() needs to be "macosx" instead of "linux" or "linux_noasm". These two modificatons are straightforward and a simple ebuild patch can take care of them. The third modification that's needed is a change to /usr/lib/portage/bin/dobin. The default behavior there, if an executable doesn't have its +x bit set by the "make install" process, is to run "install -m0755 --owner=root --group=root ...". This syntax doesn't work on OS X. On OS X, you need "install -m 0755 -o root -g wheel ...". The first two modifications are straightforward, and a single ebuild patch can take care of both. The third modification (tweaking /usr/lib/portage/dobin) is not so simple. I'll post a patch that will make the necessary changes to dobin, but it raises questions: should this be applied in the ebuild and then immediately removed once the install step is complete? Or should this be a permanent change? The portage maintainers will have to answer that one. Reproducible: Always Steps to Reproduce: 1. Apply patches to ebuild and dobin. 2. emerge -av unzip 3. Actual Results: Works after applying patches. Portage 20040726 (default-macos-10.3, gcc-3.3, unavailable, 7.5.0 Power Macintosh powerpc) ================================================================= System uname: 7.5.0 Power Macintosh powerpc macos-20040726 distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632) [disabled] Autoconf: Automake: Binutils: ACCEPT_KEYWORDS="macos" AUTOCLEAN="yes" CFLAGS="-O2 -pipe" CHOST="powerpc-apple-darwin" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="collision-protect cvs keepwork" GENTOO_MIRRORS="http://gentoo.osuosl.org/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="macos gdbm jpeg ncurses png python readline slang ssl"
Created attachment 38545 [details, diff] unzip-5.50-r2.ebuild.patch Here's the ebuild patch which takes care of the sed/gsed issue and picks the appropriate Makefile target.
Created attachment 38546 [details, diff] dobin.patch And here's the patch to /usr/lib/portage/bin/dobin, to make it use a different install syntax if ${ARCH} = "macos".
I forgot to mention that of course, /usr/bin/unzip already exists, so portage will refuse to install unzip will collision protection turned on. You can either do "FEATURES='-collision-protect' emerge -av unzip", which will overwrite /usr/bin/unzip; or you can do what I did and move /usr/bin/unzip out of the way (I renamed it to /usr/bin/unzip-orig-5.20), which will allow you to restore the OS X-provided unzip should you ever choose to uninstall the unzip you just built with the Gentoo ebuild.
What package actually depends on later versions of unzip? (FYI, if it overwrites default Mac OS X unzip we won't mark it stable.) First is a dup of bug #58415 and third is a dup of bug #57878. Please use the latest portage (portage-2.0.51_pre20). What we need to care is the second modification but we are not going to add anything until macos keyword change.
I hit this problem when trying to install slib, but a quick grep through my local portage tree shows that there's other packages with similar dependencies. I found the following packages that depend on versions of unzip later than 5.20: app-accessibility/nfbtrans - ">=app-arch/unzip-5.50-r2" app-antivirus/f-prot - ">=app-arch/unzip-5.42-r1" app-text/docbook-sgml-dtd - ">=app-arch/unzip-5.41" app-text/docbook-xml-dtd - ">=app-arch/unzip-5.41" dev-java/ant - ">=app-arch/unzip-5.50-r1" dev-java/infobus-bin - ">=app-arch/unzip-5.50-r1" dev-java/java-sdk-docs - ">=app-arch/unzip-5.50-r1" dev-java/javahelp-bin - ">=app-arch/unzip-5.50-r1" dev-java/jdbc2-oracle - ">=app-arch/unzip-5.50-r1" dev-java/jdbc3-oracle - ">=app-arch/unzip-5.50-r1" dev-java/jdepend - ">=app-arch/unzip-5.50-r1" dev-java/jmf-bin - ">=app-arch/unzip-5.50-r1" dev-java/jrockit-jdk-bin - ">=app-arch/unzip-5.50-r1" dev-java/jta - ">=app-arch/unzip-5.50-r1" dev-java/junit - ">=app-arch/unzip-5.50-r1" dev-java/sun-jaf-bin - ">=app-arch/unzip-5.50-r1" dev-java/sun-javamail-bin - ">=app-arch/unzip-5.50-r1" dev-libs/slib - ">=app-arch/unzip-5.21" dev-util/astyle - ">=app-arch/unzip-5.42" mail-filter/qmail-scanner - ">=app-arch/unzip-5.42-r1" media-libs/jpgalleg - ">=app-arch/unzip-5.50" Thanks for the tip to the new version of portage; I hadn't wanted to use it yet as it's still in package.mask. I'll upgrade and see if the latest portage would, all by itself, close any of the bugs I've reported so far.
This depends on bug 67162. Will take a look at it when 67162 has gotten somewhere. Until then, this bug should remain frozen.