4

I have written a proprietary application that needs to install some .pyo files. When I create a .deb from the app, lintian complains that package-installs-python-bytecode. I tried adding an override, but apparently this tag is marked as non-overridable by ftp-master-auto-reject.profile in /usr/share/lintian/profiles/debian. Since this tag is considered an Error, Ubuntu Software Center complains about the package.

Is there a clean way to override this tag so that Ubuntu Software Center no longer complains?

Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114
  • If there was, wouldn't that be a bug in Ubuntu? The whole point of free software is that you can study it. – flup Nov 15 '13 at 18:37
  • 1
    Yes, but the existence of free software doesn't mean that people should be prevented from distributing proprietary software. Regardless of my personal views on the matter, both types of software are valid models, and if Ubuntu wants to prevent proprietary software from being installed, wtf are they doing starting a software store? – Chinmay Kanchi Nov 16 '13 at 16:49
  • @flup Ubuntu Software Center already sells many paid software, such as World of Goo. – Ramchandra Apte Nov 18 '13 at 11:58

2 Answers2

2

I would change the deb generation steps to either (or both) -

  1. Move the installation and generation of the python bytecode into the postinst section (7.6),
  2. Use pip instead of, or with, deb.

tar up the python file(s), base64 or otherwise encode the tar file into the postinst script, extract and install from there and you're done!

Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
  • How does placing the bytecode under `/usr/local` help? Is this directory exempt from the checks somehow? – Chinmay Kanchi Nov 15 '13 at 17:24
  • I double checked, and my memory was a little off - you have to do (1) - and/or (2). – Elliott Frisch Nov 15 '13 at 17:46
  • Sadly 1 isn't an option because the client doesn't want the source revealed at any point (he is aware of the pitfalls of pyos, he just doesn't want to make it _too_ easy). `pip` might be an option, but honestly, in that case, I'll just write a custom installer that will work on most linux distros not just Ubuntu/Debian. – Chinmay Kanchi Nov 15 '13 at 17:54
  • @ChinmayKanchi Updated my answer, because you missed part - use the compiled files in your script to work around the debian policy. – Elliott Frisch Nov 15 '13 at 18:07
  • Yes, but remember that I'll have to generate the files from source. Which means that the .deb will have the .py files. I suppose I could put them into a tgz of their own and extract them in postinst, but this is a bit yucky, no? – Chinmay Kanchi Nov 16 '13 at 16:50
  • Agreed. But it's the best approach I can think of that does what you want. – Elliott Frisch Nov 16 '13 at 17:38
  • Fair enough. I'm going with this approach, I think. I'm going to wait for more answers, but I will award the bounty to you if none are forthcoming. – Chinmay Kanchi Nov 16 '13 at 17:43
1

For future reference, here's what I did.

  1. I generated and packaged the .pyo files into their own tar.gz file
  2. In the postinst script, the tar.gz file is extracted, and the tar.gz file is deleted
  3. In the postrm script, the pyo files are deleted.

This isn't the nicest solution in the world, but it works with Debian/Ubuntu's overly draconian policies (which don't even make sense; if I can install a binary, why not a pyo?).

Hopefully this helps someone out.

Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114