packages: luvcview/adapter (NEW), luvcview/builder (NEW), luvcview/compile....

pluto pluto at pld-linux.org
Tue Dec 22 19:01:46 CET 2009


Author: pluto                        Date: Tue Dec 22 18:01:46 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- pure uvc camera graber.

---- Files affected:
packages/luvcview:
   adapter (NONE -> 1.1)  (NEW), builder (NONE -> 1.1)  (NEW), compile.sh (NONE -> 1.1)  (NEW), dropin (NONE -> 1.1)  (NEW), luvcview-makefile.patch (NONE -> 1.1)  (NEW), luvcview.spec (NONE -> 1.1)  (NEW), md5 (NONE -> 1.1)  (NEW), relup.sh (NONE -> 1.1)  (NEW), repackage.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/luvcview/adapter
diff -u /dev/null packages/luvcview/adapter:1.1
--- /dev/null	Tue Dec 22 19:01:46 2009
+++ packages/luvcview/adapter	Tue Dec 22 19:01:40 2009
@@ -0,0 +1,276 @@
+#!/bin/sh
+#
+# Authors:
+# 	Michał Kuratczyk <kura at pld.org.pl>
+# 	Sebastian Zagrodzki <s.zagrodzki at mimuw.edu.pl>
+# 	Tomasz Kłoczko <kloczek at rudy.mif.pg.gda.pl>
+# 	Artur Frysiak <wiget at pld-linux.org>
+# 	Michal Kochanowicz <mkochano at pld.org.pl>
+# 	Elan Ruusamäe <glen at pld-linux.org>
+#
+# See cvs log adapter{,.awk} for list of contributors
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+RCSID='$Id$'
+r=${RCSID#* * }
+rev=${r%% *}
+VERSION="v0.35/$rev"
+VERSIONSTRING="\
+Adapter adapts .spec files for PLD Linux.
+$VERSION (C) 1999-2009 Free Penguins".
+
+PROGRAM=${0##*/}
+dir=$(d=$0; [ -L "$d" ] && d=$(readlink "$d"); dirname "$d")
+adapter=$dir/adapter.awk
+usage="Usage: $PROGRAM [FLAGS] SPECFILE
+
+-s|--no-sort|--skip-sort
+	skip BuildRequires, Requires sorting
+-m|--no-macros|--skip-macros
+	skip use_macros() substitutions
+-d|--skip-desc
+	skip desc wrapping
+-a|--skip-defattr
+	skip %defattr corrections
+-o
+	do not do any diffing, just dump the output
+"
+
+if [ ! -x /usr/bin/getopt ]; then
+	echo >&2 "You need to install util-linux to use adapter"
+	exit 1
+fi
+
+if [ ! -x /usr/bin/patch ]; then
+	echo >&2 "You need to install patch to use adapter"
+	exit 1
+fi
+
+t=$(getopt -o hsomdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$PROGRAM" -- "$@") || exit $?
+eval set -- "$t"
+
+while true; do
+	case "$1" in
+	-h|--help)
+ 		echo 2>&1 "$usage"
+		exit 1
+	;;
+	-s|--no-sort|--skip-sort)
+		export SKIP_SORTBR=1
+	;;
+	-m|--no-macros|--skip-macros)
+		export SKIP_MACROS=1
+	;;
+	-d|--skip-desc)
+		export SKIP_DESC=1
+	;;
+	-a|--skip-defattr)
+		export SKIP_DEFATTR=1
+	;;
+	-V|--version)
+		echo "$VERSIONSTRING"
+		exit 0
+		;;
+	-o)
+		outputonly=1
+	;;
+	--)
+		shift
+		break
+	;;
+	*)
+		echo >&2 "$PROGRAM: Internal error: \`$1' not recognized!"
+		exit 1
+		;;
+	esac
+	shift
+done
+
+diffcol()
+{
+	 # vim like diff colourization
+	 sed -e '
+	 s,,^[,g;
+	 s,,^G,g;
+	 s,^\(Index:\|diff\|---\|+++\) .*$,&,;
+	 s,^@@ ,&,g;
+	 s,^-,&,;
+	 s,^+,&,;
+	 s,\r,^M,g;
+	 s,	,    ,g;
+	 s,\([^[:space:]]\)\([[:space:]]\+\)$,\1\2,g;
+	 s,$,,
+	 ' "$@"
+}
+
+diff2hunks()
+{
+	 # diff2hunks orignally by dig
+	 perl -e '
+#! /usr/bin/perl -w
+
+use strict;
+
+for my $filename (@ARGV) {
+	my $counter = 1;
+	my $fh;
+	open $fh, "<", $filename or die "$filename: open for reading: $!";
+	my @lines = <$fh>;
+	my @hunks;
+	my @curheader;
+	for my $i (0 ... $#lines) {
+		next unless $lines[$i] =~ m/^\@\@ /;
+		if ($i >= 2 and $lines[$i - 2] =~ m/^--- / and $lines[$i - 1] =~ m/^\+\+\+ /) {
+			@curheader = @lines[$i - 2 ... $i - 1];
+		}
+		next unless @curheader;
+		my $j = $i + 1;
+		while ($j < @lines and $lines[$j] !~ m/^\@\@ /) {$j++}
+		$j -= 2
+			if $j >= 3 and $j < @lines
+				and $lines[$j - 2] =~ m/^--- /
+				and $lines[$j - 1] =~ m/^\+\+\+ /;
+		$j--;
+		$j-- until $lines[$j] =~ m/^[ @+-]/;
+		my $hunkfilename = $filename;
+		$hunkfilename =~ s/((\.(pat(ch)?|diff?))?)$/"-".sprintf("%03i",$counter++).$1/ei;
+		my $ofh;
+		open $ofh, ">", $hunkfilename or die "$hunkfilename: open for writing: $!";
+		print $ofh @curheader, @lines[$i ... $j];
+		close $ofh;
+	}
+}
+' "$@"
+}
+
+# import selected macros for adapter.awk
+# you should update the list also in adapter.awk when making changes here
+import_rpm_macros() {
+	macros="
+	_topdir
+	_prefix
+	_bindir
+	_sbindir
+	_libdir
+	_sysconfdir
+	_datadir
+	_includedir
+	_mandir
+	_infodir
+	_examplesdir
+	_defaultdocdir
+	_kdedocdir
+	_gtkdocdir
+	_desktopdir
+	_pixmapsdir
+	_javadir
+
+	perl_sitearch
+	perl_archlib
+	perl_privlib
+	perl_vendorlib
+	perl_vendorarch
+	perl_sitelib
+
+	py_sitescriptdir
+	py_sitedir
+	py_scriptdir
+	py_ver
+
+	ruby_archdir
+	ruby_ridir
+	ruby_rubylibdir
+	ruby_sitearchdir
+	ruby_sitelibdir
+	ruby_rdocdir
+
+	php_pear_dir
+	php_data_dir
+	tmpdir
+"
+	eval_expr=""
+	for macro in $macros; do
+		eval_expr="$eval_expr\nexport $macro='%{$macro}'"
+	done
+
+
+	# get cvsaddress for changelog section
+	# using rpm macros as too lazy to add ~/.adapterrc parsing support.
+	eval_expr="$eval_expr
+	export _cvsmaildomain='%{?_cvsmaildomain}%{!?_cvsmaildomain:@pld-linux.org}'
+	export _cvsmailfeedback='%{?_cvsmailfeedback}%{!?_cvsmailfeedback:PLD Team <feedback at pld-linux.org>}'
+	"
+
+	eval $(rpm --eval "$(echo -e $eval_expr)")
+}
+
+adapterize() {
+	local workdir
+	workdir=$(mktemp -d ${TMPDIR:-/tmp}/adapter-XXXXXX) || exit
+	awk=gawk
+
+	local tmp=$workdir/$(basename $SPECFILE) || exit
+
+	import_rpm_macros
+
+	LC_ALL=en_US.UTF-8 $awk -f $adapter $SPECFILE > $tmp || exit
+
+	if [ "$outputonly" = 1 ]; then
+		cat $tmp
+
+	elif [ "$(diff --brief $SPECFILE $tmp)" ]; then
+		diff -u $SPECFILE $tmp > $tmp.diff
+		if [ -t 1 ]; then
+				diffcol $tmp.diff | less -r
+				while : ; do
+					echo -n "Accept? (Yes, No, Confirm each chunk)? "
+					read ans
+					case "$ans" in
+					[yYoO]) # y0 mama
+						mv -f $tmp $SPECFILE
+						echo "Ok, adapterized."
+						break
+					;;
+					[cC]) # confirm each chunk
+						diff2hunks $tmp.diff
+						for t in $(ls $tmp-*.diff); do
+								diffcol $t | less -r
+								echo -n "Accept? (Yes, [N]o, Quit)? "
+								read ans
+								case "$ans" in
+								[yYoO]) # y0 mama
+									patch < $t
+									;;
+								[Q]) # Abort
+									break
+									;;
+								esac
+						done
+						break
+					;;
+					[QqnNsS])
+						echo "Ok, exiting."
+						break
+					;;
+					esac
+				done
+		else
+				cat $tmp.diff
+		fi
+	else
+		echo "The SPEC is perfect ;)"
+	fi
+
+	rm -rf $workdir
+}
+
+SPECFILE="$1"
+[ -f "$SPECFILE" ] || SPECFILE="$(basename $SPECFILE .spec).spec"
+
+if [ $# -ne 1 -o ! -f "$SPECFILE" ]; then
+	echo "$usage"
+	exit 1
+fi
+
+adapterize

================================================================
Index: packages/luvcview/builder
diff -u /dev/null packages/luvcview/builder:1.1
--- /dev/null	Tue Dec 22 19:01:46 2009
+++ packages/luvcview/builder	Tue Dec 22 19:01:40 2009
@@ -0,0 +1,2497 @@
+#!/bin/ksh
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2.
+#
+# -----------
+# Exit codes:
+#	  0 - succesful
+#	  1 - help displayed
+#	  2 - no spec file name in cmdl parameters
+#	  3 - spec file not stored in repo
+#	  4 - some source, patch or icon files not stored in repo
+#	  5 - package build failed
+#	  6 - spec file with errors
+#	  7 - wrong source in /etc/poldek.conf
+#	  8 - Failed installing buildrequirements and subrequirements
+#	  9 - Requested tag already exist
+#	 10 - Refused to build fractional release
+#	100 - Unknown error (should not happen)
+
+# Notes (todo/bugs):
+# - builder -u fetches current version first (well that's okay, how you compare versions if you have no old spec?)
+# - when Icon: field is present, -5 and -a5 doesn't work
+# - builder -R skips installing BR if spec is not present before builder invocation (need to run builder twice)
+# TODO:
+# - ability to do ./builder -bb foo.spec foo2.spec foo3.spec
+
+RCSID='$Id$'
+r=${RCSID#* * }
+rev=${r%% *}
+VERSION="v0.35/$rev"
+VERSIONSTRING="\
+Build package utility from PLD Linux CVS repository
+$VERSION (C) 1999-2009 Free Penguins".
+
+PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
+
+COMMAND="build"
+TARGET=""
+
+SPECFILE=""
+BE_VERBOSE=""
+QUIET=""
+CLEAN=""
+DEBUG=""
+NOURLS=""
+NOCVS=""
+NOCVSSPEC=""
+NODIST=""
+NOINIT=""
+PREFMIRRORS=""
+UPDATE=""
+ADD5=""
+NO5=""
+ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
+CVSROOT=""
+GREEDSRC=""
+
+# use rpm 4.4.6+ digest format instead of comments if non-zero
+USEDIGEST=
+
+# user agent when fetching files
+USER_AGENT="PLD/Builder($VERSION)"
+
+# It can be used i.e. in log file naming.
+# See LOGFILE example.
+DATE=`date +%Y-%m-%d_%H-%M-%S`
+
+# Example: LOGFILE='../log.$PACKAGE_NAME'
+# Example: LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
+# Example: LOGFILE='$PACKAGE_NAME/$PACKAGE_NAME.$DATE.log'
+# Example: LOGFILE='$PACKAGE_NAME.$DATE.log'
+# Yes, you can use variable name! Note _single_ quotes!
+LOGFILE=''
+
+LOGDIR=""
+LOGDIROK=""
+LOGDIRFAIL=""
+LASTLOG_FILE=""
+
+CHMOD="no"
+CHMOD_MODE="0644"
+RPMOPTS=""
+RPMBUILDOPTS=""
+BCOND=""
+GROUP_BCONDS="no"
+
+# create symlinks for tools in PACKAGE_DIR, see get_spec()
+SYMLINK_TOOLS="yes"
+
+PATCHES=""
+SOURCES=""
+ICONS=""
+PACKAGE_RELEASE=""
+PACKAGE_VERSION=""
+PACKAGE_NAME=""
+ASSUMED_NAME=""
+PROTOCOL="ftp"
+WGET_RETRIES=${MAX_WGET_RETRIES:-0}
+
+CVS_COMMAND=${CVS_COMMAND:-cvs}
+CVS_FORCE=""
+CVSIGNORE_DF="yes"
+CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
+CVS_SERVER="cvs.pld-linux.org"
+CVSTAG=""
+
+RES_FILE=""
+
+DISTFILES_SERVER="://distfiles.pld-linux.org"
+ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org"
+
+DEF_NICE_LEVEL=19
+SCHEDTOOL="auto"
+
+FAIL_IF_NO_SOURCES="yes"
+
+# let get_files skip over files which are present to get those damn files fetched
+SKIP_EXISTING_FILES="no"
+
+TRY_UPGRADE=""
+# should the specfile be restored if upgrade failed?
+REVERT_BROKEN_UPGRADE="yes"
+
+if rpm --specsrpm 2>/dev/null; then
+	FETCH_BUILD_REQUIRES_RPMSPECSRPM="yes"
+	FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
+else
+	FETCH_BUILD_REQUIRES_RPMSPECSRPM="no"
+	if [ -x /usr/bin/rpm-getdeps ]; then
+		FETCH_BUILD_REQUIRES_RPMGETDEPS="yes"
+	else
+		FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
+	fi
+fi
+
+
+# Here we load saved user environment used to
+# predefine options set above, or passed to builder
+# in command line.
+# This one reads global system environment settings:
+if [ -f ~/etc/builderrc ]; then
+	. ~/etc/builderrc
+fi
+# And this one cascades settings using user personal
+# builder settings.
+# Example of ~/.builderrc:
+#
+#UPDATE_POLDEK_INDEXES="yes"
+#FETCH_BUILD_REQUIRES="yes"
+#REMOVE_BUILD_REQUIRES="force"
+#GROUP_BCONDS="yes"
+#LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
+#TITLECHANGE=no
+#
+SU_SUDO=""
+if [ -n "$HOME_ETC" ]; then
+	USER_CFG="$HOME_ETC/.builderrc"
+	BUILDER_MACROS="$HOME_ETC/.builder-rpmmacros"
+else
+	USER_CFG=~/.builderrc
+	BUILDER_MACROS=~/.builder-rpmmacros
+fi
+
+[ -f "$USER_CFG" ] && . "$USER_CFG"
+
+if [ "$SCHEDTOOL" = "auto" ]; then
+	if [ -x /usr/bin/schedtool ] && schedtool -B -e echo >/dev/null; then
+		SCHEDTOOL="schedtool -B -e"
+	else
+		SCHEDTOOL="no"
+	fi
+fi
+
+if [ -n "$USE_PROZILLA" ]; then
+	GETURI="proz --no-getch -r -P ./ -t$WGET_RETRIES $PROZILLA_OPTS"
+	GETURI2="$GETURI"
+	OUTFILEOPT="-O"
+elif [ -n "$USE_AXEL" ]; then
+	GETURI="axel -a $AXEL_OPTS"
+	GETURI2="$GETURI"
+	OUTFILEOPT="-o"
+else
+	wget --help 2>&1 | grep -q -- ' --no-check-certificate ' && WGET_OPTS="$WGET_OPTS --no-check-certificate"
+	wget --help 2>&1 | grep -q -- ' --inet ' && WGET_OPTS="$WGET_OPTS --inet"
+	wget --help 2>&1 | grep -q -- ' --retry-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
+	WGET_OPTS="$WGET_OPTS --user-agent=$USER_AGENT"
+
+	GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
+	GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
+	OUTFILEOPT="-O"
+fi
+
+GETLOCAL="cp -a"
+
+if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
+	RPM="rpm"
+	RPMBUILD="rpm"
+else
+	RPM="rpm"
+	RPMBUILD="rpmbuild"
+fi
+
+#
+# are we using cvs-nserver ?
+#
+CVS_NSERVER=0
+$CVS_COMMAND --version 2>&1 | grep -q 'CVS-nserver'
+[ $? -eq 0 ] && CVS_NSERVER=1
+
+POLDEK_INDEX_DIR="$($RPM --eval %_rpmdir)/"
+POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
+
+run_poldek() {
+	RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
+	if [ -n "$LOGFILE" ]; then
+		LOG=`eval echo $LOGFILE`
+		if [ -n "$LASTLOG_FILE" ]; then
+			echo "LASTLOG=$LOG" > $LASTLOG_FILE
+		fi
+		(${NICE_COMMAND} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee -a $LOG
+		return $exit_pldk
+	else
+		(${NICE_COMMAND} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
+		return `cat ${RES_FILE}`
+		rm -rf ${RES_FILE}
+	fi
+}
+
+#---------------------------------------------
+# functions
+
+usage() {
+	if [ -n "$DEBUG" ]; then set -xv; fi
+	echo "\
+Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|-ba|--build]
+[-bb|--build-binary] [-bs|--build-source] [-bc] [-bi] [-bl] [-u|--try-upgrade]
+[{-cf|--cvs-force}] [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>]
+[-g|--get] [-h|--help] [--http] [{-l|--logtofile} <logfile>] [-m|--mr-proper]
+[-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T|--tag <cvstag>]
+[-Tvs|--tag-version-stable] [-Ts|--tag-stable] [-Tv|--tag-version]
+[{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}] [--use-greed-sources]
+[-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>] [--short-circuit]
+[--show-bconds] [--with/--without <feature>] [--define <macro> <value>]
+<package>[.spec][:cvstag]
+
+-5, --update-md5    - update md5 comments in spec, implies -nd -ncs
+-a5, --add-md5      - add md5 comments to URL sources, implies -nc -nd -ncs
+-n5, --no-md5       - ignore md5 comments in spec
+-D, --debug         - enable builder script debugging mode,
+-debug              - produce rpm debug package (same as --opts -debug)
+-V, --version       - output builder version string
+--short-version     - output builder short version
+-a, --as_anon       - get files via pserver as cvs@$CVS_SERVER,
+-b, -ba, --build    - get all files from CVS repo or HTTP/FTP and build package
+                      from <package>.spec,
+-bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
+                      only package from <package>.spec,
+-bp, --build-prep   - execute the %prep phase of <package>.spec,
+-bc                 - execute the %build phase of <package>.spec,
+-bi                 - execute the %install phase of <package>.spec
+-bl					- execute the %files phase of <package>.spec
+-bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
+                      them into src.rpm,
+--short-circuit     - short-circuit build
+-B, --branch        - add branch
+-c, --clean         - clean all temporarily created files (in BUILD, SOURCES,
+                      SPECS and \$RPM_BUILD_ROOT and CVS/Entries) after rpmbuild commands.
+-m, --mr-proper     - clean all temporarily created files (in BUILD, SOURCES,
+					  SPECS and \$RPM_BUILD_ROOT and CVS/Entries). Doesn't run
+					  any rpm building.
+-cf, --cvs-force	- use -F when tagging (useful when moving branches)
+-d <cvsroot>, --cvsroot <cvsroot>
+                    - setup \$CVSROOT,
+--define <macro> <value>
+                    - define a macro <macro> with value <value>,
+--alt_kernel <kernel>
+                    - same as --define 'alt_kernel <kernel>'
+--nodeps            - rpm won't check any dependences
+-g, --get           - get <package>.spec and all related files from CVS repo
+                      or HTTP/FTP,
+-h, --help          - this message,
+--http              - use http instead of ftp,
+-l <logfile>, --logtofile <logfile>
+                    - log all to file,
+-nc, --no-cvs       - don't download sources from CVS, if source URL is given,
+-ncs, --no-cvs-specs
+                    - don't check specs in CVS
+-nd, --no-distfiles - don't download from distfiles
+-nm, --no-mirrors   - don't download from mirror, if source URL is given,
+-nu, --no-urls      - don't try to download from FTP/HTTP location,
+-ns, --no-srcs      - don't download Sources/Patches
+-ns0, --no-source0  - don't download Source0
+-nn, --no-net       - don't download anything from the net
+-pm, --prefer-mirrors - prefer mirrors (if any) over distfiles for SOURCES
+--no-init           - don't initialize builder paths (SPECS and SOURCES)
+-ske,
+--skip-existing-files - skip existing files in get_files
+--opts <rpm opts>   - additional options for rpm
+-q, --quiet         - be quiet,
+--date yyyy-mm-dd   - build package using resources from specified CVS date,
+-r <cvstag>, --cvstag <cvstag>
+                    - build package using resources from specified CVS tag,
+-A                  - build package using CVS resources as any sticky tags/date/kopts being reset.
+-R, --fetch-build-requires
+                    - fetch what is BuildRequired,
+-RB, --remove-build-requires
+                    - remove all you fetched with -R or --fetch-build-requires
+                      remember, this option requires confirmation,
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list