File: rules

package info (click to toggle)
doublecmd 0.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,764 kB
  • ctags: 34,016
  • sloc: pascal: 273,752; ansic: 5,938; sh: 733; makefile: 194; python: 116; xml: 107
file content (78 lines) | stat: -rwxr-xr-x 3,137 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
77
78
#!/usr/bin/make -f

export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

# Set temporary HOME for lazarus primary config directory
export HOME=$(CURDIR)/tmphome

%:
	dh $@

override_dh_install:
	cd language ;\
		if [ -f doublecmd.po ] ; then mv doublecmd.po doublecmd.en.po; fi ;

	# Remove convenience copy of Free Pascal Qt4 binding, use libqt4pas-dev instead
	rm -f plugins/wlx/WlxMplayer/src/qt4.pas

	# Build GTK2 version
	./build.sh beta gtk2
	./install/linux/install.sh --install-prefix=$(CURDIR)/debian/doublecmd-common
	./clean.sh

	# Build Qt4 version
	./build.sh beta qt
	./install/linux/install.sh --install-prefix=$(CURDIR)/debian/doublecmd-qt-temp
	./clean.sh

	# Separate GTK2-specific files
	mkdir -p $(CURDIR)/debian/doublecmd-gtk/usr/lib/doublecmd/plugins
	mv $(CURDIR)/debian/doublecmd-common/usr/lib/doublecmd/doublecmd $(CURDIR)/debian/doublecmd-gtk/usr/lib/doublecmd/
	mv $(CURDIR)/debian/doublecmd-common/usr/lib/doublecmd/plugins/wlx $(CURDIR)/debian/doublecmd-gtk/usr/lib/doublecmd/plugins/
	mv $(CURDIR)/debian/doublecmd-common/usr/lib/doublecmd/doublecmd.zdli $(CURDIR)/debian/doublecmd-gtk/usr/lib/doublecmd/

	# Separate Qt4-specific files
	mkdir -p $(CURDIR)/debian/doublecmd-qt/usr/lib/doublecmd/plugins
	mv $(CURDIR)/debian/doublecmd-qt-temp/usr/lib/doublecmd/doublecmd $(CURDIR)/debian/doublecmd-qt/usr/lib/doublecmd/
	mv $(CURDIR)/debian/doublecmd-qt-temp/usr/lib/doublecmd/plugins/wlx $(CURDIR)/debian/doublecmd-qt/usr/lib/doublecmd/plugins/
	mv $(CURDIR)/debian/doublecmd-qt-temp/usr/lib/doublecmd/doublecmd.zdli $(CURDIR)/debian/doublecmd-qt/usr/lib/doublecmd/
	rm -rf $(CURDIR)/debian/doublecmd-qt-temp/

	# Separate plugins
	mkdir -p $(CURDIR)/debian/doublecmd-plugins/usr/lib/doublecmd
	mv $(CURDIR)/debian/doublecmd-common/usr/lib/doublecmd/plugins $(CURDIR)/debian/doublecmd-plugins/usr/lib/doublecmd

	# Clean up common files
	rm -rf $(CURDIR)/debian/doublecmd-common/usr/share/doublecmd/doc
	find $(CURDIR)/debian/doublecmd-common/usr/share/ -type f | xargs chmod a-x ;

	dh_install

override_dh_strip:
	# Strip plugins because dh_strip cannot handle non-standard extensions (bug #35733)
	find $(CURDIR)/debian/doublecmd-*/usr/lib/doublecmd/plugins/ -name '*.w?x' -o -name '*.dsx' | \
		xargs strip --remove-section=.comment --strip-unneeded ;
	dh_strip

override_dh_clean:
	./clean.sh

	cd language ;\
		if [ -f doublecmd.en.po ] ; then mv doublecmd.en.po doublecmd.po; fi ;
	# Clean up temporary HOME
	rm -rf $(CURDIR)/tmphome
	# Remove generated changelog
	rm -f $(CURDIR)/changelog.txt
	dh_clean

override_dh_installchangelogs:
	html2text -o $(CURDIR)/changelog.txt $(CURDIR)/doc/changelog.htm
	# Remove header up until first changelog entry
	sed -i '0,/Double_Commander/{//!d}' $(CURDIR)/changelog.txt
	# Remove [ View_Issues ] links
	sed -i 's/ \[ View_Issues \]//' $(CURDIR)/changelog.txt
	# Remove lines with number of issues fixed ([5 issues], etc.)
	sed -i '/\[[0-9]* issue[s]*\]/d' $(CURDIR)/changelog.txt
	# Remove [Get_Double_Commander...] link and footer
	sed -i '/Get_Double_Commander/,$$d' $(CURDIR)/changelog.txt
	dh_installchangelogs $(CURDIR)/changelog.txt