[10:43] <Rirto6> hi
[10:43] <Rirto6> Looking for a good tutorial on packaging Java applications into single .deb installers. Any recommendations?
[10:46] <persia> I don't think there's a one-size-fits-all guide.
[10:47] <persia> In the simple case, it's so trivial as to be pointless, and in the complex case, it's sufficiently complicated to be confusing.
[10:47] <Rirto6> How about a basic one for me to learn off?
[10:47] <Rirto6> Just a neat trivial one to get me started?
[10:47] <persia> (plus there are *many* variants of the complicated case, depending on the source of complication).
[10:48] <persia> Well, let's first see if you have the simple case :)
[10:48] <Rirto6> Okay, nothing needs to be compiled, there is both a source folder & a binary folder
[10:48] <persia> Firstly, do you have the source code, and is it under a redistributable license?
[10:48] <Rirto6> Yes
[10:48] <Rirto6> GPL & LGPL
[10:49] <persia> OK.  Next: does it just automatically work with /usr/share/doc/debhelper/examples/rules.tiny?
[10:49]  * Rirto6 checks
[10:50]  * Rirto6 tests
[10:56] <Rirto6> persia: Hmm... everything seems to work
[10:57] <Rirto6> With just the one hitch, nothing was installed
[10:57] <Rirto6> (nothing was copied to the /usr/bin)
[10:58] <persia> OK.  You probably need to add a debian/install file.
[10:59] <persia> Just to confirm, the source was recompiled, yes?
[10:59] <Rirto6> I think so
[10:59] <Rirto6> persia: Do you have any nice examples for the install file?
[10:59] <persia> Great.  You have the trivial case, and so don't need a guide :)
[11:00] <Rirto6> :)
[11:00] <Rirto6> I'm confused with the meaning of that word
[11:00] <Rirto6> You have the 'New' case, so don't need a guide
[11:00] <persia> Adding a single line like "myappwrapper usr/bin" would copy your wrapper (where you set classpath and stuff).
[11:00] <Rirto6> Oh
[11:00] <Rirto6> Sorry, got the word novel & trivial mixed up
[11:01] <persia> You'll want another line sticking your jar into /usr/share/java
[11:01] <Rirto6> persia: Sorry, you lost me there
[11:02]  * Rirto6 goes to brush his teeth
[11:02] <persia> You probably want two lines in debian/install : one for a wrapper to stick in usr/bin, and another for your .jar file to go in usr/share/java/
[11:03] <persia> Because policy forbids having the .jar directly in usr/bin
[11:03] <Rirto6> persia: It's not a single jar file.
[11:03] <persia> No?  What is it?
[11:04] <Rirto6> http://www.processing.org
[11:06] <Rirto6> I'm on #ubuntu-java because it a) compiles to pure java b) In some docos is described as a class library of java
[11:06] <Rirto6> & c) required the jdk
[11:08] <persia> I'm having wildly variable download speeds, but should be back with you in a bit (somewhere between 2 and 20 minutes, according to the counter)
[11:10] <Rirto6> kk
[11:11]  * Rirto6 didn't even have Internet for two weeks before today
[11:11] <Rirto6> (about 6 hours ago)
[11:12] <Rirto6> persia: Remember to get the SVN as well
[11:13] <Rirto6> BTW: I don't want you to do the work for me, I just want to be guided in the right direction
[11:13] <persia> No need: I just want to get a look at what this is.
[11:13]  * Rirto6 is aware that he is close to accomplishing
[11:13] <Rirto6> persia: Certainly
[11:13] <persia> I have a suspicion that you might want to split it into a few bits, but need to verify before I can know I'm pointing you in the right direction.
[11:14] <persia> I suspect you can get the rest of what you want with debian/install
[11:14] <Rirto6> 2 bits would be nice
[11:14] <persia> It just installs a file or directory on each line.
[11:14] <Rirto6> 1 bit with everything from the svn (source) & the other bit with the program (binary)
[11:14] <persia> But that might not end up with the best quality package.
[11:14] <Rirto6> Oh
[11:15] <persia> So, you don't want that.
[11:15] <Rirto6> Well in that case, include them both I suppose, in the one binary?
[11:15] <persia> You want to start with the source, and then package it, and then build the package, and that generates the binary.
[11:15] <Rirto6> Hmm
[11:15] <persia> No, the binary shouldn't have the source: that just wastes space.
[11:15] <Rirto6> Not sure it works that way with Processing
[11:15] <persia> Hrm.  By download agent claims it's been at 100% for the lat 40MB.
[11:16] <persia> s/By/My/
[11:16] <Rirto6> arghh
[11:16] <Rirto6> try aria2
[11:17] <persia> How big is the download?
[11:18]  * persia is at 140MB so far
[11:18] <Rirto6> Good question actually
[11:18] <Rirto6> 186.9MB
[11:18] <Rirto6> I think
[11:18] <persia> Oh, then I'm getting closer :)
[11:20] <Rirto6> :)
[11:22] <Rirto6> What are you on now?
[11:23] <Rirto6> (I feel like saying "Are we there yet?")
[11:24] <persia> 180
[11:24] <Rirto6> kk
[11:27] <persia> It's not actually compressed, although named "tgz" :)
[11:27] <persia> Compression would save some bandwidth.
[11:28] <Rirto6> Yeah
[11:28] <Rirto6> Packages are compressed, so I though I'd just do that
[11:28] <Rirto6> Makes it easier for them
[11:28] <persia> OK, so this is a bit more complicated.
[11:28] <Rirto6> Actually with the tgz I had to mount it rather than untar it
[11:28] <Rirto6> persia: Well there are multiple files, and the jdk is a dependency
[11:28] <persia> I just renamed it to .tar, and untarred it :)
[11:28] <Rirto6> :)
[11:29] <persia> So, everything in lib/ should probably be deleted and the tarball repackaged.
[11:29] <persia> And check to make sure that those libraries are available on the system (most of them seem to be at first glance)
[11:29] <persia> You probably want a -doc package containing reference/ and examples/
[11:30] <Rirto6> Hmm
[11:30] <Rirto6> Wait, it has it's own libraries
[11:30] <Rirto6> I know that for sure
[11:30] <persia> Are the contents of libraries/ local libraries or foreign libraries?
[11:30] <Rirto6> (most of them are default though)
[11:31] <Rirto6> Not entirely sure, at the moment I want to get a .deb out there, then I'll work on it more tomorrow night
[11:31] <persia> The stuff in lib/ is stuff like antlr and ecj.  I'm certain those aren't unique to processing :)
[11:31] <Rirto6> But for now I want to get it all working & out there
[11:31] <persia> I'm not sure you can do that in a GPL compliant way.
[11:31] <persia> Because of the "preferred form for modification" clause.
[11:31] <persia> That prohibits distributing jars if you don't know you have the source that produces them
[11:31] <Rirto6> Ouch
[11:32] <persia> And it's unfortunately common in the Java community to grab some binary jar from some site and embed it.
[11:32] <persia> Which is technically a contract violation.  Not so many prosecute, but it always pays to be careful.
[11:32] <Rirto6> Well how long would it take to do your method
[11:32] <Rirto6> ?
[11:32] <persia> Well, splitting the package is trivial.
[11:32] <Rirto6> (for an untrained person such as I)
[11:33] <persia> Just add a second Package: stanza to debian/control and create two debian/install files: debian/processing.install and debian/processing-doc.install
[11:33] <persia> List the files you want in the processing package in the first, and the ones you want in processing-doc in the second.
[11:33] <persia> Make sure that the processing package depends on the system libraries that match the ones in lib/
[11:33] <persia> (which makes dropping lib/ trivial)
[11:34] <persia> libraries/ is more interesting, because it's unclear at first glance whether those are part of processing or separate.
[11:34] <persia> It might take a while to dig through that, but you might be able to postpone some of that.
[11:35] <persia> I'm not sure whether you want to have a separate processing-tools package, or just stick mangler into processing.  That's more a judgement call.
[11:35] <persia> Either way shouldn't be that much extra effort.
[11:35] <Rirto6> Nah, I'd like to keep everything together
[11:35] <Rirto6> Eventually I might make separate packages
[11:35] <persia> (well, except the docs :) )
[11:35] <Rirto6> eg; docs, tools, examples
[11:36] <persia> Well, OK.  Works to start.  Splitting is good, but can be delayed.
[11:36] <persia> So, shortlist for the easy way
[11:36] <persia> 1) repack the tarball to drop the stuff in lib/
[11:36] <Rirto6> Let's start from scratch, which do I want, what's in the SVN or in the tgz?
[11:37] <persia> 2) make sure that the stuff in java/ and libraries/ is getting put in a jar.
[11:37] <persia> Doesn't really matter.  I'd probably use the .tgz, just because it's a known release, and therefore less likely to have a half-completed bit.
[11:37] <persia> Yeah, compressing the tarball, I end up with only 66MB, rather than 180.
[11:38] <persia> I'm sure that's worth an upstream bug.
[11:38] <Rirto6> Sure
[11:38] <Rirto6> I'll put that in
[11:38] <persia> So back to my shortlist
[11:39] <persia> 3) create some wrapper shell scripts that set the classpath and call the created jar files with the right arguments.
[11:40] <persia> 4) use debian/install to stick everything in the right place (can install files or directories)
[11:40] <persia> Done!
[11:40] <persia> I'm not convinced that package would comply with the licenses (you'd have to do source inspection and license review, which can take a lot of time)
[11:40] <persia> I'm also not convinced that's the best way to package it
[11:40] <persia> But it ought to work.
[11:40] <persia> Based on the description on the upstream website, I'd probably want to split up the various processing libraries, so that people who wrote stuff using processing would only need to have their users install the libraries needed for their application, rather than everything.
[11:41] <persia> And then have processing as a general app, processing-tools for mangler and anything else that gets added later, and processing-doc containing the reference and examples.
[11:41] <persia> But that's a lot of binary packages, and requires more thought to organise right (so not something for the impatient)
[11:44] <Rirto6> Hmm
[11:44] <Rirto6> Thanks for the guide
[11:45] <Rirto6> Would you mind helping me write 3) & 4)?
[11:45] <Rirto6> (you'll get mention for helping with binarise the software, of course)
[11:46] <persia> For 3) install any java app, and take a look at the /usr/bin entry.  They're all about the same.
[11:46] <persia> For 4), it's just a list of things to install.  Each line has a source and destination.
[11:46] <Rirto6> How do I generate 4)
[11:47] <persia> The source is relative to the package directory, and the destination is relative to the filesystem.
[11:47] <persia> With a text editor :)
[11:47] <Rirto6> So, find & sed?
[11:47] <persia> It's really just lines like "foo.jar usr/share/java"
[11:47] <Rirto6> I've already created 3 or 4 different Installer Scripts for Windows
[11:48] <Rirto6> Including XML type ones
[11:48] <persia> it's lots less complicated then that :)
[11:48] <Rirto6> Sounds more complicated actually
[11:48] <Rirto6> persia: There were so many files
[11:49]  * Rirto6 just deleted all processing files/folder/archives
[11:49]  * Rirto6 is about to start from scratch
[11:50]  * Rirto6 is downloading Processing
[11:51] <Rirto6> persia: Wait, it downloaded 66MB, then decompressed
[11:52] <Rirto6> persia: We are talking about over 2½ thousand files
[12:00] <Rirto6> persia: Just confirming, I'm excluding /processing-1.0.9/lib from the first tarball?
[12:04]  * Rirto6 JARred /processing-1.0.9/java & /processing-1.0.9/libraries, excluded the directories & packaged everything but those [now JARred] directories & /processing-1.0.9/lib.
[12:04] <Rirto6> persia: Please tell me if I'm doing/have done anything wrong
[12:05] <Rirto6> (the archive is a tar.gz)
[12:10] <persia> I'd have created the jars during compilation, but that works, kinda.
[12:12] <Rirto6> persia: I think this project is too complicated for my first Debian (.deb) package
[12:13] <persia> Pretty much anything that doesn't fall into the trivial case "works with rules.tiny with minimal fuss" is not a good place to start.
[12:13] <Rirto6> Can you help me with just getting the .deb file to successfully install the program, and we can worry tomorrow night about making it adhere to the debian policy
[12:13] <Rirto6> ?
[12:14] <persia> You don't have a working .deb file yet?
[12:14] <persia> What part of the debian/install file isn't working for you?
[12:15] <Rirto6> Not sure
[12:15] <Rirto6> I'll try once more
[12:15] <Rirto6> brb
[12:21] <Rirto6> persia: I must be doing something extremely wrong
[12:21] <Rirto6> I have a 7.7kb .deb file
[12:21] <persia> pastebin your debian/install file?
[12:26] <Rirto6> Sorry, back now
[12:26] <Rirto6> persia: No need for pastebin, just have the one line;
[12:26] <Rirto6> processing usr/bin
[12:28] <persia> Oh, so you need some more lines to install the rest of the package :)
[12:28] <persia> Just add one line for each file or directory you want to install.
[12:31] <Rirto6> persia: No, I mean, I can't find the program 'processing' anywhere
[12:31] <Rirto6> I thought I'd test it out on at least one
[12:34] <persia> Did you install the generated .deb file?
[12:34] <persia> It should contain /usr/bin/processing
[12:43] <Rirto6> persia: http://pastebin.com/d34f1c2bb
[12:43] <Rirto6> Finally got it to work, however get that^
[12:44] <persia> pastebin your debian/install ?
[12:44] <Rirto6> processing usr/bin/processing
[12:44] <persia> Drop the last entry fthere.
[12:44] <persia> You want just "processing usr/bin"
[12:44] <persia> With that line, you're suggesting it should make a /usr/bin/processing in which to put the proessing file.
[12:46] <Rirto6> Hmm
[12:46] <Rirto6> That's weird
[12:46] <Rirto6> Because without that it didn't work at all
[12:46] <Rirto6> All well, now, to sed!
[12:47] <Rirto6> (& beyond)
[12:47] <Rirto6> [to generate the file]
[12:47] <Rirto6> Already have one which has a similiar function to generate the XML files for Windows
[12:48] <Rirto6> Which I was using with sed, awk & find within Cygwin
[12:49] <persia> You really don't want to do it that way.
[12:49] <persia> It may be helpful for you to get a package in the next couple hours, but it will ultimately be a complete waste of time.
[12:55] <Rirto6> eh
[12:55]  * Rirto6 was bringing in his monitor from downstairs, hasn't started work on the install file yet
[12:56] <persia> So, what you want to do, if you want to do it right, is to set up ant to build all the source into a small (known) number of jars
[12:56] <persia> And then just list those jars in debian/install.
[12:56] <persia> But that's more work.
[12:57] <persia> (although also significantly more likely to be correct and cause fewer bugs later)
[12:58] <Rirto6> Great
[12:58] <Rirto6> I'll do a bad package tonight
[12:58] <Rirto6> & a good package tomorrow night
[12:58] <persia> Right :)
[12:58] <Rirto6> =]
[13:08]  * Rirto6 is close
[13:08] <Rirto6> find $PWD -follow -type f | sed -e 's|/[^/]*\(/.*\)/.*| & \1|
[13:08] <Rirto6> Has all the info we want
[13:08] <Rirto6> just wrong order :P
[13:09] <Rirto6> Wait
[13:09] <Rirto6> Right order!
[13:09] <Rirto6> Tis perfect (just need to get rid of the starting space)
[13:12] <persia> That gets every file.
[13:12] <persia> I did mention that you could add a line for a directory, right?
[13:12] <persia> So "tools /usr/share/processing" would copy the entire tools folder?
[13:12] <Rirto6> Isn't specifying files better?
[13:12] <persia> And that result would be a bit more readable, no?
[13:12] <persia> No.
[13:13] <Rirto6> Okay
[13:13] <persia> Making the packaging easy to understand is best.
[13:13] <Rirto6> Well simple edit for that
[13:13] <persia> Yeah.  If you can't do debian/install in a text editor, you're doing it wrong :)
[13:13] <Rirto6> find $PWD -follow -type d | sed -e 's|/[^/]*\(/.*\)/.*|& \1|'
[13:14] <persia> No, you don't need -follow
[13:14] <Rirto6> How's that command, lists directories only
[13:14] <persia> And you don't need find.
[13:14] <persia> There's just 5-6 directories you care about.
[13:14] <persia> tools/ libraries/ java/ reference/ examples/
[13:14] <persia> Just add a line for each one, and you're done, if you don't care about policy.
[13:14] <Rirto6> rly, that all?
[13:14] <Rirto6> Just the root ones?
[13:14] <persia> Yes.  Like I said, it's really simple.
[13:14] <Rirto6> But... the script!
[13:15] <persia> That will copy the entire tree.
[13:15] <Rirto6> aww
[13:15] <persia> I *know* you don't want to install all that stuff, but it gets you a package quickly.
[13:15] <persia> A bloated, potentially unredistributable package, that doesn't comply with policy, but a package.
[13:16] <Rirto6> Well all I need for tomorrow is a working package
[13:17] <Rirto6> Tomorrow night I'll work on making it compliant
[13:17] <Rirto6> Then hopefully the next day I'll get it into a repository
[13:18]  * Rirto6 just closed 30 windows that were distracting
[13:23]  * Rirto6 has finished scripting the installer
[13:23]  * Rirto6 can now create the installer in under 40 seconds
[13:23] <Rirto6> :P
[13:24] <Rirto6> (delete everything but a tar.gz file,  & everything from the original tgz file)
[13:24] <persia> Well, debian/copyright will be a challenge.  I'd set aside a couple days for that, given the source.
[13:25] <Rirto6> So what, a week?
[13:25] <persia> For a large java environment like that, two seems more reasonable.
[13:25] <persia> One week is enough to get it packaged right and do the license review.
[13:26] <persia> But it usually takes at least another week to port it to system libraries and work with upstream for awkward bits that need adjustment.
[13:26] <persia> Of course, that assumes the source is in decent shape.  Eclipse made everyone run screaming for a couple years, and is just now getting sorted.
[13:27] <Rirto6> Well I'll get the one week down first
[13:28] <Rirto6> Then release it with everything I used to create it
[13:28] <Rirto6> Which will hopefully get a bigger userbase to help me with the 2nd week
[13:31] <Rirto6> persia: Will you be on tomorrow night for more advice?
[13:32] <persia> I'm often around, but can't promise to have lots of time.
[13:33] <persia> But just ask questions generally: there's other people around who can help (most of whom have packaged more things from scratch than I)
[13:37] <Rirto6> Well thanks, you have been of great help
[13:37] <Rirto6> Let's quickly summarise what needs to be done
[13:39] <Rirto6> Copyright file needs to be reviewed. System libraries need to be ported, and worked on with upstream to fix the awkward bits that need adjustment. Setup ant to build all the source into a small, known, number of jars. Then all I need to do is list those jars in the install file.
[13:39] <Rirto6> Is that about it?
[13:45]  * Rirto6 has to go now
[13:45] <Rirto6> Thanks again
[13:58] <persia> That was about it, but I got latent.