update buildroot - work in progress development
[cmdllinux.git] / buildroot / _buildroot / engine0040 / targz_packages
blob7acd73c7f27adeb12f178f6727bcbd8821a74b8e
1 #! /bin/sh
3 #/bin/_add_linefeed.sh
4 #/bin/_lsexecs.sh
5 #/bin/_find_dirlinks.sh
6 #_mkcpio
7 #_strip
8 #/run/... may be needed to add (pkg@run.cpio)
9 #_scripts/pkg.ver may be needed to add (git versions: 'N.N.N.{g}.[x].GITCOMMIT')
10 #_scripts/pkg.inc - package script added
11 #_scripts/pkg.keepdirs - directories not to remove
12 #_scripts/pkg.reqver - required version of other packages (if any)
13 #_scripts/pkg.distdeps - addon dependencies
14 #package/_pkgs.group@@@@
15 #---- -review "----" reamarked code "lines"
17 CREATEDIRS="\
18 etc/pam.d \
19 etc/profile.d \
20 etc/init.d \
21 etc \
22 bin \
23 sbin \
24 lib \
25 usr/share/doc \
26 usr/share/man \
27 usr/share/info \
28 usr/share \
29 usr/bin \
30 usr/sbin \
31 usr/lib \
32 usr/include \
33 usr \
34 var/cache \
35 var/lib \
36 var/log \
37 var/spool \
38 var \
41 PKG=$3
43 ###overwrite
44 [ "$PKG" = "gcc-tgt" ] && PKG=gcc
45 [ "$PKG" = "glibc-tgt" ] && PKG=glibc
46 ###overwrite
48 DONTINSTALL=" skeleton toolchain toolchain-external toolchain-external-custom initscripts jpeg busybox coreutils "
49 DONTINSTALL2=" getent jpeg toolchain-external toolchain-external-custom libgl libegl busybox mcookie libfm-extra "
50 SKIPGROUP=" input "
51 BUSYBOX_CHK=" acpid inetutils net-tools util-linux grep sed gawk findutils gzip bzip2 coreutils cpio tar psmisc procps-ng dos2unix eject fbset e2fsprogs hdparm kmod kbd cups pciutils usbutils xz man-db dosfstools reiserfsprogs ntp patch diffutils debianutils sendmail bash ash zip unzip vim wget which "
53 echo "$DONTINSTALL2" | grep -q " $PKG " && exit 0
55 DIRSCRIPT=$(cd $(dirname "$0") && pwd -P)
56 echo "***********"
57 pwd -P
58 echo "***********"
60 DESTROOT=output/target
61 BUILDROOT=output/build
62 PKGDEST=/dest
63 retval=0
64 echo "###### PKG_SCRIPT $PKG $(cat $BUILDROOT/build-sysinit.log) $1 $2"
66 if [ "$1" = "start" ] && [ "$2" = "install-target" -o "$2" = "install-staging" ]; then
68 #install-staging - install-target
69 [ -e $BUILDROOT/inst_start.log ] && exit 0
70 touch $BUILDROOT/inst_start.log
72 rm -f _scripts/$PKG.scr
74 rm -rf $DESTROOT/*
76 for i in $CREATEDIRS; do
77 mkdir -p $DESTROOT/$i
78 done
79 ln -sf share/doc $DESTROOT/usr/doc
80 ln -sf share/man $DESTROOT/usr/man
81 ln -sf share/info $DESTROOT/usr/info
82 ln -sf lib $DESTROOT/usr/lib64
83 ln -sf lib $DESTROOT/lib64
85 [ -e _scripts/$PKG.inst_start.sh ] && source _scripts/$PKG.inst_start.sh
88 if [ "$1" = "end" ] && [ "$2" = "install-target" ]; then
89 source $BUILDROOT/.package_source
90 #NAME
91 #VERSION
92 #SOURCE_DIR
94 ###overwrite
95 [ "$PKG" = "glibc" ] && NAME="glibc"
96 [ "$PKG" = "gcc" ] && NAME="gcc"
97 ###overwrite
99 [ -e $BUILDROOT/.python_version ] && PYTHON_VER=`cat $BUILDROOT/.python_version`
100 if [ ! -z "$PYTHON_VER" -a "$PYTHON_VER" = 3 ]; then
101 ###overwrite
102 if echo "$PKG" | grep -q "^python-"; then
103 NAME=`echo "$PKG" | sed 's/^python-/python3-/'`
104 #buildroot description->
105 tar xzf _scripts/files/desc.tar.gz -C _scripts desc/$PKG.desc@ 2> /dev/null
106 mv _scripts/desc/$PKG.desc@ _scripts/desc/desc@
107 #buildroot description<-
108 [ -e _scripts/$PKG.desc ] && cp _scripts/$PKG.desc _scripts/$NAME.desc
109 [ -e _scripts/$PKG.deps ] && cp _scripts/$PKG.deps _scripts/$NAME.deps
110 PKG="$NAME"
111 GRP="development python3"
113 ###overwrite
116 ###overwrite
117 [ ! -e _scripts/$PKG.rev ] && echo 1 > _scripts/$PKG.rev
118 ###overwrite
120 #update revision
121 REV=`cat _scripts/$PKG.rev`
122 [ -e _scripts/$PKG.ver ] && VERSION=`cat _scripts/$PKG.ver`
125 #rearrange some dirs
126 if [ -e $DESTROOT/var/lock ]; then
127 mkdir -p $DESTROOT/run/lock
128 LSFILE=`find $DESTROOT/var/lock -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null`
129 #mv doesn't move hidden files (.*|the dot char started filenames)
130 [ ! -z "$LSFILE" ] && mv $DESTROOT/var/lock/* $DESTROOT/run/lock
131 rmdir $DESTROOT/var/lock
133 LSFILE=
135 if [ -e $DESTROOT/run ]; then
136 mkdir -p $DESTROOT/var/run
137 LSFILE=`find $DESTROOT/run -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null`
138 #mv doesn't move hidden files (.*|the dot char started filenames)
139 [ ! -z "$LSFILE" ] && mv $DESTROOT/run/* $DESTROOT/var/run
140 rmdir $DESTROOT/run
142 LSFILE=
144 if [ -e $DESTROOT/var/run ]; then
145 echo "###### PKG_SCRIPT $PKG /var/run"
146 if ! rmdir $DESTROOT/var/run 2> /dev/null; then
147 (ODIR=`pwd`; cd $DESTROOT/var/run && _mkcpio $ODIR/_scripts/$PKG@run.cpio)
148 rm -rf $DESTROOT/var/run 2> /dev/null
149 if [ ! -e _scripts/$PKG.inst_end.sh ]; then
150 echo 'rm -rf $DESTROOT/var/run 2> /dev/null' > _scripts/$PKG.inst_end.sh
151 else
152 sh /bin/_add_linefeed.sh _scripts/$PKG.inst_end.sh
153 ! grep -qFx 'rm -rf $DESTROOT/var/run 2> /dev/null' _scripts/$PKG.inst_end.sh && \
154 echo 'rm -rf $DESTROOT/var/run 2> /dev/null' >> _scripts/$PKG.inst_end.sh
160 #remove created links (symbolic links to put some files into other directory)
161 rm -f $DESTROOT/usr/share/info/dir
162 rm -f $DESTROOT/tools/share/info/dir
164 rm $DESTROOT/usr/doc
165 rm $DESTROOT/usr/man
166 rm $DESTROOT/usr/info
167 rm $DESTROOT/usr/lib64
168 rm $DESTROOT/lib64
169 for i in $CREATEDIRS; do
170 rmdir $DESTROOT/$i 2> /dev/null
171 done
174 #call package update script
175 [ -e _scripts/$PKG.inst_end.sh ] && source _scripts/$PKG.inst_end.sh
178 #update some special packages
179 if [ -e $DESTROOT/usr/lib/perl5 ]; then
180 if [ -e _scripts/perl.ver ]; then
181 PERL=`cat _scripts/perl.ver`
182 rm -f $DESTROOT/usr/lib/perl5/$PERL/x86_64-linux/perllocal.pod
183 find $DESTROOT/usr/lib/perl5/site_perl/$PERL/x86_64-linux/auto -name ".packlist" -type f | \
184 xargs sed -i -n '/^\/usr\//p'
187 #...
188 #...
191 [ -e _scripts/$PKG.inc ] && cp _scripts/$PKG.inc _scripts/$PKG.scr
194 #create update scripts for packages which may be replaced with busybox
195 if echo "$BUSYBOX_CHK" | grep -q " $PKG "; then
196 #----run _lsexecs.sh earlyer
197 EXEC_FILES=`sh /bin/_lsexecs.sh -l $DESTROOT | sort`
198 OIFS=$IFS
199 IFS=$'\n'
200 for i in $EXEC_FILES; do
201 i=`basename "$i"`
202 [ -z "$EXEC_VAR" ] && EXEC_VAR="'$i'" || EXEC_VAR="$EXEC_VAR '$i'"
203 done
204 IFS=$OIFS
205 echo "#INC#busybox-update" >> _scripts/$PKG.scr
206 echo "#VAR#cmdlist=($EXEC_VAR)" >> _scripts/$PKG.scr
210 #create mime-info's (raw) script
211 if [ -e "$DESTROOT/usr/share/mime" ]; then
212 echo "#INC#shared-mime-info" >> _scripts/$PKG.scr
216 #create texinfo's (raw) script
217 TEXINFO=`find $DESTROOT/usr/share/info -name "*.info*" -print -quit 2> /dev/null`
218 if [ -n "$TEXINFO" ]; then
219 OPWD=`pwd`
220 cd $DESTROOT/usr/share/info
221 TI_FILES=`ls *.info*`
222 OIFS=$IFS
223 IFS=$'\n'
224 for i in $TI_FILES; do
225 [ -z "$TI_VAR" ] && TI_VAR="'$i'" || TI_VAR="$TI_VAR '$i'"
226 done
227 IFS=$OIFS
228 cd "$OPWD"
229 echo "#INC#texinfo" >> _scripts/$PKG.scr
230 echo "#VAR#filelist=($TI_VAR)" >> _scripts/$PKG.scr
234 #create package user related files
235 F_PASSWD="$BUILDROOT/tmp_passwd"
236 F_GROUP="$BUILDROOT/tmp_group"
238 if [ -e _scripts/$PKG.users ]; then
239 cat _scripts/$PKG.users | \
240 while read username uid group gid passwd home shell groups comment; do
241 if [ "$group" != "-" ]; then
242 GRPID=`grep "^${group}:" "$F_GROUP" | cut -d : -f 3`
243 if [ -z "$GRPID" ]; then
244 echo "**Group not found: ${group}**"
245 else
246 if ! echo "$processed" | grep -q "^${group}$"; then
247 if ! echo "$SKIPGROUP" | grep -q " $group "; then
248 echo "#PRI#addgroup -g $GRPID $group 2> /dev/null" >> _scripts/$PKG.scr
249 echo "#POR#delgroup $group 2> /dev/null" >> _scripts/$PKG.scr
251 [ -z "$processed" ] && processed="$group" || processed=`echo -ne "$processed\n$group"`
255 if [ "$groups" != "-" ]; then
256 OIFS=$IFS
257 IFS=$','
258 for i in $groups; do
259 GRPID=`grep "^${i}:" "$F_GROUP" | cut -d : -f 3`
260 if [ -z "$GRPID" ]; then
261 echo "**Group not found: ${i}**"
262 else
263 if ! echo "$processed" | grep -q "^${i}$"; then
264 if ! echo "$SKIPGROUP" | grep -q " $i "; then
265 echo "#PRI#addgroup -g $GRPID $i 2> /dev/null" >> _scripts/$PKG.scr
266 echo "#POR#delgroup $i 2> /dev/null" >> _scripts/$PKG.scr
268 [ -z "$processed" ] && processed="$i" || processed=`echo -ne "$processed\n$i"`
271 done
272 IFS=$OIFS
274 done
275 cat _scripts/$PKG.users | \
276 while read username uid group gid passwd home shell groups comment; do
277 [ "$shell" != "-" ] && SHELL="-s $shell" || SHELL=
278 [ "$home" != "-" ] && HHOME="-h $home" || HHOME=
279 [ "$group" != "-" ] && GROUP="-G $group" || GROUP=
280 [ "$comment" != "-" -a ! -z "$comment" ] && COMMENT="-g '$comment'" || COMMENT=
281 if [ "$username" != "-" ]; then
282 USRID=`grep "^${username}:" "$F_PASSWD" | cut -d : -f 3`
283 if [ -z "$USRID" ]; then
284 echo "**User not found: ${username}**"
285 else
286 echo "#PRI#adduser $HHOME $COMMENT $GROUP $SHELL -D -H -u $USRID $username 2> /dev/null" >> _scripts/$PKG.scr
287 echo "#POR#deluser $username 2> /dev/null" >> _scripts/$PKG.scr
288 if [ "$groups" != "-" ]; then
289 OIFS=$IFS
290 IFS=$','
291 for i in $groups; do
292 echo "#PRI#adduser $username $i 2> /dev/null" >> _scripts/$PKG.scr
293 echo "#POR#delgroup $username $i 2> /dev/null" >> _scripts/$PKG.scr
294 done
295 IFS=$OIFS
299 done
303 #create install files
304 if [ -e _scripts/$PKG.scr ]; then
305 echo -n > _scripts/$PKG.install
306 if INC=$(grep "^#INC#" _scripts/$PKG.scr); then
307 OIFS=$IFS
308 IFS=$'\n'
309 for i in $INC; do
310 INCVAL=`echo "$i" | sed 's/^#INC#//'`
311 if [ -e _scripts/scripts/$INCVAL.scr ]; then
312 [ -z "$INCSCR" ] && INCSCR="$INCVAL" || INCSCR=`echo -ne "$INCSCR\n$INCVAL"`
314 done
315 #IFS=$OIFS
317 for i in $INCSCR; do
318 grep "^#VAR#" _scripts/scripts/$i.scr | sed 's/^#VAR#//' >> _scripts/$PKG.install
319 done
321 grep "^#VAR#" _scripts/$PKG.scr | sed 's/^#VAR#//' >> _scripts/$PKG.install
323 for i in $INCSCR; do
324 grep "^#PCD#" _scripts/scripts/$i.scr | sed 's/^#PCD#//' >> _scripts/$PKG.install
325 done
327 echo "post_install() {" >> _scripts/$PKG.install
328 for i in $INCSCR; do
329 grep "^#POI#" _scripts/scripts/$i.scr | sed 's/^#POI#//' >> _scripts/$PKG.install
330 done
331 grep "^#POI#" _scripts/$PKG.scr | sed 's/^#POI#//' >> _scripts/$PKG.install
332 echo "}" >> _scripts/$PKG.install
334 echo "post_upgrade() {" >> _scripts/$PKG.install
335 for i in $INCSCR; do
336 grep "^#POU#" _scripts/scripts/$i.scr | sed 's/^#POU#//' >> _scripts/$PKG.install
337 done
338 grep "^#POU#" _scripts/$PKG.scr | sed 's/^#POU#//' >> _scripts/$PKG.install
339 echo "}" >> _scripts/$PKG.install
341 echo "post_remove() {" >> _scripts/$PKG.install
342 for i in $INCSCR; do
343 grep "^#POR#" _scripts/scripts/$i.scr | sed 's/^#POR#//' >> _scripts/$PKG.install
344 done
345 grep "^#POR#" _scripts/$PKG.scr | sed 's/^#POR#//' >> _scripts/$PKG.install
346 echo "}" >> _scripts/$PKG.install
348 echo "pre_install() {" >> _scripts/$PKG.install
349 for i in $INCSCR; do
350 grep "^#PRI#" _scripts/scripts/$i.scr | sed 's/^#PRI#//' >> _scripts/$PKG.install
351 done
352 grep "^#PRI#" _scripts/$PKG.scr | sed 's/^#PRI#//' >> _scripts/$PKG.install
353 echo "}" >> _scripts/$PKG.install
355 echo "pre_upgrade() {" >> _scripts/$PKG.install
356 for i in $INCSCR; do
357 grep "^#PRU#" _scripts/scripts/$i.scr | sed 's/^#PRU#//' >> _scripts/$PKG.install
358 done
359 grep "^#PRU#" _scripts/$PKG.scr | sed 's/^#PRU#//' >> _scripts/$PKG.install
360 echo "}" >> _scripts/$PKG.install
362 echo "pre_remove() {" >> _scripts/$PKG.install
363 for i in $INCSCR; do
364 grep "^#PRR#" _scripts/scripts/$i.scr | sed 's/^#PRR#//' >> _scripts/$PKG.install
365 done
366 grep "^#PRR#" _scripts/$PKG.scr | sed 's/^#PRR#//' >> _scripts/$PKG.install
367 echo "}" >> _scripts/$PKG.install
369 IFS=$OIFS
370 else
371 grep "^#VAR#" _scripts/$PKG.scr | sed 's/^#VAR#//' >> _scripts/$PKG.install
373 echo "post_install() {" >> _scripts/$PKG.install
374 grep "^#POI#" _scripts/$PKG.scr | sed 's/^#POI#//' >> _scripts/$PKG.install
375 echo "}" >> _scripts/$PKG.install
377 echo "post_upgrade() {" >> _scripts/$PKG.install
378 grep "^#POU#" _scripts/$PKG.scr | sed 's/^#POU#//' >> _scripts/$PKG.install
379 echo "}" >> _scripts/$PKG.install
381 echo "post_remove() {" >> _scripts/$PKG.install
382 grep "^#POR#" _scripts/$PKG.scr | sed 's/^#POR#//' | tac >> _scripts/$PKG.install
383 echo "}" >> _scripts/$PKG.install
385 echo "pre_install() {" >> _scripts/$PKG.install
386 grep "^#PRI#" _scripts/$PKG.scr | sed 's/^#PRI#//' >> _scripts/$PKG.install
387 echo "}" >> _scripts/$PKG.install
389 echo "pre_upgrade() {" >> _scripts/$PKG.install
390 grep "^#PRU#" _scripts/$PKG.scr | sed 's/^#PRU#//' >> _scripts/$PKG.install
391 echo "}" >> _scripts/$PKG.install
393 echo "pre_remove() {" >> _scripts/$PKG.install
394 grep "^#PRR#" _scripts/$PKG.scr | sed 's/^#PRR#//' | tac >> _scripts/$PKG.install
395 echo "}" >> _scripts/$PKG.install
397 anum=0
398 grep -A 1 -n "() {$" _scripts/$PKG.install | grep "^[0-9]\+-}$" | sed "s/-}$//" | \
399 while read num; do
400 sed -i "$(expr $num - $anum)d" _scripts/$PKG.install
401 sed -i "$(expr $num - 1 - $anum)d" _scripts/$PKG.install
402 anum=$(expr $anum + 2)
403 done
407 #copy in (auto)generated cpio
408 if [ -e _scripts/${PKG}@run.cpio ]; then
409 mkdir -p $DESTROOT/etc/rundir
410 cp -Rdp _scripts/${PKG}@run.cpio $DESTROOT/etc/rundir
412 #buildroot's sysvinit scripts()()
413 if [ -e $DESTROOT/etc/init.d ]; then
414 [ "$PKG" != "openrc" ] && mv $DESTROOT/etc/init.d $DESTROOT/etc/sysvinit.d
415 ####rm sysvinit runscript if there is
416 [ -e $DESTROOT/etc/sysvinit.d/rcS ] && rm $DESTROOT/etc/sysvinit.d/rcS
417 [ -e $DESTROOT/etc/sysvinit.d/rcK ] && rm $DESTROOT/etc/sysvinit.d/rcK
419 #execute permissions in /etc/profile.d
420 if [ -e $DESTROOT/etc/profile.d ]; then
421 LSFILE=`find $DESTROOT/etc/profile.d -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null`
422 [ ! -z "$LSFILE" ] && chmod 755 $DESTROOT/etc/profile.d/*
426 #copy raw package files
427 #cp ... -p -> cp ... --preserve=mode,ownership (new timestamp)
428 [ -d _scripts/files/$PKG/etc ] && cp -Rdp _scripts/files/$PKG/etc $DESTROOT
429 [ -d _scripts/files/$PKG/@file ] && cp -Rdp _scripts/files/$PKG/@file/* $DESTROOT
432 #strip
433 _strip $DESTROOT
436 #make package info files
437 mkdir -p $DESTROOT/var/lib/instpkg/local
438 mkdir -p $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV
439 mkdir -p $DESTROOT/var/lib/instpkg/local/.local
440 ln -sf ../$PKG-$VERSION-$REV $DESTROOT/var/lib/instpkg/local/.local/$PKG
441 #----move diskusage to the end of the script
442 SIZE=`du -sk $DESTROOT | grep -o "^[0-9]\+"`
443 #short descriptions
444 if [ -e _scripts/$PKG.desc ]; then
445 SHORT_DESC=`cat _scripts/$PKG.desc`
447 #write pkginfo
448 echo -ne "NAME=$NAME\nVERSION=$VERSION\nREV=$REV\nDESC=\"$SHORT_DESC\"\nSIZE=$SIZE\n" > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/info
449 #buildroot descriptions
450 #-description from python to python3
451 [ -e _scripts/desc/desc@ ] && mv _scripts/desc/desc@ $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/desc@ && rm -rf _scripts/desc
452 #-other
453 tar xzf _scripts/files/desc.tar.gz -C $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV desc/$PKG.desc@ 2> /dev/null
454 [ -e $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/desc/$PKG.desc@ ] && \
455 mv $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/desc/$PKG.desc@ $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/desc@
456 rm -rf $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/desc
458 ###overwrite
459 [ ! -e _scripts/$PKG.deps ] && touch _scripts/$PKG.deps
460 ###overwrite
463 if [ -e _scripts/$PKG.distdeps ]; then
464 sh /bin/_add_linefeed.sh _scripts/$PKG.distdeps
465 cp _scripts/$PKG.distdeps $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/distdeps
466 cat _scripts/$PKG.distdeps >> _scripts/$PKG.deps
470 sort -u _scripts/$PKG.deps > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/depends
471 cat $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/depends | tr '\n' ' ' | \
472 sed 's% $%%' > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/depend@
473 [ -z "$GRP" ] && GRP=`grep "package.*/$PKG/Config.in" package/_pkgs.group@@@@ | cut -d " " -f 1-2`
475 ###overwrite
476 [ "$PKG" = "busybox" ] && GRP="base system"
477 [ "$PKG" = "glibc" ] && GRP="base development"
478 [ "$PKG" = "gcc" ] && GRP="base development"
479 [ "$PKG" = "grub-dist" ] && GRP="base system"
480 [ "$PKG" = "busybox-init" ] && GRP="base system"
481 [ "$PKG" = "busybox-pwdutils" ] && GRP="base system"
482 [ "$PKG" = "busybox-utils" ] && GRP="base system"
483 [ "$PKG" = "busybox-dist" ] && GRP="base system"
484 ###overwrite
485 [ -z "$GRP" ] && GRP="unknown other"
487 #write groups entry
488 echo "$GRP" > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/groups
489 #copy install file
490 [ -e _scripts/$PKG.install ] && cp -dp _scripts/$PKG.install $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/install
491 #copy keepdirs file
492 [ -e _scripts/$PKG.keepdirs ] && cp -dp _scripts/$PKG.keepdirs $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/keepdirs
493 #find execs
494 LS_EXECS=`sh /bin/_lsexecs.sh $DESTROOT | sort`
495 [ ! -z "$LS_EXECS" ] && echo "$LS_EXECS" > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/execs
496 #find dirlinks
497 LS_DIRLINKS=`sh /bin/_find_dirlinks.sh $DESTROOT | sort`
498 [ ! -z "$LS_DIRLINKS" ] && echo "$LS_DIRLINKS" > $DESTROOT/var/lib/instpkg/local/$PKG-$VERSION-$REV/dirlinks
501 #targz
502 (cd $DESTROOT; tar czf $PKGDEST/$PKG-$VERSION-$REV.tar.gz *)
503 retval=$?
505 echo "$DONTINSTALL" | grep -q " $PKG " || tar xzf $PKGDEST/$PKG-$VERSION-$REV.tar.gz -C /
507 rm -rf $DESTROOT/*
509 rm -f $BUILDROOT/inst_start.log
511 exit $retval