tazpkg rev 697

tazpkg-convert: update WEB_SITE in debian packages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 02 09:14:09 2014 +0100 (2014-12-02)
parents 608981c962f8
children 8e7a183ebc67
files tazpkg tazpkg-convert
line diff
     1.1 --- a/tazpkg	Tue Dec 02 04:15:03 2014 +0200
     1.2 +++ b/tazpkg	Tue Dec 02 09:14:09 2014 +0100
     1.3 @@ -841,6 +841,9 @@
     1.4  	set -e
     1.5  	. $SCRIPT
     1.6  	set +e
     1.7 +	cd $TMP_DIR
     1.8 +	[ -d $PACKAGE-$VERSION ] || abort_package \
     1.9 +	  "Could not download ${TARBALL:-$PACKAGE} from ${WGET_URL:-$WEB_SITE}. Exiting."
    1.10  	
    1.11  	if [ ! -s $PACKAGE-$VERSION/receipt ]; then
    1.12  		cat > $PACKAGE-$VERSION/receipt <<EOT
    1.13 @@ -854,7 +857,7 @@
    1.14  MAINTAINER="${MAINTAINER:-nobody@slitaz.org}"
    1.15  EOT
    1.16  		for i in LICENSE TARBALL WGET_URL CONFIG_FILES SUGGESTED \
    1.17 -			 PROVIDE DEPENDS HOST_ARCH TAGS ; do
    1.18 +			 PROVIDE DEPENDS HOST_ARCH TAGS EXTRA_SOURCE_FILES ; do
    1.19  			eval "[ -n \"\$$i\" ] && echo \"$i=\\\"\$$i\\\"\""
    1.20  		done >> $PACKAGE-$VERSION/receipt
    1.21  	fi
     2.1 --- a/tazpkg-convert	Tue Dec 02 04:15:03 2014 +0200
     2.2 +++ b/tazpkg-convert	Tue Dec 02 09:14:09 2014 +0100
     2.3 @@ -146,11 +146,12 @@
     2.4  {
     2.5  	mkdir -p $TMP_DIR
     2.6  	tar xOzf $PACKAGE_FILE ./control.tar.gz | tar xzf - -C $TMP_DIR
     2.7 -	package="$(grep ^Package $TMP_DIR/control | sed 's/.*: //')"
     2.8 -	version="$(grep ^Version $TMP_DIR/control | sed 's/.*: //')"
     2.9 -	maintainer="$(grep ^Maintainer $TMP_DIR/control | sed 's/.*: //')"
    2.10 -	target="$(grep ^Architecture $TMP_DIR/control | sed 's/.*: //')"
    2.11 -	descrip="$(grep ^Description $TMP_DIR/control | sed 's/.*: //')"
    2.12 +	package=$(sed '/^Package/!d;s/.*: //' $TMP_DIR/control)
    2.13 +	version=$(sed '/^Version/!d;s/.*: //' $TMP_DIR/control)
    2.14 +	maintainer="$(sed '/^Maintainer/!d;s/.*: //' $TMP_DIR/control)"
    2.15 +	target="$(sed '/^Architecture/!d;s/.*: //' $TMP_DIR/control)"
    2.16 +	descrip=$(sed '/^Description/!d;s/.*: //' $TMP_DIR/control)
    2.17 +	homepage=$(sed '/^Homepage/!d;s/.*: //' $TMP_DIR/control)
    2.18  	url="http://openwrt.org/"
    2.19  	case "$target" in
    2.20  	i386|all)
    2.21 @@ -165,7 +166,7 @@
    2.22  VERSION="$version"
    2.23  CATEGORY="misc"
    2.24  SHORT_DESC="$descrip"
    2.25 -WEB_SITE="$url"
    2.26 +WEB_SITE="${homepage:-$url}"
    2.27  MAINTAINER="$maintainer"
    2.28  DEPENDS="$(find_depends)"
    2.29  EOT
    2.30 @@ -216,11 +217,11 @@
    2.31  	busybox tar xf $PACKAGE_FILE -C $TMP_DIR/fs
    2.32  	if [ -f $TMP_DIR/fs/.PKGINFO ]; then
    2.33  		cd $TMP_DIR
    2.34 -		package="$(grep ^pkgname fs/.PKGINFO | sed 's/.*= //')"
    2.35 -		version="$(grep ^pkgver  fs/.PKGINFO | sed 's/.*= //')"
    2.36 -		descrip="$(grep ^pkgdesc fs/.PKGINFO | sed 's/.*= //')"
    2.37 -		url="$(grep ^url fs/.PKGINFO | sed 's/.*= //')"
    2.38 -		maintainer="$(grep ^packager fs/.PKGINFO | sed 's/.*= //')"
    2.39 +		package="$(sed '/^pkgname/!d;s/.*= //' fs/.PKGINFO)"
    2.40 +		version="$(sed '/^pkgver/!d;s/.*= //'  fs/.PKGINFO)"
    2.41 +		descrip="$(sed '/^pkgdesc/!d;s/.*= //' fs/.PKGINFO)"
    2.42 +		url="$(sed '/^url/!d;s/.*= //' fs/.PKGINFO)"
    2.43 +		maintainer="$(sed '/^packager/!d;s/.*= //' fs/.PKGINFO)"
    2.44  		file=$package-$version
    2.45  		mkdir $file
    2.46  		mv fs $file
    2.47 @@ -392,8 +393,8 @@
    2.48  	tar xzf $PACKAGE_FILE -C $TMP_DIR/$file/fs
    2.49  	cd $TMP_DIR
    2.50  	if [ -d $file/fs/install ]; then
    2.51 -		descrip=$(grep ^$package $file/fs/install/slack-desc | \
    2.52 -			  head -1 | sed 's/.*(\(.*\)).*/\1/')
    2.53 +		descrip=$(sed "/^$package/!d;s/.*(\\(.*\\)).*/\\1/;q" \
    2.54 +			  $file/fs/install/slack-desc)
    2.55  		cat > $file/receipt <<EOT
    2.56  # SliTaz package receipt.
    2.57  # generated by tazpkg from slackware package $(basename $PACKAGE_FILE)
    2.58 @@ -416,8 +417,8 @@
    2.59  EOT
    2.60  }
    2.61  EOM
    2.62 -		grep ^$package $file/fs/install/slack-desc | \
    2.63 -			sed "s/^$package://" > $file/description.txt
    2.64 +		sed "/^$package/:d;s/^$package://" \
    2.65 +			$file/fs/install/slack-desc > $file/description.txt
    2.66  		[ -s $file/description.txt ] || rm -f $file/description.txt
    2.67  		rm -rf $file/fs/install
    2.68  		tazpkg pack $file
    2.69 @@ -436,13 +437,11 @@
    2.70  {
    2.71  	mkdir -p $TMP_DIR
    2.72  	dpkg-deb -e $PACKAGE_FILE $TMP_DIR
    2.73 -	package=$(grep '^ *Package:' $TMP_DIR/control)
    2.74 -	package=$(echo ${package##*:})
    2.75 -	version=$(grep '^ *Version:' $TMP_DIR/control)
    2.76 -	version=$(echo ${version##*:})
    2.77 -	descrip=$(grep '^ *Description:' $TMP_DIR/control)
    2.78 -	descrip=$(echo ${descrip##*:})
    2.79 -	target="$(grep ^Architecture $TMP_DIR/control | sed 's/.*: //')"
    2.80 +	package=$(sed '/^ *Package:/!d;s/.*: //' $TMP_DIR/control)
    2.81 +	version=$(sed '/^ *Version:/!d;s/.*: //' $TMP_DIR/control)
    2.82 +	descrip=$(sed '/^ *Description:/!d;s/.*: //' $TMP_DIR/control)
    2.83 +	homepage=$(sed '/^ *Homepage:/!d;s/.*: //' $TMP_DIR/control)
    2.84 +	target="$(sed '/^ *Architecture:/!d;s/.*: //' $TMP_DIR/control)"
    2.85  	case "$target" in
    2.86  	i386|all)
    2.87  		file="$package-$version"
    2.88 @@ -456,7 +455,7 @@
    2.89  VERSION="$version"
    2.90  CATEGORY="misc"
    2.91  SHORT_DESC="$descrip"
    2.92 -WEB_SITE="http://packages.debian.org/search?keywords=$package"
    2.93 +WEB_SITE="${homepage:-http://packages.debian.org/search?keywords=$package}"
    2.94  MAINTAINER="nobody@slitaz.org"
    2.95  EOT
    2.96  		LICENSE="$(grep /usr/share/common-licenses/ \