Bug 1005529 - rpmbuild failed link to dir
Summary: rpmbuild failed link to dir
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-08 06:43 UTC by Knut J BJuland
Modified: 2013-09-09 06:48 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-09 06:48:59 UTC
Type: Bug


Attachments (Terms of Use)

Description Knut J BJuland 2013-09-08 06:43:29 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1. download latest oracle java and timeupdate
2. download http://www.city-fan.org/ftp/contrib/java/java-1.7.0-oracle-1.7.0.25-1.0.cf.nosrc.rpm
3. rpmbuild -bb java-1.7.0-oracle.spec

Actual results:

Not a directory: /home/knutjbj/rpmbuild/BUILDROOT/java-1.7.0-oracle-1.7.0.25-1.0.cf.x86_64/usr/lib/jvm/jre-1.7.0-oracle.x86_64
    Not a directory: /home/knutjbj/rpmbuild/BUILDROOT/java-1.7.0-oracle-1.7.0.25-1.0.cf.x86_64/usr/lib/jvm-exports/jre-1.7.0-oracle.x86_64


Expected results:
Should build as I have build it on Fedora 19 before without altering Spec file

Additional info:

Comment 1 Panu Matilainen 2013-09-09 06:48:59 UTC
(In reply to Knut J BJuland from comment #0)
> Expected results:
> Should build as I have build it on Fedora 19 before without altering Spec
> file

The expectation is correct only as long as the former behavior (and the spec) was correct to begin with - similarly to compilers becoming stricter over time and refusing to compile code that older versions did. The issue here is that the spec specifies two symlinks to be directories (ie there's a trailing slash in %files):

%{_jvmdir}/%{jrelnk}/
%{_jvmjardir}/%{jrelnk}/

Rpm has previously ignored use of trailing slash and %dir on non-directory, but this can lead to silent packaging mistakes when upstream changes things between versions etc. So rpm >= 4.11 requires directory entries in %files to actually be directories in the buildroot.

NOTABUG, the spec simply has a minor thinko in it, easily fixed:

@@ -690,8 +690,8 @@
 %config(noreplace) %{_jvmdir}/%{jredir}/lib/security/javafx.policy
 %ghost %{_jvmdir}/%{jredir}/lib/security/local_policy.jar
 %ghost %{_jvmdir}/%{jredir}/lib/security/US_export_policy.jar
-%{_jvmdir}/%{jrelnk}/
-%{_jvmjardir}/%{jrelnk}/
+%{_jvmdir}/%{jrelnk}
+%{_jvmjardir}/%{jrelnk}
 %{_jvmjardir}/%{sdkdir}/
 %{_jvmprivdir}/%{policydir}/
 %{_mandir}/man1/java-%{name}.%{_arch}.1*


Note You need to log in before you can comment on or make changes to this bug.