AutoDeb

Revision 25 as of 2007-08-02 01:16:53

Clear message

AutoDeb is an EXPERIMENTAL script to completely automate compiling and installing software.

The basic concept is that the user downloads any .tar.gz or .tar.bz2 archive created using autoconf (i.e. most programs), and types something like autodeb archive.tar.gz

The program will be configured, compiled and installed, and a binary .deb package will be created and installed on the system.

Autodeb tries to automatically find and install dependencies (both those needed for compiling, and those needed at runtime), and it lists runtime dependencies as such in the created .deb.

It uses strace to find development dependencies during 'configure', and CheckInstall to create a .deb binary package.

Contrary to AutoApt, autodeb does not just install every file that 'configure' happens to peek at. Instead, it lets 'configure' run and fail, at which point it installs only the last package that 'configure' required, and repeats the process.

This avoids installing a lot of useless "false" dependencies (auto-apt always tries to install G77 on my system, just to mention one).

Autodeb can be downloaded at http://apt.byethost14.com/autodeb.sh (or http://apt.byethost14.com/autodeb if you want to view the source in your browser), but PLEASE BE AWARE THAT IT IS VERY EXPERIMENTAL SOFTWARE THAT USES SUPERUSER PRIVILEDGES, AND AS SUCH MIGHT DAMAGE YOUR SYSTEM.

The program I've tested (sort of) autodeb with is XTraceroute, which can be downloaded from http://www.dtek.chalmers.se/~d3august/xt/dl/xtraceroute-0.9.1.tar.gz (make sure you install the 'traceroute' package manually, as that one can't be detected by AutoDeb).

Don't forget to chmod +x ./autodeb.sh to make the script executable!

To run in console mode, type

sudo ./autodeb.sh

To run in GNOME, type

gksudo ./autodeb.sh --gnome

To run in KDE, type

kdesu ./autodeb.sh --kde

You can also give the filename of a tarball, or a directory, at the end of the command line.

Concept

Given a directory containing sourcecode and an autoconf "configure" script, autodeb will

1) Run the 'configure' script under strace, which tracks all of configure's attempts to access files

2) When 'configure' fails, autodeb looks at the last file that 'configure' tried to access; it asks auto-apt to find the package that files belongs to, installs it, and go back to 1)

3) When 'configure' eventually succeeds, autodeb compiles the sources using 'make'

4) At this point, AutoDeb does a 'make install' under a LD_PRELOAD environment (checkinstall), which instead of letting files be installed to the root filesystem structure, it creates a .deb package out of them

5) Now autodeb looks at every executable file contained in the .deb package, and calls 'ldd' on them to determine the shared libraries that they require to run

6) auto-apt is then asked to find which packages those libraries belong to, and autodeb lists these packages as dependencies for the CheckInstall-generated .deb package

Use cases

John doesn't have any experience compiling software from sources, but still he wants to install a program that isn't in any repository. He can run "autodeb tarball" and, with a bit of luck, he'll have the program packaged and installed without doing anything else.

Mary has been using GNU/Linux for a long time, and she's used to the intricacies of autoconf and compiling. However, she's a little busy at the moment and she doesn't have time to manually look for a program's dependencies to compile it. With the help of AutoDeb, she can do something else while AutoDeb builds her program for her.

Known problems and bugs

  • The "Cancel" button doesn't work in KDE, and might break things with GNOME, since it just interrupts whatever the script is doing at once
  • No prompt in the Zenity multiline textbox, it simply doesn't support it
  • No log files are created
  • The GNOME progress bar tends to move around in the window
  • The notification icon in GNOME is wrong
  • FIXED The script uses sh when it really needs Bash ( on Edgy, sh != bash ) I assume this can be fixed by changing all references to sh to bash but I have not looked at the script long enough to be sure ~Jordan_U

  • FIXED The generated .deb package does not have any dependencies listed.

  • FIXED 'configure' is very slow due to AutoApt crazily looking for packages (while only one search would be really needed)

  • Add your problems here (or contact me directly at ljlbox@tiscali.it if you can't edit this page)...

Changelog

  • 2 August 2007 Rewritten from scratch. Now uses strace instead of auto-apt, faster and with hopefully better heuristics. Runs as root, although it steps back to a normal user for sensitive operations. Two GUIs are available thanks to Zenity and KDialog.

  • 27 July 2007 Moved back from aptitude to apt-get, since it now supports dependency tracking. Preliminary implementation of [http://sourceforge.net/projects/strace/ strace]-based backend, which should be faster than auto-apt, allow for more heuristics and avoid having to hack the auto-apt scripts; auto-apt is still used for searching for packages. The variable USE_STRACE can be unset to revert to the old method.

  • 26 November 2005 Finally implemented runtime dependency installing and listing in the Depends: line of created packages.

  • 25 November 2005 Now creating a "custom" auto-apt database that only lists "-dev" packages, making "configure" much faster; implemented gzip and bzip2 archive extraction; fixed name and version extraction from archive name; various miscellaneous fixes.

  • 16 November 2005 Now using aptitude for everything, which should make the script safer, as the black magic I was using previously to find out what packages to remove at program end is no longer needed.