-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
138 lines (101 loc) · 2.69 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
SHELL = /bin/bash
ifeq ($(shell stat -c %i /),2)
$(info )
$(info WARNING! non-chroot filesytem! ***)
endif
DQUERY = dpkg-query -Wf '$${Package}\n'
DSQUERY = dpkg-query -Wf '$${Installed-Size}\t$${Package}\n'
PURGE = apt-get autoremove --purge $(o)
XPURGE = xargs $(PURGE)
NL = \
"cjk|chinese|japanese|korean|tibet\
|arabic|ethiopia|sinhala|punjabi\
|myanmar|khmer|lao|thai"
o = --yes
default:
@echo
@echo "usages:"
@echo
@echo " make customize o=--yes # (main goal)"
@echo " make [target] [o=--yes] # (default is o=--dry-run)"
@echo " make -f Makefile.add [universe|pkgs]"
@echo
@echo "targets:"
@echo
@grep "^[^[:space:]].*:" ./Makefile |\
sed -e "s/^/ /g" -e "s/:.*$$//g" | column
@echo
query:
@$(DQUERY)
size-query:
@${DSQUERY} | sort -n
purge:
@$(PURGE)
findmnt:
@findmnt -ln -o TARGET,SOURCE |\
sed -e "s/\[.*remaster/[..\/remaster/g"
no-game:
@dpkg -l | grep game | tr -s " " | cut -f2 -d\ | ${XPURGE}
no-webapp:
@${PURGE} webbrowser-app
no-online-account:
@${DQUERY} | grep account.plugin | $(XPURGE)
scope-home-only:
@${DQUERY} | grep ^unity.scope\- | grep -v home | $(XPURGE)
no-lens-media:
@${DQUERY} | grep ^unity.lens | egrep -v "app|files" | $(XPURGE)
no-thunderbird:
@$(DQUERY) | grep thunderbird | $(XPURGE)
no-scanner:
@${PURGE} simple-scan
no-shotwell:
@$(DQUERY) | grep shotwell | $(XPURGE)
no-totem:
@$(DQUERY) | grep totem | $(XPURGE)
no-rhythmbox:
@$(DQUERY) | grep rhythmbox | $(XPURGE)
no-office:
@$(DQUERY) | grep ^libreoffice | $(XPURGE)
no-mythes:
@${DQUERY} | grep ^mythes | $(XPURGE)
no-remmina:
@$(DQUERY) | grep ^remmina | $(XPURGE)
no-bittorrent:
@$(DQUERY) | grep transmission | $(XPURGE)
no-snap:
@$(DQUERY) | grep snap | $(XPURGE)
en-only:
@$(DQUERY) | grep ^language.pack | grep -v \\-en | $(XPURGE)
ls-fonts:
@dpkg-query -Wf '$${Section}\t$${Package;-32}\t$${Description}\n' |\
grep ^fonts | cut -f2,3
ls-basic-fonts:
@make --quiet ls-fonts | egrep -iv $(NL)
ls-other-fonts:
@make --quiet ls-fonts | egrep -i $(NL) | cat
no-other-fonts:
@make --quiet ls-other-fonts | cut -f1 | $(XPURGE)
no-big-manual:
@$(PURGE) gnome-user-guide ubuntu-docs example-content
no-ime:
@( echo tegaki-zinnia-japanese ;\
echo libfcitx-qt5-1 ;\
$(DQUERY) | grep mozc ) |\
$(XPURGE)
no-fcitx:
@${DQUERY} | grep ^fcitx | $(XPURGE)
firefox-en-only:
@${DQUERY} | grep firefox\-locale | $(XPURGE)
all-no-only-all:
@egrep "^no|only:$$" ./Makefile | tr -d ":"
smaller:
make --quiet all-no-only-all | xargs make --quiet o=$(o)
additions:
make -f Makefile.add pkgs
install-custom:
rm -rf /opt/custom
rsync -av ./custom /opt/
sudoers:
cp ./sudoers.d/custom /etc/sudoers.d/
customize: smaller additions sudoers install-custom
( cd /opt/custom ; make rsync )