Subject: Problems unpacking dpkg-1.1.2elf.deb

From: Geert Uytterhoeven <[email-masked]>
Date: Tue, 18 Jun 1996 10:35:36 +0200 (MET DST)

I tried the steps JÜrgen told. I downloaded

   dpkg-1.1.2elf.nondebbin.tar.gz	(from ftp.phil.uni-sb.de)
   dpkg-1.1.2elf.deb			(from our local Debian mirror)

And extracted dpkg-1.1.2elf.nondebbin.tar.gz. Then I tried the `dpkg -i'. I
added the `--force-depends' option because I didn't install the Debian libc
etc. and ran against the following problem:

| bash# dpkg -i --force-depends /var/tmp/new/debian/dpkg-1.1.2elf.deb
| dpkg: regarding /var/tmp/new/debian/dpkg-1.1.2elf.deb containing dpkg, pre-dependency problem:
|  dpkg pre-depends on libc5
|   libc5 is not installed.
| dpkg: warning - ignoring pre-dependency problem !
| dpkg: regarding /var/tmp/new/debian/dpkg-1.1.2elf.deb containing dpkg, pre-dependency problem:
|  dpkg pre-depends on ncurses3.0
|   ncurses3.0 is not installed.
| dpkg: warning - ignoring pre-dependency problem !
| (Reading database ... 0 files and directories currently installed.)
| Unpacking dpkg (from /var/tmp/new/debian/dpkg-1.1.2elf.deb) ...
| dpkg: dpkg: dependency problems, but configuring anyway as you request:
|  dpkg depends on libc5; however:
|   Package libc5 is not installed.
|  dpkg depends on ncurses3.0; however:
|   Package ncurses3.0 is not installed.
| Setting up dpkg ...
| install-info: failed to lock dir for editing! No such file or directory
| dpkg: error processing dpkg (--install):
|  subprocess post-installation script returned error exit status 2
| Errors were encountered while processing:
|  dpkg
| bash#

Any clues?

Greetings,

						Geert

--
Geert Uytterhoeven                     [email-masked]
Wavelets, Linux/m68k on Amiga          http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

---

From: Michael Schmitz <[email-masked]>
Date: Tue, 18 Jun 1996 11:27:52 +0200 (MET DST)

On Tue, 18 Jun 1996, Geert Uytterhoeven wrote:

Geert,

> | Errors were encountered while processing:

Yes - the file /usr/info/dir (from the Gnu info package) is missing, and
install-info tries to add the dpkg.info nodes to it :-)

Gave me some headache some weeks ago, too ...

If you don't find a 'dir', I'll send one.

	Michael

---

From: Juergen Menden <[email-masked]>
Date: Tue, 18 Jun 1996 15:12:50 +0200 (MET DST)

On Tue, 18 Jun 1996, Michael Schmitz wrote:
> > install-info: failed to lock dir for editing! No such file or directory
> 
> the file /usr/info/dir (from the Gnu info package) is missing, 

thanks for the test. i've updated the How-to-join text suggestions
welcome.

jjm

======================================================================
    First Steps in Building Debian Linux Packages for m68k-linux
======================================================================

Version: 0.2
Date: Tue Jun 18 14:32:32 MET DST 1996
Author: Juergen Menden <[email-masked]>

======================================================================

0. Changes:

   * many, many, many. I hope this is now more readable and more
     informative.

======================================================================

1. Where to find the Debian stuff?

primary site is ftp.debian.org:/debian, nevertheless you should use
one of the mirrors, eg:

  ftp.tower.net.au       /pub/linux/debian               (Australia)
  ftp.inf.tu-dresden.de  /pub/os/linux/debian            (Germany)
  ftp.caldera.com        /pub/mirrors/debian             (Utah)
  tsx-11.mit.edu         /pub/linux/distributions/debian (Massachusetts)

(see there the file README.mirrors for a lot more)

the sources can be found in unstable/sources, binary distributions are
in unstable/binary-m68k.

