File: rules

package info (click to toggle)
auctex 12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 6,144 kB
  • sloc: lisp: 48,161; makefile: 858; sh: 112; perl: 90
file content (168 lines) | stat: -rwxr-xr-x 5,142 bytes parent folder | download | duplicates (2)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#! /usr/bin/make -f
#
# makefile rules for the Debian package auctex
#
# Copyright (C) 1997-2017 Davide G. M. Salvetti.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# On Debian GNU/Linux System you can find a copy of the GNU General Public
# License in "/usr/share/common-licenses/GPL".

include /usr/share/dpkg/pkg-info.mk

SHELL := /bin/bash
SBUILD := sbuild --verbose

EPERL_SRC := $(wildcard debian/*.eperl)
EPERL_OBJ := $(EPERL_SRC:%.eperl=%)

debian/clean: $(EPERL_OBJ)
	echo $(filter-out debian/copyright debian/rules \
		debian/auctex.templates, $(EPERL_OBJ)) \
		debian/auctex.templates.dcobj \
		debian/clean > debian/clean

%:: %.eperl
	eperl -P -o $@ $<

%:
	dh $@ --exclude .eperl --with tex

.PHONY: override_dh_auto_configure
override_dh_auto_configure: debian/clean
	./autogen.sh
	dh_auto_configure

ELCC := $(shell pwd)/debian/elcc
.PHONY: override_dh_auto_build
override_dh_auto_build: debian/clean
	chmod -R a+rX debian/
	chmod a+x debian/elcc
	$(MAKE) ELCC=$(ELCC)
	rm --force auto-loads.el
	$(MAKE) auto-loads.el
	$(MAKE) tex-site.el
	cd doc && $(MAKE) auctex.htmls/index.html
	cd doc && $(MAKE) preview-latex.htmls/index.html

.PHONY: override_dh_auto_test
override_dh_auto_test:

.PHONY: override_dh_install
override_dh_install:
	find debian/tmp/usr/share/emacs/site-lisp -type f -name \*.elc \
		-print0 | xargs --null --no-run-if-empty rm -f
	mv --verbose debian/tmp/usr/share/emacs/site-lisp/auctex \
		debian/tmp/usr/share/
	dh_install

.PHONY: override_dh_installchangelogs
override_dh_installchangelogs:
	dh_installchangelogs --exclude CHANGES

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --exclude=.pdf

.PHONY: override_dh_installdocs
override_dh_installdocs:
	install -m 755 -d debian/tmp/usr/doc/auctex/src
	install -m 644 doc/tex-ref.pdf debian/tmp/usr/doc/auctex
	install -m 644 doc/*.tex{,i} debian/tmp/usr/doc/auctex/src
	install -m 644 etc/auctex-logo.tex debian/tmp/usr/doc/auctex/src
	install -m 755 -d \
		debian/tmp/usr/doc/auctex/HTML/{auctex,preview-latex}
	install -m 644 doc/auctex.htmls/* \
		debian/tmp/usr/doc/auctex/HTML/auctex
	install -m 644 doc/preview-latex.htmls/* \
		debian/tmp/usr/doc/auctex/HTML/preview-latex
	dh_installdocs

.PHONY: override_dh_installtex
override_dh_installtex:
	dh_installtex --package=preview-latex-style

debian/po/templates.pot: debian/auctex.templates debian/po/*.po
	umask 0022 && debconf-updatepo --verbose --podir=debian/po
	@touch $@

%.dcobj: % debian/po/templates.pot
	po2debconf --verbose --podir debian/po $< > $@

.PHONY: debconf-test
debconf-test: debian/auctex.templates.dcobj debian/auctex.config
	debconf-loadtemplate auctex \
		debian/auctex.templates.dcobj
	DEBCONF_DEBUG=developer debconf --owner=auctex \
		--frontend=dialog --priority=low \
		$(SHELL) -e debian/auctex.config configure

.PHONY: debconf-ask-for-translations
debconf-ask-for-translations: debian/auctex.templates.dcobj
	podebconf-report-po --verbose --gzip \
		 --call --withtranslators --languageteam \
		--package=auctex --deadline='+7days' \
		--from='"Davide G. M. Salvetti (Debian auctex maintainer)" <salve@debian.org>' \
		--postpone=../+RFT.mbox

.PHONY: vcs-switch
vcs-switch:
	git checkout vcs/debian

.PHONY: vcs-import
vcs-import: D := $(shell date --utc +%Y%m%d%H%M)
vcs-import: V := "$(DEB_VERSION_UPSTREAM)+vcs.$(D)"
vcs-import: vcs-switch
	git archive --verbose --worktree-attributes \
		--prefix="auctex-$(V)/" \
		--output="../auctex_$(V).orig.tar.gz" \
		vcs/upstream/git
	gbp import-orig --verbose \
		--upstream-branch=vcs/upstream/snapshot \
		--debian-branch=vcs/debian \
		"../auctex_$(V).orig.tar.gz"
	rm --force "../auctex_$(V).orig.tar.gz"

.PHONY: snapshot
snapshot: OBJ := --arch-all
snapshot: DIST := unstable
snapshot: BRANCH := $(shell git branch | perl -ne 'print if s/^\* //')
snapshot: LAST := $(shell git describe --abbrev=0 --match 'debian/*' master)
snapshot: clean
	git clean -ix
	gbp dch --debian-branch=$(BRANCH) --snapshot --since $(LAST) --commit
	gbp buildpackage --keyid='' \
		--git-no-pristine-tar \
		--git-builder='$(SBUILD) $(OBJ) --dist=$(DIST)' \
		--git-debian-branch=$(BRANCH)

.PHONY: release
release: OBJ := --arch-all --arch-any --source --source-only-changes
release: DIST := unstable
release: clean
	git clean -ix
	git checkout master
	gbp pq rebase
	gbp pq export
	gbp dch --release --commit
	gbp buildpackage \
		--git-no-pristine-tar \
		--git-pristine-tar-commit \
		--git-builder='$(SBUILD) $(OBJ) --dist=$(DIST)' \
		--git-tag

.PHONY: upload
upload:
	dput ../auctex_$(DEB_VERSION)_source.changes