[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Help needed for packaging a library



Hello,

I'm trying to package a very simple hello world library, before I move to more 
complex things. The problem is that dpkg will not include the most important 
files in the finished package. Here's what I did, step by step (on a Kubuntu 
7.10 system):

1. I start with the following source files:

nonsense.h
----------
void nonsense();
----------

nonsense.c
----------
#include <stdio.h>
void nonsense() { printf("Nonsense!\n"); }
----------

configure.ac
------------
AC_PREREQ(2.61)
AC_INIT([libnonsense], [1.0], [g.chulkov@jacobs-university.de])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_PROG_LIBTOOL
AC_CONFIG_SRCDIR([nonsense.h])
AC_CONFIG_HEADER([config.h])
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
------------

Makefile.am
-----------
lib_LTLIBRARIES = libnonsense.la
include_HEADERS = nonsense.h
libnonsense_la_SOURCES = nonsense.c
libnonsense_ladir = $LIBDIR$
-----------

2. I issue the following commands:

touch AUTHORS ChangeLog NEWS README
aclocal
autoheader
libtoolize
automake --add-missing
autoconf
./configure
make
make dist

At this point I have a simple autotools distribution. ./configure && make && 
make install works perfectly from the directory resulting when the .tar.gz 
file is extracted.

3. From within the extracted libnonsense-1.0 directory, I run:
dh_make -c gpl -e 
g.chulkov@jacobs-university.de -l -f ../libnonsense-1.0.tar.gz
which outputs:
----------------------------------------------------------------------------
822-date: warning: This program is deprecated. Please use 'date -R' instead.
Maintainer name : Georgi Chulkov
Email-Address   : g.chulkov@jacobs-university.de
Date            : Thu, 27 Mar 2008 22:57:29 +0100
Package Name    : libnonsense
Version         : 1.0
License         : gpl
Type of Package : Library
Hit <enter> to confirm:
Done. Please edit the files in the debian/ subdirectory now. libnonsense
uses a configure script, so you probably don't have to edit the Makefiles.
Make sure you change the package name from libnonsenseBROKEN to something
else, such as libnonsense1 in the debian/control file.
----------------------------------------------------------------------------

4. From the debian/ directory, I delete the files AFAIK I don't need:
cron.d.ex
emacsen*
init.d.ex
libnonsense-default.ex
libnonsense.doc-base.EX
manpage*
menu.ex
post*.ex
pre*.ex
README.Debian
shlibs.local.ex
watch.ex

5. I fill in the placeholders in changelog, control and copyright, just to 
make sure. I don't touch anything else. So I end up with these, among others:

control
-------
Source: libnonsense
Priority: extra
Maintainer: Georgi Chulkov <g.chulkov@jacobs-university.de>
Build-Depends: debhelper (>= 5), autotools-dev
Standards-Version: 3.7.2
Section: libs

Package: libnonsense-dev
Section: libdevel
Architecture: any
Depends: libnonsense1 (= ${Source-Version})
Description: TODO
 TO BE DONE

Package: libnonsense1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: TODO
 TO BE DONE
------

dirs
----
usr/bin
usr/sbin
----

docs
----
NEWS
README
----

libnonsense1.dirs
-----------------
usr/lib
-----------------

libnonsense1.install
-----------------
usr/lib/lib*.so.*
-----------------

libnonsense-dev.dirs
--------------------
usr/lib
usr/include
--------------------

libnonsense-dev.install
-----------------------
usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so
usr/lib/pkgconfig/*
usr/lib/*.la
usr/share/pkgconfig/*
-----------------------

6. I run dpkg-buildpackage -rfakeroot

The result is two deb files, among other things. The problem is that they do 
not contain the library!

dpkg -c ../libnonsense1_1.0-1_i386.deb
--------------------------------------
drwxr-xr-x root/root         0 2008-03-27 23:10 ./
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/lib/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/share/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/share/doc/
drwxr-xr-x root/root         0 2008-03-27 23:10 ./usr/share/doc/libnonsense1/
-rw-r--r-- root/root        30 2008-03-27 
22:43 ./usr/share/doc/libnonsense1/changelog.gz
-rw-r--r-- root/root      1391 2008-03-27 
23:01 ./usr/share/doc/libnonsense1/copyright
-rw-r--r-- root/root       169 2008-03-27 
23:01 ./usr/share/doc/libnonsense1/changelog.Debian.gz
--------------------------------------

dpkg -c ../libnonsense-dev_1.0-1_i386.deb
-----------------------------------------
drwxr-xr-x root/root         0 2008-03-27 23:10 ./
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/lib/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/include/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/share/
drwxr-xr-x root/root         0 2008-03-27 23:09 ./usr/share/doc/
drwxr-xr-x root/root         0 2008-03-27 
23:10 ./usr/share/doc/libnonsense-dev/
-rw-r--r-- root/root        30 2008-03-27 
22:43 ./usr/share/doc/libnonsense-dev/changelog.gz
-rw-r--r-- root/root      1391 2008-03-27 
23:01 ./usr/share/doc/libnonsense-dev/copyright
-rw-r--r-- root/root       169 2008-03-27 
23:01 ./usr/share/doc/libnonsense-dev/changelog.Debian.gz
-----------------------------------------

As you can see, none of the important files are included in the packages. Why 
is that?

Also note:
ls -R debian/tmp/
-----------------
debian/tmp/:
usr

debian/tmp/usr:
include  lib

debian/tmp/usr/include:
nonsense.h

debian/tmp/usr/lib:
libnonsense.a  libnonsense.la  libnonsense.so  libnonsense.so.0  
libnonsense.so.0.0.0
-----------------

How can I include these files in the .deb packages?

Thanks in advance for any assistance!

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: