]> git.pld-linux.org Git - packages/fonts-TTF-microsoft.git/blob - license-installer.sh
- parse @DATADIR@ macro in license_installer.sh
[packages/fonts-TTF-microsoft.git] / license-installer.sh
1 #!/bin/sh
2 if [ "$1" = "--with" -a "$2" = "license_agreement" ]; then
3         tmp=$(mktemp -d)
4         SRPMDIR=`rpm --define "_topdir $tmp" --eval "%{_srcrpmdir}"`
5         BUILDDIR=`rpm --define "_topdir $tmp" --eval "%{_builddir}"`
6         RPMDIR=`rpm --define "_topdir $tmp" --eval "%{_rpmdir}"`
7         PACKAGEDIR="$tmp/packages/@BASE_NAME@"
8         mkdir -p $SRPMDIR $RPMDIR $SRPMDIR $BUILDDIR $PACKAGEDIR
9
10         if echo "$3" | grep '\.src\.rpm$' >/dev/null; then
11                 (
12                 if echo "$3" | grep '://' >/dev/null; then
13                         cd $SRPMDIR
14                         wget --passive-ftp -t0 "$3"
15                 else
16                         cp -f "$3" $SRPMDIR
17                 fi
18                 rpm2cpio `basename "$3"` | ( cd $PACKAGEDIR; cpio -i @BASE_NAME@.spec )
19                 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
20                         rpm2cpio `basename "$3"` | ( cd $PACKAGEDIR; cpio -i @COPYSOURCES@ )
21                 fi
22                 )
23         else
24                 cp -i "$3" $PACKAGEDIR || exit 1
25                 if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then
26                         for i in @COPYSOURCES@; do
27                                 cp -i @DATADIR@/$i $PACKAGEDIR/$i || exit 1
28                         done
29                 fi
30         fi
31         ( cd $PACKAGEDIR
32         nd=
33         if [ '@USE_DISTFILES@' = 'no' ]; then
34                 nd=-nd
35         fi
36         /usr/bin/builder --define _topdir $tmp $nd -nm -nc -ncs --with license_agreement --target @TARGET_CPU@ @BASE_NAME@.spec
37         if [ "$?" -ne 0 ]; then
38                 exit 2
39         fi
40         RPMNAMES="$RPMDIR/@BASE_NAME@-@VERSION@-@RELEASE@wla.@TARGET_CPU@.rpm"
41         rpm -Uhv $RPMNAMES || echo -e "Install manually the file(s):\n   $RPMNAMES" )
42 else
43         if [ "@LICENSE@" != '@'LICENSE'@' ]; then
44                 cat @LICENSE@
45                 echo "
46 If you accept the above license rebuild the package using:
47 "
48         else
49                 echo "
50 License issues made us not to include inherent files into
51 this package by default. If you want to create full working
52 package please build it with the following command:
53 "
54         fi
55         echo "$0 --with license_agreement @SPECFILE@"
56 fi
This page took 0.027624 seconds and 3 git commands to generate.