SPECS: w32codec.spec (HEAD)

glen glen at pld-linux.org
Tue Aug 23 21:26:20 CEST 2005


Module name:	SPECS
Changes by:	glen	05/08/23 21:26:18

Modified files:
	w32codec.spec

Log message:
- use shared installer script from SOURCES
- removed independent of available version hack (sorry ankry),
  the releases aren't that often that this is really neccessary, wait for new
  package on ftp instead. i choose unified(+readable+maintainable) scripts
  over this hack (which btw didn't work right now for me)
- NoSource for those binary files (i don't think they're distributable)

Index: w32codec.spec
===================================================================
RCS file: /cvsroot/SPECS/w32codec.spec,v
diff -d -u -r1.71 -r1.72
--- w32codec.spec	23 Aug 2005 18:57:26 -0000	1.71
+++ w32codec.spec	23 Aug 2005 19:26:18 -0000	1.72
@@ -1,24 +1,18 @@
 # $Revision$, $Date$
-#
 # Conditional build:
 %bcond_with	license_agreement	# generates package
 #
 %define		source_url	ftp://ftp1.mplayerhq.hu/MPlayer/releases/codecs/
-# don't remove this macro
-%define		get_version	%(cd %{tmpdir};rm -f index.html;wget --passive-ftp %{source_url}>/dev/null 2>&1;grep '>all-.*\.tar\.bz2</a>' index.html|sed -e 's:\.tar\.bz2</a>.*::' -e 's:.*>all-::'|sort|tail -n1;rm -f index.html)
 Summary:	Binary compression/decompression libraries used by movie players
 Summary(pl):	Binarne biblioteki do kompresji/dekompresji dla odtwarzaczy filmów
 %define		base_name	w32codec
-%define		_version	20050412
 %if %{with license_agreement}
 Name:		%{base_name}
-# don't change the following line
-Version:	%{_version}
 %else
 Name:		%{base_name}-installer
-Version:	%{_version}
 %endif
-Release:	1%{?with_license_agreement:wla}
+Version:	20050412
+Release:	1.3%{?with_license_agreement:wla}
 Group:		Libraries
 License:	Free for non-commercial use
 %if %{with license_agreement}
@@ -29,14 +23,17 @@
 #Source4:	%{source_url}rp9codecs.tar.bz2
 #Source5:	%{source_url}xanimdlls.tar.bz2
 Source6:	http://www.ezgoal.com/dll_files/tsd32.zip
+BuildRequires:	unzip
 Provides:	avi-codecs
 Obsoletes:	avi-codecs
 Obsoletes:	w32codec-qt
-BuildRequires:	unzip
+NoSource:	0
+NoSource:	6
 %else
+Source0:	license-installer.sh
 Requires:	cpio
-Requires:	unzip
 Requires:	rpm-build-tools
+Requires:	unzip
 Requires:	wget
 Provides:	%{base_name}
 %endif
@@ -44,8 +41,6 @@
 ExclusiveArch:	%{ix86}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		w32codecDIR	ftp://ftp.pld-linux.org/dists/ac/PLD/SRPMS/SRPMS
-
 %description
 Libraries required to compress/decompress content of movie files. They
 are used by movie players, but can be used to create compressed movie
@@ -89,61 +84,15 @@
 %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_SPEC=0
-	mkdir -p \$TMPDIR \$SPECDIR \$SRPMDIR \$RPMDIR \$SRPMDIR \$SOURCEDIR \$BUILDDIR
-	if [ -f \$SPECDIR/%{base_name}.spec ]; then
-		BACKUP_SPEC=1
-		mv -f \$SPECDIR/%{base_name}.spec \$SPECDIR/%{base_name}.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}.spec ) )
-		if ! cp -i \$TMPDIR/%{base_name}.spec \$SPECDIR/%{base_name}.spec; then
-			exit 1
-		fi
-	else
-		if ! cp -i "\$3" \$SPECDIR; then
-			exit 1
-		fi
-	fi
-	( cd \$SPECDIR
-	%{_bindir}/builder -nc -ncs --with license_agreement --opts --target=%{_target_cpu} %{base_name}.spec
-	if [ "\$?" -ne 0 ]; then
-		exit 2
-	fi
-	RPMNAME=\$(cd \$RPMDIR;ls -t %{base_name}-*-%{release}wla.%{_target_cpu}.rpm|head -n1)
-	rpm -U \$RPMDIR/\$RPMNAME || \
-		echo -e Install manually the file:\\\n   \$RPMDIR/\$RPMNAME )
-	if [ "\$BACKUP_SPEC" -eq 1 ]; then
-		mv -f \$SPECDIR/%{base_name}.spec.prev \$SPECDIR/%{base_name}.spec
-	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
+' %{SOURCE0} > $RPM_BUILD_ROOT%{_bindir}/%{base_name}.install
 
-sed '0,/^Version:.*%%{_version}/s/{_version}/{get_version}/' < %{_specdir}/%{base_name}.spec > $RPM_BUILD_ROOT%{_datadir}/%{base_name}/%{base_name}.spec
+install %{_specdir}/%{base_name}.spec $RPM_BUILD_ROOT%{_datadir}/%{base_name}
 
 %else
 install -d $RPM_BUILD_ROOT%{_libdir}/codecs
@@ -153,13 +102,7 @@
 
 %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
 
 %clean
@@ -180,6 +123,14 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.72  2005/08/23 19:26:18  glen
+- use shared installer script from SOURCES
+- removed independent of available version hack (sorry ankry),
+  the releases aren't that often that this is really neccessary, wait for new
+  package on ftp instead. i choose unified(+readable+maintainable) scripts
+  over this hack (which btw didn't work right now for me)
+- NoSource for those binary files (i don't think they're distributable)
+
 Revision 1.71  2005/08/23 18:57:26  glen
 - use without macro
 



More information about the pld-cvs-commit mailing list