There was a tool I used years ago that would build rpm's from makefile-based build files. Basically, you would do './configure && make && [app name] make install' and it would then run a dummy 'make install', monitor syscalls that did copying etc. and make an rpm from that. That was easy enough to make packages from tarballs. Anything more complicated (like, having to actually know the package file formats) - forget it.
Anyone know the name of this tool? It was unmaintained for a long time already when I stopped using Linux, and that was 10 years ago.