I have a need to Debianize some static resources for a software project but am confused by the available information and could use some guidance in doing so. Here are the materials I've been reading:
The Debian New Maintainer's Guide seems the most apropos, especially this chapter, but it's didactic presentation is not effective for me; it reads more as a re-learning reference than a guide for the unknowing. Much of the information I've found is likewise geared to getting packages included in a public repository which I do not need. To make it that some kindly folk might show me the way, I've created a small project statrec which exemplifies the type of package I need to create. It's source tree looks like so:
statrec/
├── LICENSE
├── README.md
├── share
│ ├── gilgamesh.txt
│ └── thoreau.txt
└── VERSION
I need to but am unable to deduce how to:
statrec/share
to /usr/share/statrec/VERSION/
,/usr/share/statrec/current/
to /usr/share/statrec/VERSION/
and thenI understand how to accomplish some of this, maybe which tools to use but feel rather paralized by the surfeit of information.
Most Linux programs are written in the C programming language. These are the C libraries and header files gcc needs to link with to create object files. As I write this, Debian is in a transition between libc5 and libc6. Any new packages should be created using libc6.
From debian.orgYou can do a manual download from http://www.debian.org/distrib/packages. When you are on the page of the package, choose a distribution, and you will have a link to the three files which make the source package.
I would say easiest thing would be to:
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 build
install:
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).
Let dh_make --native
do it's business (it will create another makefile debian/rules
that will call the first makefile).
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.
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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With