Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change internal API to support "spk" and "deb" #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

change internal API to support "spk" and "deb" #158

wants to merge 2 commits into from

Conversation

crea-doo
Copy link

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.

@tcurdt
Copy link
Owner

tcurdt commented May 20, 2014

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.

@crea-doo
Copy link
Author

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 DebMojo into DebMojo, AbstractPackageMojo and added SpkMojo where the AbstractPackageMojo is an abstract class providing basic funtionality for the extending classes
  • I split up the DataBuilder into DataBuilder, DebDataBuilder and SpkDataBuilder where the remaining DataBuilder is an abstract class providing basic funtionality
  • I added PackageMaker containing common methods for working with (T)ArArchiveOutputStreams
  • I refactored some files and moved them to the debian package because they belong to the functionality used by the deb part 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...

@tcurdt
Copy link
Owner

tcurdt commented Jun 10, 2014

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?

@ebourg
Copy link
Collaborator

ebourg commented Jun 10, 2014

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.

@crea-doo
Copy link
Author

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...

@tcurdt
Copy link
Owner

tcurdt commented Jun 11, 2014

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.

@tcurdt tcurdt changed the title Spk support change internal API to support "spk" and "deb" Jun 12, 2014
@tcurdt tcurdt added this to the 2.0 milestone Jun 12, 2014
@tcurdt tcurdt added 2.x and removed 2.x labels Dec 15, 2014
@teichsta
Copy link

+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 openhab/openhab1-addons#1989).

Keep up the good work!

Thomas E.-E.

@cniweb
Copy link

cniweb commented Jul 13, 2015

What is here the state, when it goes on?
Would be really great if it is supported!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants