brad's life - LD_PRELOAD to auto-create debs [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

LD_PRELOAD to auto-create debs [Sep. 23rd, 2006|06:01 pm]
Previous Entry Add to Memories Share Next Entry
[Tags|, , ]

Hack I want:

If you do "make install" on a Debian system (or a system with good package management), you cringe because you just littered your package-managed spaces with manually installed cruft that isn't accounted for.

But making Debian packages for everything (even with dh-make-perl and other helpers), is still a pain.

What about an LD_PRELOAD wrapper that intercepts all filesystem O_CREAT/writes, records them all, then when the make install is done, removes them all, makes a deb with those contents, and then dpkg -i's it?

Sure, it'll be missing dependencies, and name might be wrong according to policy, and maybe lacking some require docs/changelog in right format....

But it'd be accounted for, and thus easily removable. And would display as a conflict if you added the official packaged version later.

Lazyweb, show me that this has already been done.
LinkReply

Comments:
[User Picture]From: mart
2006-09-24 01:33 am (UTC)

(Link)

I find it's often easiest just to install in /usr/local/packagename and have done with it. Removal is just a matter of rm -rf /usr/local/packagename. It doesn't litter any package-managed namespaces, and doesn't clobber anything that other packages might depend on. It doesn't document dependencies nor comply with policy, but then neither do your magically generated deb packages.

[User Picture]From: mart
2006-09-24 01:34 am (UTC)

(Link)

Side note: I must say, it's quite novel that it's me suggesting the simpler solution to you.

[User Picture]From: gaal
2006-09-24 04:58 am (UTC)

(Link)

It does litter the environment, though, and you get to be the one setting and cleaning it :(

PATH and possibly LD_LIBRARY_PATH, etc.
From: djwatson
2006-09-24 01:47 am (UTC)

(Link)

something like checkinstall?
[User Picture]From: brad
2006-09-24 01:58 am (UTC)

(Link)

Indeed!
[User Picture]From: edm
2006-09-24 01:54 am (UTC)

Check install

(Link)

I think this is what you're looking for:

http://asic-linux.com.mx/~izto/checkinstall/

It's packaged in Debian (Sarge) and Ubuntu (Dapper) at least.

Although I generally take the /usr/local/PACKAGENAME approach (or sometimes just /usr/local -- I'm less fussed about /usr/local being littered with unpackaged junk) on most non-production boxes.

Ewen
[User Picture]From: brad
2006-09-24 01:58 am (UTC)

Re: Check install

(Link)

Awesome.

Thanks!
[User Picture]From: brad
2006-09-24 02:00 am (UTC)

Re: Check install

(Link)

Though I wish checkinstall used inotify to monitor the whole filesystem so it could work correctly with the setuid/statically linked issue in their FAQ.
From: edge_walker
2006-09-24 06:27 am (UTC)

(Link)

checkinstall predates inotify… that would be a cool feature, though.

[User Picture]From: brad
2006-09-24 07:26 am (UTC)

(Link)

Given that inotify is so new, I'd assume checkinstall is older. But their FAQ says "(yet)" implying they're looking for a new solution to an old problem.
[User Picture]From: grahams
2006-09-24 05:01 am (UTC)

(Link)

Somewhat in a different vein, but (probably 10 years ago) I had a tool for Windows that did something similar... You told it you were about to install some software, it monitored what files were written, and allowed you to ACTUALLY uninstall all of the files installed by that app (which Windows software has always been bad about, leaving DLLs littered about after uninstall). It would also allow you to make your OWN installer for an app that it tracked but that you lost the original media for.

Anyway, I just realized the other day setting up my new work machine that I still have a habit left over from these days.. I always uncheck the "Launch Newly Installed App" box at the end of any install, as letting the installer do that would muck up the log/journal for that install..
[User Picture]From: brad
2006-09-24 07:42 am (UTC)

(Link)

heh.
[User Picture]From: ciphergoth
2006-09-24 07:47 am (UTC)

(Link)

I use GNU Stow. But checkinstall looks cute!
[User Picture]From: askbjoernhansen
2006-09-24 08:23 am (UTC)

stow++

(Link)

yeah, I use stow too -- everything that's not an RPM goes into /pkg/packages/$package and stow makes a symlink tree into /pkg.

- ask
[User Picture]From: dossy
2006-09-24 12:07 pm (UTC)

(Link)

Newsflash: brad asks for "apt-get install system-restore". Film at 11.
[User Picture]From: brad
2006-09-24 06:10 pm (UTC)

(Link)

Except not.
[User Picture]From: scosol
2006-09-25 02:54 am (UTC)

(Link)

i use a distribution to maintain the kernel, and the 'base' (toolchain, system apps etc)
then i just install everything by hand in to usr local-
seems to work for me...
[User Picture]From: scosol
2006-09-25 02:54 am (UTC)

(Link)

of course- the ultimate solution is the AppDir.