From cc99a492bbf430e4277b782149ca9464661ce90c Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Tue, 4 Feb 2014 20:18:37 -0800 Subject: Better changelog hack in separate script called from ./update. dpkg-buildpackage reads the changelog before ever calling debian/rules, so its not a good idea to change it from there. Move this to a separate script called from ./update which does not depend on any debian-specific commands. --- debian/changelog | 15 ++++++++++++- debian/control | 2 -- debian/rules | 7 ++---- scripts/debian-update-versions | 48 ++++++++++++++++++++++++++++++++++++++++++ update | 7 ++++++ 5 files changed, 71 insertions(+), 8 deletions(-) create mode 100755 scripts/debian-update-versions diff --git a/debian/changelog b/debian/changelog index 011ebdf..27e14bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +mpv (1:0.3.4) UNRELEASED; urgency=medium + + * local build + + -- Local User Tue, 04 Feb 2014 21:48:02 -0800 + +mpv (0:0.3.4-1) stable; urgency=medium + + * better changelog hack: debian build scripts read the version before + it gets updated. Do a sed in the ./update instead. + + -- Kevin Mitchell Tue, 04 Feb 2014 19:06:32 -0800 + mpv (0:0.3.4) stable; urgency=medium * changelog hack: add an "UNRELEASED" changelog entry by the @@ -5,7 +18,7 @@ mpv (0:0.3.4) stable; urgency=medium out mpv version. This has the "papercut" of repeating the "local build" bullet in the same entry each time the package is built. - -- Kevin Mitchell Sat, 01 Feb 2014 19:09:11 -0800 + -- Kevin Mitchell Sat, 01 Feb 2014 19:09:11 -0800 mpv (0:0.3.3-1) stable; urgency=medium diff --git a/debian/control b/debian/control index 387d227..f30dc9b 100644 --- a/debian/control +++ b/debian/control @@ -8,9 +8,7 @@ Build-Depends: automake, c-compiler, debhelper (>= 7), - devscripts, gcc-4.8 [powerpc powerpcspe sparc], - git, ladspa-sdk, libasound2-dev [linux-any], libbluray-dev, diff --git a/debian/rules b/debian/rules index 996041a..737a744 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,5 @@ #! /usr/bin/make -f + # from official debian package: testing welcome! ifeq ($(DEB_HOST_ARCH_CPU),$(filter $(DEB_HOST_ARCH_CPU),powerpc sparc)) export CC=gcc-4.8 # fixes #73363 @@ -21,7 +22,7 @@ endif # Apparently, the above isn't enough because of the "%" target. Make the problematic targets explicit clean: exec dh $@ -build: update_version +build: exec dh $@ install: exec dh $@ @@ -31,10 +32,6 @@ install: %: exec dh $@ -MPV_VERSION=$(shell cd mpv && git describe --tags | sed 's/^v//';) -update_version: - dch -v "1:$(MPV_VERSION)" "local build" - # this should really create multiple shared object debian packages but # this will do for now # the dependencies must be built before mpv is configured diff --git a/scripts/debian-update-versions b/scripts/debian-update-versions new file mode 100755 index 0000000..8102d0d --- /dev/null +++ b/scripts/debian-update-versions @@ -0,0 +1,48 @@ +#!/bin/sh + +get_version() +{ + ( + cd $1 + git describe --tags | sed 's/^[^0-9]*//' + ) +} + +get_timestamp_commit() +{ + ( + cd $1 + TIMESTAMP=$(git log -1 --date=short --format=%cd | sed 's/-/./g') + COMMIT=$(git rev-parse --short HEAD) + echo ${TIMESTAMP}.${COMMIT} + ) +} + +do_subst() { + sed -i "0,/^mpv (.*)/s/(.*)/(1:$1)/" debian/changelog + sed -i "s/^ \* local build.*/ \* local build with ffmpeg $2, libass $3/" debian/changelog + sed -i "s/\(^ -- Local User \).*/\1 $(date -R)/" debian/changelog +} + +do_version_all() { + do_subst $(get_version mpv) $(get_version ffmpeg) $(get_version libass) +} + +do_timestamp_commit_all() { + do_subst $(get_timestamp_commit mpv) $(get_timestamp_commit ffmpeg) $(get_timestamp_commit libass) +} + +case "$1" in + --master) + do_timestamp_commit_all + ;; + --release|'') + do_version_all + ;; + *) + echo >&2 "$0 --master" + echo >&2 "$0 --release" + exit 0 + ;; +esac + diff --git a/update b/update index 7a7ee9e..ef9d171 100755 --- a/update +++ b/update @@ -75,6 +75,11 @@ do_bootstrap() scripts/mpv-bootstrap } +do_update_debian_versions() +{ + scripts/debian-update-versions $1 +} + if [ x"$1" != x"--skip-selfupdate" ]; then ( set -ex @@ -98,4 +103,6 @@ case "$1" in ;; esac +do_update_debian_versions $1 + do_bootstrap -- cgit v1.2.3