======================================================================

2. How to start with Debian?

first you need dpkg. get the file 

  project/experimental/dpkg-<version>.m68k.nondebbin.tar.gz

from your debian mirror and install it by untarring it from the root
directory. after that you can (and must) use dpkg to install dpkg
again. get

   base/dpkg-<version>.deb

from the binary directory on the ftp archive 
and type

   dpkg -i --force-depends dpkg-<version>.deb

======================================================================

3. What if that doesn't work?

if dpkg is dumped due to a SIGPIPE you probably have installed the
watchtower filesys. the getty on that filesys is broken. replace
it. FIXME: where to get a replacement?

On the other hand, if dpkg says 

  [...]
  Setting up dpkg ...
  install-info: failed to lock dir for editing! No such file or directory
  dpkg: error processing dpkg (--install):
   subprocess post-installation script returned error exit status 2
  Errors were encountered while processing:
   dpkg

you miss the file /usr/info/dir. If you create an empty file (eg with
touch /usr/info/dir) this error should vanish.

======================================================================

4. How to build a binary package?

First you have to get the debian source file from the sources
archive. for nearly every package there is a .tar.gz file containing
the sources, patched for debian needs, and a diff file with the
changes of the package relative to the original upstream version.

If you untar a debian source archive, you will find some debian.*
files in it. to build a binary package just type:

   ./debian.rules build

and then as root:

   ./debian.rules binary

Why this? The debian.rules file is a makefile with

   #!/usr/bin/make -f

in the first line. so alternatively you can also type

   make -f debian.rules build

and then as root

   make -f debian.rules binary

======================================================================

5. During build dpkg complains that an Architecture field is missing!

you will need to add one. ;-) eg: add somewhere to the debian.control
a line

   Architecture: =A

and to the debian.rules (somewhere at the top)

   arch=$(shell dpkg --print-architecture)

now change a line (at the binary target) from

   sed -e '2s/=V/$(version)/' ... \
     debian.changes >debian-tmp/DEBIAN/control

to

   sed -e '2s/=V/$(version)/' -e '3s/=A/$(arch)/' ... \
     debian.changes >debian-tmp/DEBIAN/control

(provided that the Architecture field is in line 3 of the control
file).

Generally speeking, when you change the sources try to adapt your
changes to the style you find as close as possible. This will make it
easier to get the source maintainer to include your patch to the next
release.

======================================================================

6. During build dpkg complains that a Section/Priority field is
   missing!

Ignore this warning. this is a bug of your dpkg. upgrade!

======================================================================

7. How to name the package file?

Well, many packages follow different naming conventions. Simply use
the dpkg-name prog from the latest dpkg package to rename the .deb
file (see "man dpkg-name").

======================================================================

8. How to prepare a package for uploading?

At first rename the binary packages with dpkg-name. Then run

   dchanges -p *.deb

to build a *.changes file. You have to edit the Maintainer field to
place your name and e-mail address there, rather than that of the
source maintainer. This field is only used by the upload processing
script to send an ack or an error log back to you.

Now rename the *.changes file to *.m68k.changes.

Footnote: you can call the .changes file by any name you like, as 
long as it ends with .changes. This is just a convention to avoid
conflicts. 

======================================================================

9. dchanges doesn't add files section!

You use dchanges-3.3. Patch /usr/bin/dchanges with the following diff:

----------------------------------------------------------------------
--- dchanges.~1~	Sat May  4 08:01:18 1996
+++ dchanges	Sat Jun  8 21:35:12 1996
@@ -217,7 +217,7 @@
   fi
 
   # output files
-  if [ -n "${TAR_FILE}${DIFF_FILE}${UNK_FILES}" ]
+  if [ -n "${TAR_FILE}${DIFF_FILE}${UNK_FILES}${DEB_FILES}" ]
   then
     # figure out section
     if [ -z "$SECTION" ]
----------------------------------------------------------------------

