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

Re: Proposal: New source format (was Re: [Fwd: Re: dpkg question])



Craig Sanders:
> Maybe this could be solved with a new field:
> 
>     UnpackDir: /usr/src/debian
> 
> or for archives which unpack in ./
> 
>     UnpackDir: /usr/src/debian/package-version

That's a good location.  I like it a bit better than 
/var/lib/dpkg/source/package-version (my previous suggestions)

I don't think we need a field for that though - just have dpkg always
install the source there, unless some command-line override option
is used. 

Remember, of course, I'm advocating packaging source files in .sdeb and
.upsdeb files, and using dpkg to "install" them (where installing means
just copying the source - not unpacking upstream sources, patching,
compiling, building, etc...)

A sample session:

dpkg -i jdk_1.0.2-7.sdeb   jdk_1.0.2-2.upsdeb   debmake_3.3.1.deb
        ^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^
        Debian Source      Upstream Source      Binary Package

would install all of these at once (perhaps the .sdeb depends on the
other two) 

The binary package (debmake_3.3.1.deb) would go where it goes now.

The upstream source package (jdk_1.0.2-2.upsdeb) would go into
  /usr/src/debian/upsdeb/jdk_1.0.2-2

  It would look like:
  /usr/src/debian/upsdeb/jdk_1.0.2-2/linux.jdk-1.0.2-pl2.common.tar.gz
  /usr/src/debian/upsdeb/jdk_1.0.2-2/linux.jdk-1.0.2-pl2.shared-motif2.tar.gz
  /usr/src/debian/upsdeb/jdk_1.0.2-2/linux.jdk-1.0.2-pl2.static-motif.tar.gz
  /usr/src/debian/upsdeb/jdk_1.0.2-2/md5-10-17-96

  (see, nothing's been unpacked or touched or anything)  

The source package (jdk_1.0.2-7.sdeb) would go into 
  /usr/src/debian/sdeb/jdk_1.0.2-7

  It would look like:

  /usr/src/debian/sdeb/jdk_1.0.2-7
  /usr/src/debian/sdeb/jdk_1.0.2-7/debian
  /usr/src/debian/sdeb/jdk_1.0.2-7/debian/control
  /usr/src/debian/sdeb/jdk_1.0.2-7/debian/rules
  /usr/src/debian/sdeb/jdk_1.0.2-7/debian/.....
  /usr/src/debian/sdeb/jdk_1.0.2-7/patches/
  /usr/src/debian/sdeb/patches/patch-common.1
  /usr/src/debian/sdeb/patches/patch-shared.1
  /usr/src/debian/sdeb/patches/patch-static.1
  
A quick overview of the build process:

  We might add another phony target in the debian/rules makefile 
  called unpack:

  ie.  (I cheated by only doing the static part of the package below)

  unpack:
          # Unpack upstream sources into ./java
          tar xzvf /usr/src/debian/upsdeb/jdk_1.0.2-2/linux.jdk-1.0.2-pl2.commo
n.tar.gz
          tar xzvf /usr/src/debian/upsdeb/jdk_1.0.2-2/linux.jdk-1.0.2-pl2.stati
c-motif.tar.gz
	  # Do our patches
          patch -p0 patches/patch-common.1
          patch -p0 patches/patch-static.1
 
  binary-arch:    checkroot unpack build
          $(checkdir)
          ....  code to build package

I hope that this demonstrates to people that the changes needed are extremely
minimal.

Another thing I should add:  before I was advocating the use of a SrcDepends:
field in the .sdeb package.  That probably isn't necessary if dpkg does 
everything.
Just add all the upstream sources as standard dependencies.  

ie. (in jdk_1.0.2-7.sdeb)

Depends: jdk.upsdeb (=1.0.2-2), debmake (>=3.3.1)
         ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^
         Upstream source        Binary package

On second thought, that won't exactly work, since '.'s are a valid part of a 
package name.  Maybe something like:

Depends: upsdeb/jdk (=1.0.2-2), debmake (>=3.3.1)

Also, I had previously suggested that the upstream source packages might need
dependencies.  I don't think so anymore, since the dependencies on binary
packages needed to unpack wierd upstream source formats could just reside
in the .sdeb's.

> There would then be a standard source unpacker script which did something
> like:
> 
>     mkdir -p $UnpackDir
>     cd $UnpackDir
>     srcformat=`some-script-to-figure-out-what-it-is`
>     case $srcformat in 
>         tar.gz) ... ;;
>         tar)    ... ;;
>         shar)   ... ;;
>         zip)    ... ;;
>         arj)    ... ;;
>     esac

I'd prefer to not have a standard source unpacker script, but rather do
everything "by hand" in debian/rules.  Of course, debmake might choose to
automatically do something like the above.  :-)

Cheers,

 - Jim



Attachment: pgpTlfJjdpmQH.pgp
Description: PGP signature


Reply to: