-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
86 lines (67 loc) · 1.89 KB
/
Makefile
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
NAME = IBus-Theme
PACK = IBus Theme Tools
PYPACK = ibus_theme_tools
VERSION = 4.2.0
MSGPOS = $(wildcard $(PYPACK)/locale/*/LC_MESSAGES/*.po)
# for translators: `make mergepo` or `make LANG=YOUR_LANG mergepo`
# The command line passed variable LANG is used to localize pot file.
#
LANGUAGE = $(shell echo $(LANG) | sed -e 's/\..*//')
MSGPOT = locale/$(NAME).pot
MSGDIR = locale/$(LANGUAGE)/LC_MESSAGES
MSGSRC = $(MSGDIR)/$(NAME).po
MSGAIM = $(MSGDIR)/$(NAME).mo
all: _build
clean:
-rm -fR $(MSGPOS:.po=.po~)
-rm -fR dist
-rm -fR build
-rm -fR deb_dist
-rm -fR *.tar.gz
-rm -fR *.pkg.tar.zst
-rm -fR *.pkg
-rm -fR pkg src
-rm -fR bsd/All
-rm -fR bsd/distinfo
-rm -fR bsd/work*
-rm -fR $(PYPACK).egg-info
%.mo: %.po
msgfmt $< -o $@
build: $(MSGPOS:.po=.mo)
install:
python3 setup.py install
$(PYPACK)/$(MSGSRC):
mkdir -p $(MSGDIR); \
msginit --no-translator --locale $(LANGUAGE).UTF-8 -i ./$(MSGPOT) -o ./$(MSGSRC)
potfile:
cd $(PYPACK); \
xgettext -k --keyword=_ --from-code=utf-8 --package-name="$(PACK)" --package-version=$(VERSION) --add-comments='Translators:' --output ./$(MSGPOT) *.py
pofile: $(PYPACK)/$(MSGSRC)
mergepo: potfile pofile
cd $(PYPACK); \
msgmerge -U $(MSGSRC) $(MSGPOT); \
rm -fR $(MSGDIR)/*mo; \
rm -fR $(MSGDIR)/*po~
rpm:
python3 setup.py bdist_rpm
deb:
python3 setup.py --command-packages=stdeb.command sdist_dsc --default-distribution hirsute --copyright-file LICENSE bdist_deb
ppa: deb
cd deb_dist; \
debsign *source.changes; \
dput ibus-theme-tools *source.changes
edigest:
cd portage/app-i18n/ibus-theme-tools; ebuild *.ebuild digest
emerge:
cd portage/app-i18n/ibus-theme-tools; pkexec ebuild `pwd`/*.ebuild merge
guix:
guix package -f guix.scm
pkg:
cd bsd; make makesum; PACKAGES=`pwd` make package; mv All/*.pkg ..
arch:
makepkg --printsrcinfo > .SRCINFO
makepkg
upload:
python3 -m build
python3 -m twine check dist/*
python3 -m twine upload dist/*