======================================================================

10. Where to upload files?

You need an account on master.debian.org to upload your files. Ask

    Simon Shapiro <[email-masked]> 

(maintainer of master.debian.org) to give you one. Uploads should go
to

   /pub/Debian/ftp/private/project/Incoming 

on master. This directory will be processed by a script, so a correct
.changes file is important

======================================================================

11. What files should be uploaded?

Only the *.m68k.deb and *.m68k.changes files.

======================================================================

12. Where to do the patches i needed to build?

If you had to change the source package you should send the diffs you
made as bug report to

   [email-masked]

the first 2 lines of the _body_ should be

   Package: <source package name>
   Version: <version>-<debian revision>

eg:

   Package: hello
   Version: 1.2.3-4

See also doc/bug-reporting.txt on the ftp server.

======================================================================

13. Where do i get more information?

Generally it's good to read the files in doc/* on the ftp
server. Esp. in the doc/package-developer/ subdirectory. Also there
exist some mailing lists: First of all 

   [email-masked]

which is the home list of the m68k port. To subscribe, send a mail
with the word "subscribe" in the subject line to
[email-masked].

   [email-masked] 

is the general developers list of debian. As most bug reports and any
upload notices are forwarded to this list, there is really much
traffic. If you want to subscribe send mail to Bruce Perens
<[email-masked]>.

======================================================================

-- 
Juergen Menden                   | Disclaimer: The opinions expressed by me, 
tel:    +49 (89) 289 - 22387     +-----------+ are (usually) not the opinions 
e-mail: [email-masked]     | of anyone else on this planet.

Hi! I'm a .signature virus!  Add me to your .signature and join in the fun!

---

From: Geert Uytterhoeven <[email-masked]>
Date: Wed, 19 Jun 1996 11:15:38 +0200 (MET DST)

>    dpkg -i --force-depends dpkg-<version>.deb

I touched /usr/info/dir, and still no go :-(

| bash# dpkg -i --force-depends /var/tmp/new/debian/dpkg-1.1.2elf.deb
| dpkg: regarding /var/tmp/new/debian/dpkg-1.1.2elf.deb containing dpkg, pre-dependency problem:
|  dpkg pre-depends on libc5
|   libc5 is not installed.
| dpkg: warning - ignoring pre-dependency problem !
| dpkg: regarding /var/tmp/new/debian/dpkg-1.1.2elf.deb containing dpkg, pre-dependency problem:
|  dpkg pre-depends on ncurses3.0
|   ncurses3.0 is not installed.
| dpkg: warning - ignoring pre-dependency problem !
| (Reading database ... 80 files and directories currently installed.)
| Preparing to replace dpkg (using /var/tmp/new/debian/dpkg-1.1.2elf.deb) ...

Here I hit CTRL-C after perl had consumed about 10 minutes of CPU time....

| dpkg: warning - old pre-removal script killed by signal (Interrupt)
| dpkg - trying script from the new package instead ...
| install-info: failed to lock dir for editing! File exists
| dpkg: error processing /var/tmp/new/debian/dpkg-1.1.2elf.deb (--install):
|  subprocess new pre-removal script returned error exit status 2
| install-info: failed to lock dir for editing! File exists
| dpkg: error while cleaning up:
|  subprocess post-installation script returned error exit status 2
| Errors were encountered while processing:
|  /var/tmp/new/debian/dpkg-1.1.2elf.deb

---

From: Juergen Menden <[email-masked]>
Date: Wed, 19 Jun 1996 12:10:23 +0200 (MET DST)

> I touched /usr/info/dir, and still no go :-(

bad. i think, this is a bug in dpkg. here is the dir file
which is provided by the base package (in postrm if someone
searches for it... ;-). it's uuencoded because there are some
control sequences in it.

----------------------------------------------------------------
----------------------------------------------------------------

tell me if this works. if so, i include this in the How-to-join.
(if not... grml ;-)

ciao
jjm