3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL)". You may
5 # only use this file in accordance with the terms of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2012, Andrzej Szeszo
17 #SRCREPO=http://pkg.openindiana.org/legacy
18 #PKGLIST=pkg:/cde/$PREFIX@0.5.11,5.11-0.134:20100302T005909Z
27 [ -f $ARCHIVE ] && exit 0
29 if [ ! -d $PREFIX.pkgrecv
]; then
31 pkgrecv
-s $SRCREPO -d $PREFIX.pkgrecv
--raw $PKGLIST
36 while [ ! x
$1 = x
]; do
40 path
=`echo $parm|sed s/^path=//`
43 variant
=`echo $parm|sed s/^variant.arch=//`
50 if [ -z $variant ]; then
51 mkdir
-p $PREFIX/i386
/$path
52 mkdir
-p $PREFIX/sparc
/$path
53 elif [ $variant = i386
]; then
54 mkdir
-p $PREFIX/i386
/$path
55 elif [ $variant = sparc
]; then
56 mkdir
-p $PREFIX/sparc
/$path
64 while [ ! x
$1 = x
]; do
68 path
=`echo $parm|sed s/^path=//`
71 mode
=`echo $parm|sed s/^mode=//`
74 variant
=`echo $parm|sed s/^variant.arch=//`
81 if [ -z $variant ]; then
82 [ -f $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
83 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
84 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/i386
/$path
85 chmod $mode $PREFIX/i386
/$path
86 [ -f $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
87 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
88 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/sparc
/$path
89 chmod $mode $PREFIX/sparc
/$path
90 elif [ $variant = i386
]; then
91 [ -f $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
92 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
93 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/i386
/$path
94 chmod $mode $PREFIX/i386
/$path
95 elif [ $variant = sparc
]; then
96 [ -f $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
97 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
98 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/sparc
/$path
99 chmod $mode $PREFIX/sparc
/$path
106 while [ ! x
$1 = x
]; do
110 path
=`echo $parm|sed s/^path=//`
113 target
=`echo $parm|sed s/^target=//`
116 variant
=`echo $parm|sed s/^variant.arch=//`
123 if [ -z $variant ]; then
124 [ -f $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
125 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
126 ln `dirname $PREFIX/i386/$path`/$target $PREFIX/i386
/$path
127 [ -f $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
128 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
129 ln `dirname $PREFIX/sparc/$path`/$target $PREFIX/sparc
/$path
130 elif [ $variant = i386
]; then
131 [ -f $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
132 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
133 ln `dirname $PREFIX/i386/$path`/$target $PREFIX/i386
/$path
134 elif [ $variant = sparc
]; then
135 [ -f $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
136 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
137 ln `dirname $PREFIX/sparc/$path`/$target $PREFIX/sparc
/$path
144 while [ ! x
$1 = x
]; do
148 path
=`echo $parm|sed s/^path=//`
151 target
=`echo $parm|sed s/^target=//`
154 variant
=`echo $parm|sed s/^variant.arch=//`
161 if [ -z $variant ]; then
162 [ -h $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
163 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
164 ln -s $target $PREFIX/i386
/$path
165 [ -h $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
166 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
167 ln -s $target $PREFIX/sparc
/$path
168 elif [ $variant = i386
]; then
169 [ -h $PREFIX/i386
/$path ] && rm -f $PREFIX/i386
/$path
170 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
171 ln -s $target $PREFIX/i386
/$path
172 elif [ $variant = sparc
]; then
173 [ -h $PREFIX/sparc
/$path ] && rm -f $PREFIX/sparc
/$path
174 [ ! -d `dirname $PREFIX/i386/$path` ] || mkdir
-p `dirname $PREFIX/i386/$path`
175 ln -s $target $PREFIX/sparc
/$path
183 while [ ! x
"$1" = x
]; do
186 license
=`echo $parm|sed s/^license=//`
192 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/i386
/"$license"
193 cp `ls $PREFIX.pkgrecv/*/*/$hash|head -1` $PREFIX/sparc
/"$license"
198 for i
in $PREFIX.pkgrecv
/*/*/manifest.dir
; do
202 for i
in $PREFIX.pkgrecv
/*/*/manifest.
file; do
206 for i
in $PREFIX.pkgrecv
/*/*/manifest.hardlink
; do
210 for i
in $PREFIX.pkgrecv
/*/*/manifest.link
; do
214 for i
in $PREFIX.pkgrecv
/*/*/manifest.license
; do
218 tar cf
- $PREFIX |
gzip -9 >$ARCHIVE
220 rm -rf $PREFIX.pkgrecv
$PREFIX