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