]>
Commit | Line | Data |
---|---|---|
6de7af38 ER |
1 | #!/bin/sh |
2 | if [ "$1" = "--with" -a "$2" = "license_agreement" ]; then | |
4bbcd571 | 3 | tmp=$(mktemp -d) |
4bbcd571 | 4 | SRPMDIR=`rpm --define "_topdir $tmp" --eval "%{_srcrpmdir}"` |
4bbcd571 ER |
5 | BUILDDIR=`rpm --define "_topdir $tmp" --eval "%{_builddir}"` |
6 | RPMDIR=`rpm --define "_topdir $tmp" --eval "%{_rpmdir}"` | |
457c04ac | 7 | PACKAGEDIR="$tmp/packages/@BASE_NAME@" |
a2f5f27d | 8 | mkdir -p $SRPMDIR $RPMDIR $SRPMDIR $BUILDDIR $PACKAGEDIR |
4bbcd571 | 9 | |
6de7af38 | 10 | if echo "$3" | grep '\.src\.rpm$' >/dev/null; then |
75a762f7 | 11 | ( |
6de7af38 | 12 | if echo "$3" | grep '://' >/dev/null; then |
75a762f7 | 13 | cd $SRPMDIR |
6de7af38 ER |
14 | wget --passive-ftp -t0 "$3" |
15 | else | |
75a762f7 | 16 | cp -f "$3" $SRPMDIR |
6de7af38 | 17 | fi |
a2f5f27d | 18 | rpm2cpio `basename "$3"` | ( cd $PACKAGEDIR; cpio -i @BASE_NAME@.spec ) |
f0854606 | 19 | if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then |
a2f5f27d | 20 | rpm2cpio `basename "$3"` | ( cd $PACKAGEDIR; cpio -i @COPYSOURCES@ ) |
f0854606 ER |
21 | fi |
22 | ) | |
6de7af38 | 23 | else |
a2f5f27d | 24 | cp -i "$3" $PACKAGEDIR || exit 1 |
f0854606 ER |
25 | if [ '@COPYSOURCES@' != '@'COPYSOURCES'@' ]; then |
26 | for i in @COPYSOURCES@; do | |
a2f5f27d | 27 | cp -i @DATADIR@/$i $PACKAGEDIR/$i || exit 1 |
f0854606 ER |
28 | done |
29 | fi | |
6de7af38 | 30 | fi |
a2f5f27d | 31 | ( cd $PACKAGEDIR |
544f569a ER |
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 | |
6de7af38 ER |
37 | if [ "$?" -ne 0 ]; then |
38 | exit 2 | |
39 | fi | |
40 | RPMNAMES="$RPMDIR/@BASE_NAME@-@VERSION@-@RELEASE@wla.@TARGET_CPU@.rpm" | |
a146c9c1 | 41 | rpm -Uhv $RPMNAMES || echo -e "Install manually the file(s):\n $RPMNAMES" ) |
6de7af38 | 42 | else |
1019bfb9 ER |
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 " | |
6de7af38 ER |
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: | |
6de7af38 | 53 | " |
1019bfb9 ER |
54 | fi |
55 | echo "$0 --with license_agreement @SPECFILE@" | |
6de7af38 | 56 | fi |