-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (46 loc) · 2 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
NAME=om-welcome
VERSION=2.4.7
TRANSLATIONS=ca de fi fr id it pl pt_BR pt_PT ru sr tr uk uk_UA
bindir=/usr/bin
sysconfdir=/etc
sharedir=/usr/share
localedir=$(sharedir)/locale
all:
messages: usr/share/om-welcome/translation
xgettext -d om-welcome -o usr/share/om-welcome/om-welcome.pot -L Shell --from-code utf-8 usr/share/om-welcome/translation
for i in $(TRANSLATIONS); do \
msgmerge -U po/$$i.po usr/share/om-welcome/om-welcome.pot; \
done
install: messages
mkdir -p $(DESTDIR)$(prefix)/$(bindir)
mkdir -p $(DESTDIR)$(prefix)/$(sysconfdir)/xdg/autostart
mkdir -p $(DESTDIR)$(prefix)/$(sharedir)/$(NAME)
mkdir -p $(DESTDIR)$(prefix)/$(sharedir)/applications
mkdir -p $(DESTDIR)$(prefix)/$(localedir)
install -m 644 om-welcome.desktop $(DESTDIR)$(prefix)/$(sysconfdir)/xdg/autostart
install -m 644 etc/skel/om-welcome.desktop $(DESTDIR)$(prefix)/$(sharedir)/applications
install -m 755 usr/bin/* $(DESTDIR)$(prefix)/$(bindir)
cp -avx usr/share/$(NAME)/* $(DESTDIR)$(prefix)/$(sharedir)/$(NAME)
chmod -R 755 $(DESTDIR)$(prefix)/$(sharedir)/$(NAME)
@for l in $(TRANSLATIONS); do \
mkdir -p $(DESTDIR)$(prefix)/$(localedir)/$$l/LC_MESSAGES; \
msgcat po/$$l.po | msgfmt -o $(DESTDIR)$(prefix)$(localedir)/$$l/LC_MESSAGES/om-welcome.mo - ; \
done
dist:
git archive --format=tar --prefix=$(NAME)-$(VERSION)/ HEAD | xz -2vec -T0 > $(NAME)-$(VERSION).tar.xz;
$(info $(NAME)-$(VERSION).tar.xz is ready)
# FIXME this shouldn't be necessary, there must be some way to convince
# transifex to send the right headers...
fix-translations:
for i in po/*.po; do \
if ! grep -q '"Content-Transfer-Encoding:' $$i; then \
sed -i -e '/^"Language-Team/a"Content-Transfer-Encoding: 8bit\\n"' $$i; \
fi; \
if ! grep -q '"Content-Type:' $$i; then \
sed -i -e '/^"Language-Team/a"Content-Type: text/plain; charset=UTF-8\\n"' $$i; \
fi; \
if ! grep -q '"MIME-Version:' $$i; then \
sed -i -e '/^"Language-Team/a"MIME-Version: 1.0\\n"' $$i; \
fi; \
done
sed -i -e 's/nplurals=3.*/nplurals=2; plural=(n > 1);\\n"/' po/it.po