]> git.pld-linux.org Git - packages/fonts-TTF-microsoft.git/blob - license-installer.sh
- fix target option (#5783)
[packages/fonts-TTF-microsoft.git] / license-installer.sh
1 #!/bin/sh
2 if [ "$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
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
23         if echo "$3" | grep '\.src\.rpm$' >/dev/null; then
24                 (
25                 if echo "$3" | grep '://' >/dev/null; then
26                         cd $SRPMDIR
27                         wget --passive-ftp -t0 "$3"
28                 else
29                         cp -f "$3" $SRPMDIR
30                         cd $SRPMDIR
31                 fi
32                 rpm2cpio `basename "$3"` | ( cd $SPECDIR; cpio -i @BASE_NAME@.spec )
33                 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
34                         rpm2cpio `basename "$3"` | ( cd $SOURCEDIR; cpio -i @COPYSOURCES@ )
35                 fi
36                 )
37         else
38                 cp -i "$3" $SPECDIR || exit 1
39                 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
40                         for i in @COPYSOURCES@; do
41                                 cp -i @DATADIR@/$i $SOURCEDIR/$i || exit 1
42                         done
43                 fi
44         fi
45         ( cd $SPECDIR
46         /usr/bin/builder -nm -nc -ncs --with license_agreement --target @TARGET_CPU@ @BASE_NAME@.spec
47         if [ "$?" -ne 0 ]; then
48                 exit 2
49         fi
50         RPMNAMES="$RPMDIR/@BASE_NAME@-@VERSION@-@RELEASE@wla.@TARGET_CPU@.rpm"
51         rpm -Uhv $RPMNAMES || echo -e "Install manually the file(s):\n   $RPMNAMES" )
52         if [ "$BACKUP" -eq 1 ]; then
53                 if [ -f $SPECDIR/@BASE_NAME@.spec.prev ]; then
54                         mv -f $SPECDIR/@BASE_NAME@.spec.prev $SPECDIR/@BASE_NAME@.spec
55                 fi
56                 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
57                         for i in @COPYSOURCES@; do
58                                 if [ -f $SOURCEDIR/$i ]; then
59                                         mv -f $SOURCEDIR/$i.prev $SOURCEDIR/$i
60                                 fi
61                         done
62                 fi
63         fi
64 else
65         if [ "@LICENSE@" != '@'LICENSE'@' ]; then
66                 cat @LICENSE@
67                 echo "
68 If you accept the above license rebuild the package using:
69 "
70         else
71                 echo "
72 License issues made us not to include inherent files into
73 this package by default. If you want to create full working
74 package please build it with the following command:
75 "
76         fi
77         echo "$0 --with license_agreement @SPECFILE@"
78 fi
This page took 0.052579 seconds and 3 git commands to generate.