Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build .deb .rpm .dmg etc with one script

Tags:

debian

rpm

Here is my problem:

I have a program and would like to distribute it in binary format so that users don't need to compile it by themselves.

I have already build a .deb package. However, as I remember, there should be some program, which takes one configuration file, and produces different binary packages in different formats, like .deb, .rpm, or even .dmg, .msi, etc. Meaning, I only need to tell it which file should be included in the package (and how to build it), it can produce different packages for me.

After googling some key words, I noticed it's hard to find such program without knowing its name. (I do think there should be something like that. In fact, I remembered I saw it in somewhere.)

like image 555
monnand Avatar asked Jul 03 '12 00:07

monnand


2 Answers

Effing Package Management can do both rpm and deb (get it from https://github.com/jordansissel/fpm)

For cross-platform deployments of the sort you are talking about, you could try http://project-builder.org/

*Note - I never used these tools but I've heard of them

like image 84
Srdjan Grubor Avatar answered Nov 01 '22 09:11

Srdjan Grubor


Your approach is wrong in my opinion. Your job as a developer is to develop the program, not package it for all different Linux distributions. Let distributions handle packaging. Since your knowledge of their packaging guidelines is non-existent you will likely create binary packages which can fail in spectacular ways on some systems and what's worse...can even break users' systems.

What you can do however:

  • Make sure licensing is clear and simple (preferably one of OSI-approved licenses)
  • List your dependencies, including versions and do not bundle them
  • Have sane update policices (i.e. mini/micro version updates don't break APIs or introduce huge changes)
  • Use one of standard build systems (depending on the project it can be autotools, setup.py, maven etc.)
  • Ideally do not do weird stuff, but learn how some nice projects do things (Apache project usually have sensible approach)
  • Then contact the distributions and try to get some packages interested in maintaining your program
like image 36
Stan Avatar answered Nov 01 '22 07:11

Stan