10
10
BUILDER := $(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2> /dev/null))}})
12
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
13
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
19
20
ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
20
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
21
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
26
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30
CFLAGS+=$(if $(findstring nodebug,$(DEB_BUILD_OPTIONS)),,-g -Wall)
31
CFGFLAGS:=--prefix=/usr --mandir='$${prefix}'/share/man --with-compiledby="$(BUILDER)"
27
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
31
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
32
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
33
MAKEFLAGS += -j$(NUMJOBS)
36
CFGFLAGS:=--prefix=/usr --mandir='$${prefix}'/share/man --with-compiledby="$(BUILDER)" --without-local-dir
33
38
# "vim-tiny" features: in addition to those coming from the --with-features=xxx,
34
39
# "vim-tiny" is built with those listed in debian/tiny/features.txt
122
127
CFGFLAGS_vim-nox:=$(CFGFLAGS) $(OPTFLAGS) $(NOXFLAGS) $(ALLINTERPFLAGS)
127
VIMCUR:=$(NAME)$(subst .,,$(VERSION))
132
VIMCUR:=$(NAME)$(subst .,,$(VERSION))$(SNAPSHOT)
128
133
DEBVERSION:=$(shell dpkg-parsechangelog | sed -n '/^Version:/{s/Version: *\([^:]*:\)\?\([^-]*\)-.*/\2/;p;q}')
129
FTP:=ftp://ftp.vim.org/pub/vim/$(if $(SNAPSHOT),unstable/,)
134
FTP:=ftp://ftp.vim.org/pub/vim$(if $(SNAPSHOT),/unstable,)
130
135
MAIN_TARBALL:=$(NAME)-$(VERSION)$(SNAPSHOT).tar.bz2
131
136
LANG_TARBALL:=$(NAME)-$(VERSION)$(SNAPSHOT)-lang.tar.gz
132
137
EXTRA_TARBALL:=$(NAME)-$(VERSION)$(SNAPSHOT)-extra.tar.gz
137
142
LANGS += pl pl.ISO8859-2 pl.UTF-8
140
DOT_IN_DEPS := debian/vim-runtime.install
141
DOT_IN_DEPS += debian/vim-common.install
145
DOT_IN_DEPS := debian/vim-common.install
146
DOT_IN_DEPS += debian/vim-common.links
142
147
DOT_IN_DEPS += debian/vim-gui-common.install
143
DOT_IN_DEPS += debian/vim-common.links
144
148
DOT_IN_DEPS += debian/vim-gui-common.links
149
DOT_IN_DEPS += debian/vim-runtime.install
145
150
DOT_IN_DEPS += debian/vim-runtime.links
146
151
DOT_IN_DEPS += debian/vim-runtime.postrm
147
152
DOT_IN_DEPS += debian/vim-runtime.preinst
148
153
DOT_IN_DEPS += debian/runtime/debian.vim
154
DOT_IN_DEPS += debian/lintian/vim-runtime
149
155
DOT_IN_DEPS_TINY := debian/tiny/vimrc.tiny
151
157
# nothing to do per default
154
160
# Should be run from master branch after the release has been prepared
156
162
if git rev-parse --git-dir >/dev/null 2>&1; then \
157
git checkout upstream; \
158
git tag upstream/$(DEBVERSION); \
163
git tag upstream/$(DEBVERSION) upstream; \
159
164
git archive --format=tar --prefix=$(NAME)-$(DEBVERSION)/ upstream | gzip > $(ORIG_SOURCE); \
160
165
pristine-tar commit $(ORIG_SOURCE); \
161
git checkout master; \
172
176
wget -O $(MAIN_TARBALL) $(FTP)/unix/$(MAIN_TARBALL)
173
tar zx -f $(MAIN_TARBALL)
177
tar jx -f $(MAIN_TARBALL)
174
178
wget -O $(LANG_TARBALL) $(FTP)/extra/$(LANG_TARBALL)
175
179
tar zx -f $(LANG_TARBALL)
176
180
wget -O $(EXTRA_TARBALL) $(FTP)/extra/$(EXTRA_TARBALL)
177
181
tar zx -f $(EXTRA_TARBALL)
178
mv $(NAME)$(VERSION)$(SNAPSHOT) $(NAME)-$(DEBVERSION)
182
mv $(VIMCUR) $(NAME)-$(DEBVERSION)
179
183
tar zc -f $(ORIG_SOURCE) $(NAME)-$(DEBVERSION)
180
184
rm -rf $(NAME)-$(DEBVERSION)
185
rm -f $(MAIN_TARBALL) $(LANG_TARBALL) $(EXTRA_TARBALL)
182
187
clean: $(foreach v,$(VARIANTS),clean-$(v))
196
203
for x in $(PER_VARIANT_FILES) ; do \
197
204
rm -f debian/vim.$$x ; \
199
for x in vim-gui-common.{install,links} vim-common.{install,links} \
200
vim-runtime.install; do \
203
206
[ ! -L src/vim-basic/po ] || $(MAKE) -C src/vim-basic/po clean
204
207
rm -f $(DOT_IN_DEPS)
205
208
rm -rf src/vim-basic
207
210
clean-%: SHADOWDIR=$*
209
214
for x in $(PER_VARIANT_FILES) ; do \
210
215
rm -f debian/$*.$$x ; \
251
256
mv src/$(SHADOWDIR)/vim src/$(SHADOWDIR)/$(subst -,.,$*)
254
install: install-stamp
255
install-stamp: $(foreach v,$(VARIANTS),install-stamp-$(v))
259
install: $(foreach v,$(VARIANTS),install-stamp-$(v))
257
261
install-stamp-indep: export DH_OPTIONS=-pvim-doc -pvim-python -pvim-perl -pvim-ruby -pvim-tcl -pvim-full
258
262
install-stamp-indep: build-stamp-indep
278
282
$(MAKE) -C src/vim-basic DESTDIR=$(DESTDIR) installvimbin \
279
283
installtutorbin \
283
288
install-languages
290
# Tests need to be run in series, otherwise the terminal requests may not see
285
292
if [ $(MAKETEST) = "yes" ]; then \
286
$(MAKE) -C src/vim-basic test; \
293
$(MAKE) -j1 -C src/vim-basic test; \
288
295
# installvimbin installs the vim binary under debian/tmp but we install
289
296
# it into the vim package from src/. Need to rm it from debian/tmp so
303
310
# rm stuff handled by alternatives
304
311
rm -f $(DESTDIR)/usr/bin/{ex,view}
305
@for f in `find $(DESTDIR)/usr/share/man -name view.1 -o -name ex.1`; do \
312
for f in `find $(DESTDIR)/usr/share/man -name view.1 -o -name ex.1`; do \
316
# rm stuff handled by our own symlinks
317
for f in `find $(DESTDIR)/usr/share/man -name rvim.1 -o -name rview.1`; do \
308
321
# helpztags manpage
309
322
pod2man -c "User Commands" -s 1 -q none -r "vim $(VERSION)$(SNAPSHOT)" \
310
323
-d "September 2003" debian/helpztags debian/helpztags.1
327
340
# Generate language-specific sections of
328
341
# vim-{runtime,common,gui-common}.install files
329
@for L in $(LANGS); do \
342
for L in $(LANGS); do \
330
343
echo debian/tmp/usr/share/man/$$L/man1/vimtutor.1 \
331
344
usr/share/man/$$L/man1/ >>debian/vim-runtime.install; \
334
@for L in $(LANGS); do \
335
echo debian/tmp/usr/share/man/$$L/man1/\* \
336
usr/share/man/$$L/man1/ >>debian/vim-common.install; \
339
@for L in $(LANGS); do \
345
for f in vim xxd vimdiff; do \
346
echo debian/tmp/usr/share/man/$$L/man1/$$f.1 \
347
usr/share/man/$$L/man1/ >>debian/vim-common.install; \
340
349
echo debian/tmp/usr/share/man/$$L/man1/evim.1 \
341
350
usr/share/man/$$L/man1/ >>debian/vim-gui-common.install; \
348
357
debian/vim-gui-common/usr/share/man/man1/gvim.1
349
358
cp debian/vim-common/usr/share/man/man1/vimdiff.1 \
350
359
debian/vim-gui-common/usr/share/man/man1/gvimdiff.1
351
rm -f debian/vim-common/usr/share/man/man1/evim.1
352
@for L in $(LANGS); do \
360
for L in $(LANGS); do \
353
361
cp debian/vim-common/usr/share/man/$$L/man1/vim.1 \
354
362
debian/vim-gui-common/usr/share/man/$$L/man1/gvim.1; \
355
363
cp debian/vim-common/usr/share/man/$$L/man1/vimdiff.1 \
356
364
debian/vim-gui-common/usr/share/man/$$L/man1/gvimdiff.1; \
357
rm -f debian/vim-common/usr/share/man/$$L/man1/evim.1; \
359
# remove things that are in vim-runtime
360
rm -f debian/vim-common/usr/share/man/man1/vimtutor.1
361
@for L in $(LANGS); do \
362
rm -f debian/vim-common/usr/share/man/$$L/man1/vimtutor.1; \
364
366
rmdir debian/vim-gui-common/usr/bin
365
367
# Generate language-specific sections of
366
# vim-{common,gui-common}.links files
367
@for L in $(LANGS); do \
368
# vim-{runtime,common,gui-common}.links files
369
for L in $(LANGS); do \
370
echo usr/share/man/$$L/man1/vimtutor.1 \
371
usr/share/man/$$L/man1/gvimtutor.1 >>debian/vim-runtime.links; \
368
372
for p in rvim rview; do \
369
373
echo usr/share/man/$$L/man1/vim.1 \
370
374
usr/share/man/$$L/man1/$$p.1 >>debian/vim-common.links; \
374
@for L in $(LANGS); do \
375
376
for p in gview rgvim rgview; do \
376
377
echo usr/share/man/$$L/man1/gvim.1 \
377
378
usr/share/man/$$L/man1/$$p.1 >>debian/vim-gui-common.links; \
407
408
sed -e "s:@PKG@:vim-tiny:;s:@VARIANT@:tiny:" \
408
409
debian/lintian/vim-variant > debian/lintian/vim-tiny
409
# Handle the gvim menu file overrides
410
if [ -e "debian/lintian/vim-tiny.in" ]; then \
411
cat debian/lintian/vim-tiny.in >> debian/lintian/vim-tiny; \
413
410
for L in $(LANGS); do \
414
411
sed -e "s:\(.*\)@LANG_ALTS@:\1--slave \$$mandir/$$L/man1/\$$i.1.gz \$$i.$$L.1.gz \$$mandir/$$L/man1/vim.1.gz \\\\\n&:" \
415
412
-i debian/vim-tiny.postinst; \