![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Packaging and Compiling Programs Need help compiling programs or creating .deb packages? |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Just Give Me the Beans!
![]() |
How do I make a deb package of a ruby script?
I finished a ruby program recently, and I'd like to make a package out of it so a friend of mine can simply apt-get install myprogram from my repository.
Anyone know how I can do this?
__________________
aum. |
|
|
|
|
|
#2 |
|
Fresh Brewed Ubuntu
![]() Join Date: Oct 2004
Beans: 1,532
|
Re: How do I make a deb package of a ruby script?
Here is one way to create a .deb file, using the program epm. First, install epm with the command
Code:
$ sudo apt-get install epm Code:
#!/usr/bin/env python # # helloworld.py # print 'Hello, World!' Code:
%product Hello World %copyright 2007 by Yours Truly %vendor Yours Truly %description This program prints "Hello, World!" %version 0.1 %readme README %license LICENSE %requires python f 755 root sys /usr/bin/helloworld.py helloworld.py Code:
$ touch README $ touch LICENSE Finally, we use epm to create the package: Code:
$ epm -f deb helloworld Code:
epm: Warning - file permissions and ownership may not be correct
in Debian packages unless you run EPM as root!
The package will be created in a subdirectoy; the name of the subdirectory and the package depend on the architecture of your computer. On an Intel computer (running the 2.6 kernel), the directory is linux-2.6-intel, and the package is helloworld-0.1-linux-2.6-intel.deb. If you don't want to include "linux-2.6-intel" in the filename of the package, you can use the -n option: Code:
epm -n -f deb helloworld You can find out more about epm here: http://www.easysw.com/epm/ I don't know anything about setting up a repository, so I can't help you with that. |
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() |
Re: How do I make a deb package of a ruby script?
Well that's certainly a lot easier than the way I ended figuring it out
Thanks a bunch.
__________________
aum. |
|
|
|
|
|
#4 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2007
Beans: 15
Ubuntu 7.04 Feisty Fawn
|
Re: How do I make a deb package of a ruby script?
hi, thanks for the tutoria WW
after watching this wonderful tutorial on how to make deb packages for ubuntu I decided to try epm first. Last edited by scicode; July 24th, 2007 at 07:58 PM.. |
|
|
|
|
|
#5 |
|
5 Cups of Ubuntu
![]() Join Date: Jul 2007
Beans: 15
Ubuntu 7.04 Feisty Fawn
|
Re: How do I make a deb package of a ruby script?
ok i was very sucessfull in making a nice .deb package of my program ... however epm is missing sections for ubuntu (science, games ...) which is not that bad, but I also discovered on more thing:
if I install python files and execute them .pyc files will be created, these are not removed when I remove the package with synaptic (a warning is issued while removing that some files are left behing). My solution for now is to also include the .pyc files in the installation. Is that correct? I also wonder what happens when I install my main program files into /usr/bin and they do not have an .py extension, will the pyc files still be created and how do I treat these files? |
|
|
|
|
|
#6 | |
|
The emu says rawr.
![]() Join Date: Sep 2006
Location: Oklahoma
Beans: 3,539
|
Re: How do I make a deb package of a ruby script?
Thanks for the tutorial WW.
__________________
Quote:
|
|
|
|
|
|
|
#7 | |
|
A Carafe of Ubuntu
![]() Join Date: Feb 2005
Beans: 85
|
Re: How do I make a deb package of a ruby script?
Quote:
Developers upload packages to a PPA and have it built for multiple architectures against the current version of Ubuntu. Each user gets up to 1GB of Personal Package Archive space, which works as a standard Ubuntu software package repository. Free PPAs are available only for free ("libre") software packages.So you don't need to set up your own repository, Launchpad will take care of that for you. This feature is currently available. |
|
|
|
|
|
|
#8 | |
|
A Carafe of Ubuntu
![]() Join Date: Feb 2005
Beans: 85
|
Re: How do I make a deb package of a ruby script?
Quote:
|
|
|
|
|
|
|
#9 |
|
Just Give Me the Beans!
![]() Join Date: Jul 2006
Location: Tempe, AZ, USA
Beans: 45
Kubuntu 7.10 Gutsy Gibbon
|
Re: How do I make a deb package of a ruby script?
Maybe you can use a prerm shell script to remove the pyc files:
http://www.debian.org/doc/FAQ/ch-pkg...s-maintscripts |
|
|
|
|
|
#10 |
|
A Carafe of Ubuntu
![]() Join Date: Feb 2005
Beans: 85
|
Re: How do I make a deb package of a ruby script?
I think that's exactly what I'll do when I finally get around to making a nice source package that adheres to .deb standards. For now I have it set up such that the .py files are compiled into .pyc files. The .pyc files are installed instead of the .py files. This solves the derelict-file problem and has the added benefit of being a bit faster the first time it's run. The only problem is that it needs to be compiled for each architecture. Here is my Makefile.
Code:
gladex : package package : gladex-0.3.4.deb gladex-0.3.4.deb : gladex.list # And a bunch of other stuff. python -mcompileall . sudo epm -n -f deb gladex install : sudo dpkg --install linux-2.6-*/gladex-0.3.4.deb clean : rm -rfv linux-2.6-* *~ *.pyc \#*\# |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|