File: rules

package info (click to toggle)
portabase 2.1%2Bgit20120910-1.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 8,648 kB
  • ctags: 3,498
  • sloc: cpp: 32,214; sh: 2,868; ansic: 2,320; makefile: 481; python: 121; xml: 23; asm: 10
file content (76 lines) | stat: -rwxr-xr-x 2,266 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

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

PACKAGE := portabase
VER := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*([\d\.+git]+)/')
UVER := $(shell echo $(VER) | perl -ne 'print $$1 if m/\+git(\d+)/')
UVER_DATE := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^(\d{8})/')
UVER_TIME := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^\d{8}(\d+)/')
UVER_UDATE := $(shell date -u -d "$(UVER_DATE) $(UVER_TIME)" +%s)

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@ --with autotools-dev,sphinxdoc

#QM_FILES := $(patsubst %.ts, %.qm, $(wildcard resources/translations/*.ts))
#$(QM_FILES):
#	## rebuild translations
#	lupdate portabase.pro -locations none -silent -ts $(@:.qm=.ts)
#	lrelease $(@:.qm=.ts)

override_dh_auto_clean:
	$(MAKE) -C metakit/builds distclean || $(RM) metakit/builds/*
	$(RM) -r build/mk4* resources/translations/*.qm resources/help/_build

	dh_auto_clean

override_dh_auto_configure:
	chmod -R a-x+X metakit/ qqutil/ resources/ \
	&& chmod +x metakit/unix/configure
	cd metakit/builds && ../unix/configure --enable-threads --disable-shared
	
	## rebuild translations
	lrelease portabase.pro
	lrelease resources/translations/qt*.ts
	
	dh_auto_configure

override_dh_auto_build:
	## build metakit
	cd metakit/builds && $(MAKE)
	mkdir -p build \
	&& cp metakit/include/mk4.h metakit/include/mk4.inl \
	        metakit/include/mk4str.h metakit/include/mk4str.inl \
	        build/
	
	## build help files
	packaging/linux/debian.sh
	
	dh_auto_build

override_dh_sphinxdoc:
	for lang in en cs fr ja zh_TW; do \
	    dh_sphinxdoc -v usr/share/$(PACKAGE)/help/$$lang ;\
	done

override_dh_installchangelogs:
	dh_installchangelogs CHANGES

override_dh_builddeb:
	dh_builddeb -- -Zxz

get-orig-source:
	@echo " Upstream version: $(UVER)\n Version: $(VER)\n UDATE: $(UVER_UDATE)"
	git clone git://git.code.sf.net/p/portabase/code-0 $(PACKAGE)-$(UVER)
	cd $(PACKAGE)-$(UVER) \
	&& git reset --hard $$(git rev-list --all -n 1 --before=$(UVER_UDATE)) \
	&& git checkout master \
	&& $(RM) -r .git .git* packaging/windows/*.EXE \
        && cd .. \
	&& echo "Packing..." \
	&& tar cJf $(PACKAGE)_$(VER).orig.tar.xz $(PACKAGE)-$(UVER)
	$(RM) -r $(PACKAGE)-$(UVER)