File: Makefile

package info (click to toggle)
relational 3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,184 kB
  • sloc: python: 2,982; makefile: 101
file content (114 lines) | stat: -rw-r--r-- 3,631 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
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
.PHONY: all
all: gui translations

.PHONY: gui
gui: relational_gui/survey.py relational_gui/maingui.py relational_gui/rel_edit.py

relational_gui/maingui.py relational_gui/survey.py relational_gui/rel_edit.py: relational_gui/maingui.ui relational_gui/rel_edit.ui relational_gui/survey.ui
	# Create .py file
	pyuic6 $(basename $@).ui > $@
	# Use my custom editor class
	sed -i 's/QtWidgets.QPlainTextEdit/editor.Editor/g' $@
	echo 'from . import editor' >> $@
	# Use gettext instead of Qt translations
	echo 'from gettext import gettext as _' >> $@
	sed -i \
		-e 's/_translate("MainWindow", /_(/g' \
		-e 's/_translate("Dialog", /_(/g' \
		-e 's/_translate("Form", /_(/g' \
		$@

.PHONY: mypy
mypy: gui
	mypy relational relational_readline relational_gui

.PHONY: test
test:
	./driver.py

deb-pkg: dist
	mv relational_*.orig.tar.gz* /tmp
	cd /tmp; tar -xf relational_*.orig.tar.gz
	cp -r debian /tmp/relational/
	cd /tmp/relational/; dpkg-buildpackage --changes-option=-S
	mkdir deb-pkg
	mv /tmp/relational* /tmp/python3-relational_*.deb deb-pkg
	$(RM) -r /tmp/relational
	lintian --pedantic -E --color auto -i -I deb-pkg/*changes

.PHONY: dist
dist: clean
	$(RM) -r /tmp/relational/
	$(RM) -r /tmp/relational-*
	mkdir /tmp/relational/
	cp -R * /tmp/relational/
	$(RM) -r /tmp/relational/windows
	$(RM) -r /tmp/relational/debian/

	#mv /tmp/relational /tmp/relational-`head -1 CHANGELOG`
	#(cd /tmp; tar -zcf relational.tar.gz relational-*/)
	(cd /tmp; tar -zcf relational.tar.gz relational/)
	mv /tmp/relational.tar.gz ./relational_`head -1 CHANGELOG`.orig.tar.gz
	gpg --sign --armor --detach-sign ./relational_`head -1 CHANGELOG`.orig.tar.gz

.PHONY: clean
clean:
	$(RM) -r deb-pkg
	$(RM) -r `find -name "*~"`
	$(RM) -r `find -name "*pyc"`
	$(RM) -r `find -name "*pyo"`
	$(RM) -r relational*.tar.gz
	$(RM) -r relational*.tar.gz.asc
	$(RM) -r data
	$(RM) -r *tar.bz
	$(RM) -r *.deb
	$(RM) relational_gui/survey.py
	$(RM) relational_gui/maingui.py
	$(RM) relational_gui/rel_edit.py
	$(RM) po/*.mo
	$(RM) -r build
	$(RM) -r *.egg-info

.PHONY: install-relational-cli
install-relational-cli:
	python3 setup/relational-cli.setup.py install --root=$${DESTDIR:-/};
	$(RM) -r build;
	install -D relational.py $${DESTDIR:-/}/usr/bin/relational-cli
	install -D relational-cli.1 $${DESTDIR:-/}/usr/share/man/man1/relational-cli.1

.PHONY: install-python3-relational
install-python3-relational: install_translations
	python3 setup/python3-relational.setup.py install --root=$${DESTDIR:-/};
	$(RM) -r build;

.PHONY: install-relational
install-relational:
	python3 setup/relational.setup.py install --root=$${DESTDIR:-/};
	$(RM) -r build;
	install -D relational.py $${DESTDIR:-/}/usr/bin/relational
	install -m0644 -D relational.desktop $${DESTDIR:-/}/usr/share/applications/relational.desktop
	install -m0644 -D relational_gui/resources/relational.png $${DESTDIR:-/}/usr/share/pixmaps/relational.png
	install -D relational.1 $${DESTDIR:-/}/usr/share/man/man1/relational.1

.PHONY: install
install: install-relational-cli install-python3-relational install-relational

po/messages.pot: relational.py relational/*.py relational_readline/*.py relational_gui/*.py
	xgettext --from-code=utf-8 -L Python -j -o po/messages.pot --package-name=relational \
		relational.py \
		relational_readline/*.py \
		relational_gui/*.py \
		relational/*.py

po/it.po: po/messages.pot
	msgmerge --update $@ po/messages.pot

po/it.mo: po/it.po
	msgfmt po/it.po --output-file $@

.PHONY: translations
translations: po/it.mo

.PHONY: install_translations
install_translations:
	install -m644 -D po/it.mo $${DESTDIR:-/}/usr/share/locale/it/LC_MESSAGES/relational.mo