- unneeded BACKUP=1 removed
[packages/fonts-TTF-microsoft.git] / license-installer.sh
CommitLineData
6de7af38
ER
1#!/bin/sh
2if [ "$1" = "--with" -a "$2" = "license_agreement" ]; then
3 TMPDIR=`rpm --eval "%{tmpdir}"`; export TMPDIR
4 SPECDIR=`rpm --eval "%{_specdir}"`; export SPECDIR
5 SRPMDIR=`rpm --eval "%{_srcrpmdir}"`; export SRPMDIR
6 SOURCEDIR=`rpm --eval "%{_sourcedir}"`; export SOURCEDIR
7 BUILDDIR=`rpm --eval "%{_builddir}"`; export BUILDDIR
8 RPMDIR=`rpm --eval "%{_rpmdir}"`; export RPMDIR
9 BACKUP=0
10 mkdir -p $TMPDIR $SPECDIR $SRPMDIR $RPMDIR $SRPMDIR $SOURCEDIR $BUILDDIR
11 if [ -f $SPECDIR/@BASE_NAME@.spec ]; then
12 BACKUP=1
13 mv -f $SPECDIR/@BASE_NAME@.spec $SPECDIR/@BASE_NAME@.spec.prev
14 fi
f0854606
ER
15 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
16 for i in @COPYSOURCES@; do
17 if [ -f $SOURCEDIR/$i ]; then
18 mv -f $SOURCEDIR/$i $SOURCEDIR/$i.prev
19 BACKUP=1
20 fi
21 done
22 fi
6de7af38 23 if echo "$3" | grep '\.src\.rpm$' >/dev/null; then
75a762f7 24 (
6de7af38 25 if echo "$3" | grep '://' >/dev/null; then
75a762f7 26 cd $SRPMDIR
6de7af38
ER
27 wget --passive-ftp -t0 "$3"
28 else
75a762f7
ER
29 cp -f "$3" $SRPMDIR
30 cd $SRPMDIR
6de7af38
ER
31 fi
32 rpm2cpio `basename "$3"` | ( cd $TMPDIR; cpio -i @BASE_NAME@.spec )
f0854606
ER
33 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
34 for i in @COPYSOURCES@; do
75a762f7 35 rpm2cpio `basename "$3"` | ( cd $TMPDIR; cpio -i $i )
f0854606
ER
36 done
37 fi
38 )
6de7af38 39 cp -i $TMPDIR/@BASE_NAME@.spec $SPECDIR/@BASE_NAME@.spec || exit 1
f0854606
ER
40 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
41 for i in @COPYSOURCES@; do
42 cp -i $TMPDIR/$i $SOURCEDIR/$i || exit 1
43 done
44 fi
6de7af38
ER
45 else
46 cp -i "$3" $SPECDIR || exit 1
f0854606
ER
47 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
48 for i in @COPYSOURCES@; do
49 cp -i @DATADIR@/$i $SOURCEDIR/$i || exit 1
50 done
51 fi
6de7af38
ER
52 fi
53 ( cd $SPECDIR
08b2b3e8 54 /usr/bin/builder -nm -nc -ncs --with license_agreement --opts --target=@TARGET_CPU@ @BASE_NAME@.spec
6de7af38
ER
55 if [ "$?" -ne 0 ]; then
56 exit 2
57 fi
58 RPMNAMES="$RPMDIR/@BASE_NAME@-@VERSION@-@RELEASE@wla.@TARGET_CPU@.rpm"
a146c9c1 59 rpm -Uhv $RPMNAMES || echo -e "Install manually the file(s):\n $RPMNAMES" )
6de7af38
ER
60 if [ "$BACKUP" -eq 1 ]; then
61 if [ -f $SPECDIR/@BASE_NAME@.spec.prev ]; then
62 mv -f $SPECDIR/@BASE_NAME@.spec.prev $SPECDIR/@BASE_NAME@.spec
63 fi
f0854606
ER
64 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
65 for i in @COPYSOURCES@; do
66 if [ -f $SOURCEDIR/$i ]; then
67 mv -f $SOURCEDIR/$i.prev $SOURCEDIR/$i
f0854606
ER
68 fi
69 done
70 fi
6de7af38
ER
71 fi
72else
1019bfb9
ER
73 if [ "@LICENSE@" != '@'LICENSE'@' ]; then
74 cat @LICENSE@
75 echo "
76If you accept the above license rebuild the package using:
77"
78 else
79 echo "
6de7af38
ER
80License issues made us not to include inherent files into
81this package by default. If you want to create full working
82package please build it with the following command:
6de7af38 83"
1019bfb9
ER
84 fi
85 echo "$0 --with license_agreement @SPECFILE@"
6de7af38 86fi
This page took 0.091269 seconds and 4 git commands to generate.