SOURCES: license-installer.sh (NEW) - shared installer, extracted ...

glen glen at pld-linux.org
Tue Aug 23 19:56:21 CEST 2005


Author: glen                         Date: Tue Aug 23 17:56:21 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- shared installer, extracted from macromedia-flash.spec

---- Files affected:
SOURCES:
   license-installer.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/license-installer.sh
diff -u /dev/null SOURCES/license-installer.sh:1.1
--- /dev/null	Tue Aug 23 19:56:21 2005
+++ SOURCES/license-installer.sh	Tue Aug 23 19:56:16 2005
@@ -0,0 +1,48 @@
+#!/bin/sh
+if [ "$1" = "--with" -a "$2" = "license_agreement" ]; then
+	TMPDIR=`rpm --eval "%{tmpdir}"`; export TMPDIR
+	SPECDIR=`rpm --eval "%{_specdir}"`; export SPECDIR
+	SRPMDIR=`rpm --eval "%{_srcrpmdir}"`; export SRPMDIR
+	SOURCEDIR=`rpm --eval "%{_sourcedir}"`; export SOURCEDIR
+	BUILDDIR=`rpm --eval "%{_builddir}"`; export BUILDDIR
+	RPMDIR=`rpm --eval "%{_rpmdir}"`; export RPMDIR
+	BACKUP=0
+	mkdir -p $TMPDIR $SPECDIR $SRPMDIR $RPMDIR $SRPMDIR $SOURCEDIR $BUILDDIR
+	if [ -f $SPECDIR/@BASE_NAME at .spec ]; then
+		BACKUP=1
+		mv -f $SPECDIR/@BASE_NAME at .spec $SPECDIR/@BASE_NAME at .spec.prev
+	fi
+	if echo "$3" | grep '\.src\.rpm$' >/dev/null; then
+		( cd $SRPMDIR
+		if echo "$3" | grep '://' >/dev/null; then
+			wget --passive-ftp -t0 "$3"
+		else
+			cp -f "$3" .
+		fi
+		rpm2cpio `basename "$3"` | ( cd $TMPDIR; cpio -i @BASE_NAME at .spec )
+		)
+		cp -i $TMPDIR/@BASE_NAME at .spec $SPECDIR/@BASE_NAME at .spec || exit 1
+	else
+		cp -i "$3" $SPECDIR || exit 1
+	fi
+	( cd $SPECDIR
+	/usr/bin/builder -nc -ncs --with license_agreement --opts --target=@TARGET_CPU@ @BASE_NAME at .spec
+	if [ "$?" -ne 0 ]; then
+		exit 2
+	fi
+	RPMNAMES="$RPMDIR/@BASE_NAME at -@VERSION at -@RELEASE at wla.@TARGET_CPU at .rpm"
+	rpm -U $RPMNAMES || echo -e "Install manually the file(s):\n   $RPMNAMES" )
+	if [ "$BACKUP" -eq 1 ]; then
+		if [ -f $SPECDIR/@BASE_NAME at .spec.prev ]; then
+			mv -f $SPECDIR/@BASE_NAME at .spec.prev $SPECDIR/@BASE_NAME at .spec
+		fi
+	fi
+else
+	echo "
+License issues made us not to include inherent files into
+this package by default. If you want to create full working
+package please build it with the following command:
+
+$0 --with license_agreement @SPECFILE@
+"
+fi
================================================================



More information about the pld-cvs-commit mailing list