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

Re: Packages



"KH" == Kai Henningsen <kai@khms.westfalen.de> writes:

  KH> rshutt@ravenet.com (Randall Shutt)  wrote on 15.02.96 in <[🔎] Pine.LNX.3.91.960215082951.3145A-100000@extacy.tical.com>:
  >> > dselect). Maybe there is same way of preparing .deb package from normal
  >> > one in usual .tgz format??
  >> >
  >> > Thanks in advance!
  >> >
  >> 
  >> Makeing .deb's is VERY simple.  Too bad dpkg-deb doesnt have a
  >> manual page.  Basically, to get an idea of what you have to do, use

  KH> Well, the following shell script will do it. Input a Slackware package,  
  KH> output a Debian package.

  KH> Maybe something like this should go into the dpkg package?

  KH> For package names, maybe you should call them localxyz to avoid clashing  
  KH> with a future Debian package.

  KH> #!/bin/sh
  KH> # This is a shell archive (produced by GNU sharutils 4.1).
  KH> # To extract the files from this archive, save it to some FILE, remove
  KH> # everything before the `!/bin/sh' line above, then type `sh FILE'.
 
    [remainder of shell script elided -- please see original]

    I did that and it gave me this:

---------------------------- quote --------------------------
#!/bin/bash

#    Minimal conversion of a Slackware package to a Debian package
#    Copyright (C) 1996 Kai Henningsen <kai@khms.westfalen.de>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

usage(){
	echo
	echo Usage:
	echo $0 arch.tar.gz debname debversion myemail '"debdescription"'
	echo
	echo Minimal conversion of a Slackware package to a Debian package
	echo "  arch.tar.gz        - the Slackware package to convert"
	echo "  debname            - the name of the package to create"
	echo "  debversion         - the version number"
	echo "  myemail            - your email address"
	echo "  \"debdescription\"   - a description string"
	echo
	echo For best effect, run as root
	echo Will not preserve groups and/or users that don\'t exist
	echo on your system
	echo
	exit 255
}

[ $# != 5 ] && usage ;

work=/tmp/slack2deb.$$

mkdir $work

tar -x -C $work -z -f $1

mkdir $work/DEBIAN

cat >$work/DEBIAN/control <<EOF
Package: $2
Version: $3
Maintainer: $4
Description: $5
EOF

dpkg-deb -b $work

dpkg-name $work.deb

rm -rf $work
------------------------------- unquote -----------------------

    AFAICT, this script will accept any `.tar.gz' file whatsoever,
unpack it under $work, create the file $work/DEBIAN/control, and then
merely feed the entire $work directory tree to `dpkg-deb', resulting
in a `.deb' file structure that can be read by `dpkg'.

    Is that correct?

    Bill

-- 
<bhogan@rahul.net> |- "5. Improve constantly and forever the system of
production and service, to improve quality and productivity, and thus
constantly decrease costs." (W. Edwards Deming)


Reply to: