SPECS: acroread.spec - use shared license-installer.sh from SOURCE...

glen glen at pld-linux.org
Sun Aug 28 22:07:18 CEST 2005


Author: glen                         Date: Sun Aug 28 20:07:18 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use shared license-installer.sh from SOURCES
- rel 2

---- Files affected:
SPECS:
   acroread.spec (1.45 -> 1.46) 

---- Diffs:

================================================================
Index: SPECS/acroread.spec
diff -u SPECS/acroread.spec:1.45 SPECS/acroread.spec:1.46
--- SPECS/acroread.spec:1.45	Fri Aug 19 13:31:03 2005
+++ SPECS/acroread.spec	Sun Aug 28 22:07:12 2005
@@ -14,7 +14,7 @@
 Name:		%{base_name}-installer
 %endif
 Version:	7.0.1
-Release:	1%{?with_license_agreement:wla}
+Release:	2%{?with_license_agreement:wla}
 Epoch:		1
 License:	distribution restricted (http://www.adobe.com/products/acrobat/distribute.html)
 # in short:
@@ -23,6 +23,8 @@
 Group:		X11/Applications/Graphics
 %if %{with license_agreement}
 Source0:	http://ardownload.adobe.com/pub/adobe/reader/unix/7x/7.0/enu/AdbeRdr701_linux_enu.tar.gz
+%else
+Source0:	license-installer.sh
 %endif
 Source1:	%{base_name}.desktop
 Source2:	%{base_name}.png
@@ -81,89 +83,18 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%if ! %{with license_agreement}
+%if %{without license_agreement}
 install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/%{base_name}}
 
-cat <<EOF >$RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
-#!/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}.spec ]; then
-		BACKUP=1
-		mv -f \$SPECDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec.prev
-	fi
-	for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
-		if [ -f \$SOURCEDIR/\$i ]; then
-			mv -f \$SOURCEDIR/\$i \$SOURCEDIR/\$i.prev
-			BACKUP=1
-		fi
-	done
-	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}.spec )
-		for i in %{base_name}.desktop %{base_name}.png; do
-			rpm2cpio \$i | ( cd \$TMPDIR; cpio -i \$i )
-		done )
-		cp -i \$TMPDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec \
-			|| exit 1
-		for i in %{base_name}.desktop %{base_name}.png; do
-			cp -i \$TMPDIR/\$i \$SOURCEDIR/\$i || exit 1
-		done
-	else
-		cp -i "\$3" \$SPECDIR || exit 1
-		for i in %{base_name}.desktop %{base_name}.png; do
-			cp -i %{_datadir}/%{base_name}/\$i \$SOURCEDIR/\$i || exit 1
-		done
-	fi
-	( cd \$SPECDIR
-	%{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
-	if [ "\$?" -ne 0 ]; then
-		exit 2
-	fi
-	RPMNAME1=%{base_name}-%{version}-%{release}wla.%{_target_cpu}.rpm
-	RPMNAME2=mozilla-plugin-%{base_name}-%{version}-%{release}wla.%{_target_cpu}.rpm
-	echo "Installing \$RPMNAME1"
-	RPMNAMES=\$RPMDIR/\$RPMNAME1
-	if rpm -q --whatprovides mozilla-embedded >/dev/null 2>&1; then
-		RPMNAMES="\$RPMNAMES \$RPMDIR/\$RPMNAME2"
-		echo "Installing \$RPMNAME2"
-	else
-		echo "Not installing \$RPMNAME2"
-	fi
-	rpm -U \$RPMNAMES || \
-		echo -e "Install manually the file(s):\n   \$RPMNAMES" )
-	if [ "\$BACKUP" -eq 1 ]; then
-		if [ -f \$SPECDIR/%{base_name}.spec.prev ]; then
-			mv -f \$SPECDIR/%{base_name}.spec.prev \$SPECDIR/%{base_name}.spec
-		fi
-		for i in %{base_name}.desktop %{base_name}.png %{base_name}-locale.patch; do
-			if [ -f \$SOURCEDIR/\$i.prev ]; then
-				mv -f \$SOURCEDIR/\$i.prev \$SOURCEDIR/\$i
-			fi
-		done
-	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 %{_datadir}/%{base_name}/%{base_name}.spec
-"
-fi
-EOF
+sed -e '
+	s/@BASE_NAME@/%{base_name}/g
+	s/@TARGET_CPU@/%{_target_cpu}/g
+	s- at VERSION@-%{version}-g
+	s- at RELEASE@-%{release}-g
+	s, at SPECFILE@,%{_datadir}/%{base_name}/%{base_name}.spec,g
+	s, at DATADIR@,%{_datadir}/%{base_name},g
+	s/@COPYSOURCES@/%{base_name}{.desktop,.png}/g
+' %{SOURCE0} > $RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
 
 install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
 install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{base_name}
@@ -193,20 +124,14 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if ! %{with license_agreement}
+%if %{without license_agreement}
 %pre
-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:
-
-%{base_name}.install --with license_agreement %{_datadir}/%{base_name}/%{base_name}.spec
-"
+%{_bindir}/%{base_name}.install
 %endif
 
 %files
 %defattr(644,root,root,755)
-%if ! %{with license_agreement}
+%if %{without license_agreement}
 %attr(755,root,root) %{_bindir}/%{base_name}.install
 %{_datadir}/%{base_name}
 %else
@@ -247,6 +172,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.46  2005/08/28 20:07:12  glen
+- use shared license-installer.sh from SOURCES
+- rel 2
+
 Revision 1.45  2005/08/19 11:31:03  blekot
 - up to 701 (7.0.1) (security bug fixed)
 
@@ -312,7 +241,7 @@
 - updated to 509
 
 Revision 1.30  2003/09/26 14:03:20  adgor
-- Desktop file moved to %%{_desktopdir}
+- Desktop file moved to %{_desktopdir}
 
 Revision 1.29  2003/09/12 22:35:39  grzegol
 - added icon
@@ -359,7 +288,7 @@
 - security update to 506, updated patch
 
 Revision 1.15  2002/05/23 20:58:50  qboosh
-- new %%doc
+- new %doc
 - +x for nppdf.so (but it doesn't work for me anyway)
 
 Revision 1.14  2002/05/22 10:36:53  zagrodzki
@@ -370,7 +299,7 @@
 - ... and placed in an appropriate subpackage
 
 Revision 1.12  2002/04/25 15:41:38  arturs
-fixed a small typo
+- fixed a small typo
 
 Revision 1.11  2002/02/22 23:28:40  kloczek
 - removed all Group fields translations (our rpm now can handle translating
@@ -381,7 +310,7 @@
 - release 3
 
 Revision 1.9  2002/01/18 02:12:18  kloczek
-perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
+- perl -pi -e "s/pld-list\@pld.org.pl/feedback\@pld.org.pl/"
 
 Revision 1.8  2001/10/31 10:50:37  qboosh
 - adapterized, cosmetics
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/acroread.spec?r1=1.45&r2=1.46&f=u




More information about the pld-cvs-commit mailing list