1

I am quite familiar with writing small programs or scripts, and I am also familiar with downloading a source tarball and installing it using ./configure && make && make install (or, failing that, doing whatever the INSTALL or README files tell me to do). However, I don't know how to take a script that I've written and package it up (along with its supporting files) so that it can be installed as above.

I've tried Googling, but I'm not sure what search terms to use. If I try something involving the word "package," I get guides on how to convert a tarball to a deb/rpm/miscellaneous-distro-specific-package-format, which is not what I want.

I guess I need to use something called a build system, which might be called autotools, unless it's actually cmake, rake, scons, or something else?

Also, if my program requires some supporting files, how might I need to modify my program so that it can locate those files once they have been installed in /usr/share, /usr/lib, and wherever else they end up after installation?

Basically, I'm looking to graduate from writing scripts to writing distributable programs.

Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
  • This is the exact problem configure scripts are designed to solve. Don't forget you can pass arguments to conventional configure scripts, such as --prefix. Might also be helpful to you (instead of passing --prefix to configure): http://stackoverflow.com/questions/230364/how-to-get-rpath-with-origin-to-work-on-codeblocks-gcc –  Feb 26 '10 at 04:16
  • I mean, I don't have any configure scripts. I just have a script that I use, along with maybe a few support files. I want to know how to get a configure script. Do I write it myself? Does a program generate it for me? Which program, and what information do I need to provide to it? – Ryan C. Thompson Feb 26 '10 at 04:20
  • 1
    Build systems like autotools generate configure scripts for you. It's not uncommon for various languages/environments to have their own equivalents, like "setup.py" for Python. (Did I misunderstand the question? I thought you were trying to avoid configure scripts completely.) –  Feb 26 '10 at 04:31
  • I suppose my question sort of boils down to "How do I learn how to use autotools to distribute my program as a tarball?" Unless there's something better than autotools that I should be using instead. – Ryan C. Thompson Feb 26 '10 at 08:18

1 Answers1

2

Answering your question "How do I learn how to use autotools to distribute my program as a tarball?"

http://www.gnu.org/software/autoconf/manual/

http://www.gnu.org/software/automake/manual/ and

http://sources.redhat.com/autobook/ (Outdated but still useful)

kazanaki
  • 7,988
  • 8
  • 52
  • 79