forked from Amog-OS/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·77 lines (69 loc) · 2.75 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
DESTDIR=/
XINITRCDIR=/etc/X11/Xsession.d/
all: clean build
build: buildmo
mkdir -p build/lib/ || true
cp -prfv live-installer build/lib/
@if [ -d custom/configs ]; then \
cp -prfv custom/configs build/lib/live-installer/; \
fi
@if [ -d custom/branding ]; then \
rm -rf build/lib/live-installer/branding/slides/; \
cp -prfv custom/branding build/lib/live-installer/; \
fi
chmod +x -R build/lib/
run: build
build/lib/live-installer/main.py
pot:
xgettext -o live-installer.pot --from-code="utf-8" live-installer/resources/*.ui `find live-installer -type f -iname "*.py"`
for file in `ls po/*.po`; do \
msgmerge $$file live-installer.pot -o $$file.new ; \
rm -f $$file ; \
mv $$file.new $$file ; \
done \
buildmo:
mkdir -p build/usr/share/ || true
@echo "Building the mo files"
# WARNING: the second sed below will only works correctly with the languages that don't contain "-"
for file in `ls po/*.po`; do \
lang=`echo $$file | sed 's@po/@@' | sed 's/\.po//' | sed 's/live-installer-//'`; \
install -d build/usr/share/locale/$$lang/LC_MESSAGES/; \
msgfmt -o build/usr/share/locale/$$lang/LC_MESSAGES/live-installer.mo $$file; \
done \
install:
rm -rf $(DESTDIR)/lib/live-installer || true
mkdir -p $(DESTDIR)/lib || true
mkdir -p $(DESTDIR)/usr || true
cp -prfv build/usr/* $(DESTDIR)/usr/
cp -prfv build/lib/* $(DESTDIR)/lib/
mkdir -p $(DESTDIR)/usr/share/applications/ || true
mkdir -p $(DESTDIR)/usr/bin/ || true
mkdir -p $(DESTDIR)/etc/xdg/autostart/
mkdir -p $(DESTDIR)/$(XINITRCDIR) || true
mkdir -p $(DESTDIR)/usr/share/polkit-1/actions/ || true
install data/17g-welcome.desktop $(DESTDIR)/etc/xdg/autostart/
install data/live-installer.desktop $(DESTDIR)/usr/share/applications/live-installer.desktop
install data/00-live $(DESTDIR)/$(XINITRCDIR)/00-live
install data/live-installer.sh $(DESTDIR)/usr/bin/live-installer
install data/org.17g.installer.policy $(DESTDIR)/usr/share/polkit-1/actions/
@if [ -f custom/live-installer.desktop ] ; then \
install custom/live-installer.desktop $(DESTDIR)/usr/share/applications/live-installer.desktop ; \
fi
install-systemd:
mkdir -p $(DESTDIR)/lib/systemd/system/
install 17g.service $(DESTDIR)/lib/systemd/system/
install-openrc:
mkdir -p $(DESTDIR)/lib/init.d/
install 17g.initd $(DESTDIR)/$(DESTDIR)/lib/init.d/17g
uninstall:
rm -rf $(DESTDIR)/lib/live-installer
rm -f $(DESTDIR)/usr/bin/live-installer
rm -f $(DESTDIR)/usr/share/applications/live-installer.desktop
rm -f $(DESTDIR)/$(XINITRCDIR)/00-live
rm -f $(DESTDIR)/usr/share/polkit-1/actions/org.17g.installer.policy
rm -f $(DESTDIR)/etc/xdg/autostart/17g-welcome.desktop
clean:
rm -rf build
find po/ | grep "*.mo" | xargs rm -f
rm -rf live-installer/__pycache__
rm -rf live-installer/frontend/__pycache__