How do I create a native Debian package for static files? How do I create a native Debian package for static files? linux linux

How do I create a native Debian package for static files?


I would say easiest thing would be to:

  1. Create a makefile, that will install the files as you want them honoring any DESTDIR setting and do nothing for default target. Something along the lines of:

    all: # nothing to buildinstall:    cp -r share/* $(DESTDIR)/usr/share/statrec/$(VERSION)

    The DESTDIR thing is important; it will not be installing to the system, but instead to a temporary directory that dpkg will than pack up. All symlinks must point to the final destinations (without $(DESTDIR) prefix).

  2. Let dh_make --native do it's business (it will create another makefile debian/rules that will call the first makefile).

  3. Look at the files under debian. Especially debian/changelog may need editing (it's where debuild /dpkg-buildpackage get the version number from, so it must be filled in).

    I believe debuild uses fakeroot automatically, for dpkg-buildpackage you have to specify it manually. Don't even think about running it as real root.

  4. Use debuild or dpkg-buildpackage -rfakeroot to build it

No need to care for uninstalling as dpkg is going to handle that.

Update: I suggest dh_make --native, because I understood the question is for simply installing a handful of data files on a handful of debian systems. If it should be distributed, I suggest simply going to ask on the irc.debian.org#debian IRC channel and probably leaving it up to Debian Developer (only Debian Developers may upload to Debian archive and they usually want to handle the packaging themselves).

Also if it's part of software rather than stand-alone bunch of data files, the installation should be part of the general installation of the software using one common makefile, there should be just one Debian source package and just the debian/control and debian/*.files should specify which files go to the application package (which is "Architecture: any") and which files go to the data package (which is "Architecure: all" and usually gets suffix -data).


I found saurik's (of cydia/jailbreak fame) "Hosting a Cydia Repository" guide useful for creating your own .deb files. Have a look at it here: http://www.saurik.com/id/7


You should read section 15.2.2 in the debian-handbook.

I found it helpfull to just create a .install file and skip that Makefile part, for my own project