Bug 434850

Summary: Filter out OSX resources in %setup for OSX zip files
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: davej, pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-27 06:22:06 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 434856    
Bug Blocks: 235705    

Description Nicolas Mailhot 2008-02-25 15:41:21 EST
Description of problem:

OS X created zip files
(for example http://www.greekfontsociety.gr/GFS_NEOHELLENIC_OT.zip) include
Apple-specific metadata in an __MACOSX/ directory. Thus if such an archive is
released by a project and then packaged %setup -q will leave a stray __MACOSX/
in the rpm build dir.

This causes failures in automated rpm checker scripts Fedora people (most
notably Dave Jones) use

Please make the %setup macro filter-out these OSX-specific metadata files, as
they're totally useless in an rpm context

The gfs-neohellenic-fonts Fedora package is available as test point

Version-Release number of selected component (if applicable):

Comment 1 Nicolas Mailhot 2008-02-25 15:59:12 EST
See also bug #434856
Comment 2 Panu Matilainen 2008-02-26 03:44:16 EST
Let's see the outcome of bug 434856 first. I'm not terribly keen on adding
special handling for such a marginal case (which could easily be worked around
by just re-zipping without the OSX stuff) into rpm: just adding -x __MACOSX/* to
unzip parameters would cause needless complaining from unzip on vast majority of
archives that don't have such data, and looking at contents of a zip and
filtering some arbitrary path out if present seems far more trouble than it's
Comment 3 Panu Matilainen 2008-02-27 06:22:06 EST
Ookay... since the files are just regular files in unzip (as ingeniously created
by OSX archiver program) there's nothing here to fix: like unzip, rpm has no
business censoring the contents of archives.

It's not like rpm is holding anybody hostage to using %setup, it's there just
for convenience in the common case. When there are special needs, like the
packager knows some contents of the archive are bogus, just do it manually:

--- gfs-neohellenic-fonts.spec	17 Feb 2008 10:01:03 -0000	1.2
+++ gfs-neohellenic-fonts.spec	27 Feb 2008 11:18:48 -0000
@@ -45,7 +45,9 @@
-%setup -q -n %{archivename}
+unzip -q %{SOURCE0} -x __MACOSX/*
+cd %{archivename}
 for txt in *.txt ; do
    fold -s $txt > $txt.new
    sed -i 's/\r//' $txt.new