Here is a _very_ brief rundown of what's required to make a debian source package that can be uploaded to launchpad. For more information about the steps involved, look here.
First, you need a Makefile that will build your program from source (this is not necessary for precompiled java and scripts ... anything that is run via an interpreter). Your Makefile should include a clean target that will clean up any files that were compiled from source, and it should include an install target that will install all of the necessary files to the right places in the file system. Here is a very simple example:
Code:
hello-world: hello-world.o
install: hello-world
install hello-world $(DESTDIR)/usr/bin
clean:
rm -f hello-world hello-world.o
This idea is that if you were to run 'make install' in the directory containing the Makefile, all necessary compilation would be performed and all necessary files would be installed to the correct locations. Note that the installation target begins with $(DESTDIR). This is necessary in order to ensure that files can be installed to the right locations when the package is built.
Next, make sure that the base directory for your source tree is named correctly. It should be named <packagename>-<version> (e.g. helloworld-0.1). Then, create a ta ball of the source tree in the same directory that contains the bas directory of your source tree. The tarball should be named <packagename>_<version>.orig.tar.gz (e.g. tar zcf helloworld_0.1.orig.tar.gz).
Next, we have to prepare the debian files. cd back into the base directory of your source tree and run the following command: 'dh_make -e <your email address>'. This will create a directory called debian with all of the basic template files in it. You can probably 'rm -f debian/*.{ex,EX}', since you won't need any of those files in your first pass. You will have to edit the following files: changelog, control, copyright, and dirs. The dirs file should create a listing of all directories that you will be installing files into. All of the rest of the files give you hints about the expected content.
After editing all of those files, you can now attempt to build the binary package. Run 'debuild' from the base directory of your source tree. This will perform any necessary compilation, install the files to a temporary directory tree (you can find it under debian/<packagename>/), and create the debian package for your program. After it's done, you can verify that it worked correctly by running 'dpkg -c <debianfile>' (e.g. dpkg -c ../helloworld_0.1-1_i386.build) and verifying that the file listing includes all the files you expect to see.
Finally, after you know that everything is working to create binary packages, build the source package with 'debuild -S -sa'. This will create all the files that you need to have in order to upload to launchpad.
Bookmarks