mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Keep debian package up-to-date
This commit is contained in:
parent
b37f7d49d8
commit
52cebe19e5
2 changed files with 26 additions and 3 deletions
|
@ -13,8 +13,8 @@ PKG_NAME=lxc-docker
|
|||
ROOT_PATH=$(shell git rev-parse --show-toplevel)
|
||||
GITHUB_PATH=github.com/dotcloud/docker
|
||||
BUILD_SRC=build_src
|
||||
VERSION_TAG?=v$(shell sed -E 's/.+\((.+)-.+\).+/\1/;q' changelog)
|
||||
VERSION=$(shell echo ${VERSION_TAG} | cut -c2-)
|
||||
VERSION=$(shell sed -En '0,/^\#\# /{s/^\#\# ([^ ]+).+/\1/p}' ../../CHANGELOG.md)
|
||||
VERSION_TAG?=v${VERSION}
|
||||
DOCKER_VERSION=${PKG_NAME}_${VERSION}
|
||||
|
||||
all:
|
||||
|
@ -28,7 +28,6 @@ install:
|
|||
mkdir -p $(DESTDIR)/usr/share/doc/lxc-docker
|
||||
install -m 0755 src/${GITHUB_PATH}/docker/docker $(DESTDIR)/usr/bin/lxc-docker
|
||||
cp debian/lxc-docker.1 $(DESTDIR)/usr/share/man/man1
|
||||
cp debian/CHANGELOG.md $(DESTDIR)/usr/share/doc/lxc-docker/changelog
|
||||
|
||||
debian:
|
||||
# Prepare docker source from revision ${VERSION_TAG}
|
||||
|
@ -41,6 +40,7 @@ debian:
|
|||
cp -r `ls | grep -v ${BUILD_SRC}` ${BUILD_SRC}/debian
|
||||
cp ${ROOT_PATH}/README.md ${BUILD_SRC}
|
||||
cp ${ROOT_PATH}/CHANGELOG.md ${BUILD_SRC}/debian
|
||||
./parse_changelog.py < ../../CHANGELOG.md > ${BUILD_SRC}/debian/changelog
|
||||
# Cleanup
|
||||
rm -rf `find . -name '.git*'`
|
||||
rm -f ${DOCKER_VERSION}*
|
||||
|
|
23
packaging/debian/parse_changelog.py
Executable file
23
packaging/debian/parse_changelog.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
'Parse main CHANGELOG.md from stdin outputing on stdout the debian changelog'
|
||||
|
||||
import sys,re, datetime
|
||||
|
||||
on_block=False
|
||||
for line in sys.stdin.readlines():
|
||||
line = line.strip()
|
||||
if line.startswith('# ') or len(line) == 0:
|
||||
continue
|
||||
if line.startswith('## '):
|
||||
if on_block:
|
||||
print '\n -- dotCloud <ops@dotcloud.com> {0}\n'.format(date)
|
||||
version, date = line[3:].split()
|
||||
date = datetime.datetime.strptime(date, '(%Y-%m-%d)').strftime(
|
||||
'%a, %d %b %Y 00:00:00 -0700')
|
||||
on_block = True
|
||||
print 'lxc-docker ({0}-1) precise; urgency=low'.format(version)
|
||||
continue
|
||||
if on_block:
|
||||
print ' ' + line
|
||||
print '\n -- dotCloud <ops@dotcloud.com> {0}'.format(date)
|
Loading…
Reference in a new issue