summaryrefslogtreecommitdiff
path: root/debian/rules
blob: c8cc71d639879c07b374c1eb48f49420638c26e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
#
# debian/rules
#
# Copyright © 2008–2009 Ben Finney <ben+debian@benfinney.id.au>
# This is free software; you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied.
# See the file ‘/usr/share/common-licenses/GPL-2’ for details.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

MAKEFILE_ORIG = Makefile
MAKEFILE_EXTRAS = extras.mk

GET_ORIG_SOURCE = $(dir $_)get-orig-source


.PHONY: build
build:
	mv ${MAKEFILE_ORIG} ${MAKEFILE_EXTRAS}
	$(MAKE) --file ${MAKEFILE_EXTRAS} $@
	dh build
	mv ${MAKEFILE_EXTRAS} ${MAKEFILE_ORIG}

.PHONY: clean
clean:
	mv ${MAKEFILE_ORIG} ${MAKEFILE_EXTRAS}
	$(MAKE) --file ${MAKEFILE_EXTRAS} $@
	dh clean
	mv ${MAKEFILE_EXTRAS} ${MAKEFILE_ORIG}

.PHONY: get-orig-source
get-orig-source:
	chmod +x ${GET_ORIG_SOURCE}
	$(GET_ORIG_SOURCE)

.PHONY: install
install: build
	mv ${MAKEFILE_ORIG} ${MAKEFILE_EXTRAS}
	$(MAKE) --file ${MAKEFILE_EXTRAS} $@
	dh install
	mv ${MAKEFILE_EXTRAS} ${MAKEFILE_ORIG}

build-indep: binary-indep

build-arch: binary-arch

.PHONY: binary-indep
binary-indep: build install
	dh binary-indep

.PHONY: binary-arch
binary-arch: build install

.PHONY: binary
binary: build binary-indep binary-arch

.PHONY: override_dh_installchangelogs
override_dh_installchangelogs:
	dh_installchangelogs -k NEWS

version=$(shell parsechangelog --format=rfc822 | grep Version: | cut -d' ' -f2- | cut -d- -f1)

.PHONY: new-version
new-version: libbe/_version.py


.PHONY: libbe/_version.py
libbe/_version.py:
	git log -1 --encoding=UTF-8 --date=short --pretty='format:# -*- coding: utf-8 -*-%n# Autogenerated by debian/rules libbe/_version.py"%nversion_info = {%n    "date":"%cd",%n    "revision":"%H",%n    "committer":"%cn"}%n' $(version) > $@
	git commit -m"generate new metadata file for version $(version)" -a


# Local Variables:
# mode: makefile
# coding: utf-8
# End:
# vim: filetype=make fileencoding=utf-8 :