/[gentoo-x86]/eclass/debian.eclass
Gentoo

Contents of /eclass/debian.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Aug 17 18:05:02 2006 UTC (8 years, 1 month ago) by stuart
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removed unused eclass

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/debian.eclass,v 1.1 2006/05/03 07:49:27 stuart Exp $
4
5 # Author : Jonathan Scruggs <j.scruggs@gmail.com> (09 April 2006)
6 # Based on rpm.eclass by : Alastair Tse <liquidx@gentoo.org> (21 Jun 2003)
7 #
8 # Convienence class for extracting DEBs
9 #
10 # Basically, deb_src_unpack does:
11 #
12 # 1. uses debian_unpack to unpack a deb file using ar from binutils.
13 # 2. deletes all the unpacked tarballs and zip files from ${WORKDIR}
14 # NOTE: deb2targz requiers perl, and that is not a package installed
15 # by default. ar comes with binutils, so everyone should have
16 # this already, and no need for a dependency of a really large
17 # package like perl. Some users may never need perl.
18 #
19 # This ebuild now re-defines a utility function called deb_unpack which
20 # basically extracts the files out of the deb. It does not gzip the
21 # output tar again but directly extracts to ${WORKDIR}
22 #
23 # I don't know if this will handle RPMs in the list, but it will with
24 # other regular files that the unpack command can handle. :)
25
26
27 # extracts the contents of the DEP in ${WORKDIR}
28 debian_unpack() {
29 local debfile targzfile return_value
30 debfile=$1
31
32 if [ -z "${debfile}" ]; then
33 return_value=1
34 else
35 ar x ${debfile}
36 # remove unneeded files.
37 rm -f control.tar.gz debian-binary
38
39 # Make this multi-file friendly.
40 # Rename this for nice output during emerge, so
41 # Users know what file is being extracted, rahter
42 # than seeing data.tar.gz all the time.
43 targzfile=${debfile##*\/}
44 targzfile=${targzfile//.deb/.tar.gz}
45 mv data.tar.gz ${targzfile}
46
47 return_value=0
48 fi
49
50 return ${return_value}
51 }
52
53 debian_src_unpack() {
54 local x targzfile ext myfail OLD_DISTDIR
55
56 for x in ${A}; do
57 myfail="failure unpacking ${x}"
58 ext=${x##*.}
59 case "$ext" in
60 deb)
61 echo ">>> Unpacking ${x}"
62 cd ${WORKDIR}
63 debian_unpack ${DISTDIR}/${x} || die "${myfail}"
64
65 # Needed to unpack data.tar.gz
66 OLD_DISTDIR=${DISTDIR}
67 DISTDIR=${WORKDIR}
68 targzfile=${x##*\/}
69 targzfile=${targzfile//.deb/.tar.gz}
70 unpack ${targzfile}
71 rm -f ${targzfile}
72 DISTDIR=${OLD_DISTDIR}
73 ;;
74 *)
75 unpack ${x}
76 ;;
77 esac
78 done
79 }
80
81 EXPORT_FUNCTIONS src_unpack

  ViewVC Help
Powered by ViewVC 1.1.20