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