jdeb
jdeb copied to clipboard
change internal API to support "spk" and "deb"
I extended jdeb with a new Maven Mojo and a Ant task that supports the creation of packages/archives for Synoloy DiskStations in the spk format. I tried to reuse as much as possible the already existing functions and utilies and also refactored and generalized where necessary.
Please review the changes and let me know, if you need me to change anything. I really would like to see this functionality in jdeb.
Hey, @crea-doo could you please give some context for these changes? They are quite big.
How is spk package format related to the deb format? How is it different?
Also please check the pull request. It does not allow for an automatic merge.
Hi, thanks for the quick response ;-) I've reworked/cleaned up the commits but it seems that the automatic merge button doesn't appear after my changes. Can you provide help with that?!
So basically the spk format is quite similar in comparison to the deb format.
The spk itself is a tar file containing a INFO file (similar to the control file), a packages.tgz (like the data.tar.gz) and a scripts directory (containing all the preinstall, postinstall, preremove,... scripts).
Synology doesn't provide deb support for their NAS boxes (DiskStations) but they have their proprietary spk format. So spk and deb are not related to each other but jdeb offers nearly all the functionality needed to build a spk.
That's why I added a SpkMojo and a SpkAntTask in addition to the existing implementation and reused as much as possible the existing code.
For more details on the spk format please have a look at http://forum.synology.com/wiki/index.php/Synology_package_files
So regarding context of the changes:
- I split up the
DebMojointoDebMojo,AbstractPackageMojoand addedSpkMojowhere theAbstractPackageMojois an abstract class providing basic funtionality for the extending classes - I split up the
DataBuilderintoDataBuilder,DebDataBuilderandSpkDataBuilderwhere the remainingDataBuilderis an abstract class providing basic funtionality - I added
PackageMakercontaining common methods for working with(T)ArArchiveOutputStreams - I refactored some files and moved them to the
debianpackage because they belong to the functionality used by thedebpart of jdeb - I added/duplicated the unit test for the spk-flavour and added/duplicated a lot of files in the test resources directory used by the unit tests
If I have time I'll also add a short description similar to the descriptions in the docs directory.
I hope I didn't miss anything...
Hmmm. While I can see the overlap I am more inclined to say: let's revamp the API so you use jdeb as a dependency and create an spk plugin yourself. Or we work on the API and make it one of the use cases inside jdeb to keep it flexible enough. @ebourg, what do you think?
I think this is too specific to become part of jdeb. That's great if you were able to reuse jdeb to support this format, but I think it's outside the scope of jdeb.
Sorry to hear that :-( So are there any plans to expose some kind of API to use jdeb as a dependency so that it can be used by other plugins? If no, what's your suggestion, how to reach that or how to start. Your help on this topic is very appreciated...
The Builder and Producers and so on are there. You could just use jdeb as a dependency today. But we will need to see what needs to change in order to be flexible enough to also support "spk" packages. Unfortunately right now I am awfully busy and this will have to wait - but once I find the time for the 2.0 design I will keep that "spk" in mind.
+1 for the SPK generation (just the Feature :-))
@crea-doo it would be great if you could share your achievements with us (see our Issue https://github.com/openhab/openhab/issues/1989).
Keep up the good work!
Thomas E.-E.
What is here the state, when it goes on? Would be really great if it is supported!