Bug 658809 - [patch] Add simplified macro to add custom depmaps
Summary: [patch] Add simplified macro to add custom depmaps
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: jpackage-utils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-01 11:07 UTC by Stanislav Ochotnicky
Modified: 2011-06-03 14:19 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-03 14:19:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch adding new macro (7.61 KB, patch)
2010-12-01 11:22 UTC, Stanislav Ochotnicky
no flags Details | Diff
Added new options (7.82 KB, patch)
2010-12-01 15:26 UTC, Stanislav Ochotnicky
no flags Details | Diff
Add new macro (1.29 KB, patch)
2011-04-14 15:47 UTC, Stanislav Ochotnicky
no flags Details | Diff
Python file implementing pom parsing for automatic depmap generation (3.61 KB, application/octet-stream)
2011-04-14 15:48 UTC, Stanislav Ochotnicky
no flags Details

Description Stanislav Ochotnicky 2010-12-01 11:07:59 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Stanislav Ochotnicky 2010-12-01 11:21:21 UTC
Sorry, pushed enter accidentally.

Currently for packaging maven artifacts we are using %add_to_maven_depmap macro. We need to supply a lot of information to it and it gives us a lot of places to make mistakes.

Attached patch adds new macro (%add_maven_depmap) that only needs one to three parameters depending on the use. It reads original groupId/artifactId/version from pom file itself. That's why this was implemented in python, to have a proper xml parser available.

Install depmap for parent/main pom without jar (pom needs to exist in mavenpomdir):
%add_maven_depmap JPP-xbean.pom

# install depmap and verify that pom filename and jar filename are compatible
# jar file needs to exist in javadir
%add_maven_depmap JPP.xbean-xbean-reflect.pom xbean/xbean-reflect.jar

For example this would fail because of incompatible filenames:
%add_maven_depmap JPP.xbean-reflect.pom xbean/xbean-reflect.jar

And finally when we want more groupIds/artifactIds resolve to same jar file:
%add_maven_depmap JPP.xbean-reflect.pom xbean/reflect.jar com.google:reflect,org.sf.xml:reflect

Previous call adds normal depmap + 2 more custom depmaps resolving to same jar file.

Comment 2 Stanislav Ochotnicky 2010-12-01 11:22:09 UTC
Created attachment 463950 [details]
Patch adding new macro

Comment 3 Stanislav Ochotnicky 2010-12-01 15:26:10 UTC
Created attachment 464014 [details]
Added new options

Added two optional parameters to macro:
 -f ADD : adds "ADD" to fragment name therefore creating %{name}-ADD
 -a custom depmaps are added like this ("gid1:aid1,gid2:aid2"

Comment 4 Deepak Bhole 2011-04-13 17:23:27 UTC
Hmm, I am sorry. Not sure how this got missed :/

Can you attach the maven_func.py file as well please? Also, can you post the patch as applicable to the jpackage-utils tree?

Comment 5 Stanislav Ochotnicky 2011-04-14 15:46:33 UTC
Patch I added was actually against jpackage package in fedora. There seems to be a bug in bugzilla that will prevent you from seeing file additions. If you look at https://bugzilla.redhat.com/attachment.cgi?id=464014 you can see the proper patch, other links are not showing the maven_func.py for some reason. Applying the patch would give you fixed spec & patch that would be applied to jpackage during build.

Nevertheless I am including separate patch against jpackage (minus the maven_func.py since you want it separate).

Comment 6 Stanislav Ochotnicky 2011-04-14 15:47:43 UTC
Created attachment 492156 [details]
Add new macro

Patch without addition of maven_func.py

Comment 7 Stanislav Ochotnicky 2011-04-14 15:48:29 UTC
Created attachment 492157 [details]
Python file implementing pom parsing for automatic depmap generation

Comment 8 Deepak Bhole 2011-04-14 16:16:52 UTC
Looks fine to me. The -f doesn't seem have an accompanying help message like -a does though. Is this intentional?

Comment 9 Stanislav Ochotnicky 2011-04-18 07:20:10 UTC
Well, that's because the "-f" is handled by rpm macro, whereas "-a" is handled by the python script. The "-f" never reaches the python script. I could modify behaviour of macro to move that functionality to python script I guess. Also I should document the maven_func.py a bit more one way or the other. I first wanted to get input on the general idea so I wouldn't spend too much time polishing something that will get thrown out the window :-)

Comment 10 Stanislav Ochotnicky 2011-06-03 14:19:01 UTC
After discussion with Andrew Overholt during SIG meeting, we decided to do it a bit differently. 

We created javapackages project on fedorahosted as a separate project[1,2]. I added release of this project as a separate source. It's going to be easier to maintain and jpackage guys can easily take our changes (that's why we chose BSD license as well).

I'll update jpackage-utils in a few hours in rawhide. If you find any problems with it let me know.


[1] https://fedorahosted.org/javapackages/
[2] https://fedorahosted.org/released/javapackages/


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