-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
235 lines (207 loc) · 5.97 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# rm -f .bash* .profile && git clone https://github.com/df7cb/dotfiles.git . && make && . .bashrc
DCLEAN = bin/dbuild bin/dconfigure bin/dinstall bin/dbinary bin/dpatch_ bin/dunpatch
QUILT = bin/qadd bin/qapplied bin/qdelete bin/qdiff bin/qedit bin/qimport bin/qnew bin/qpop bin/qpush bin/qrefresh bin/qtop
all: cleanup .less .xinitrc bin/ctar .priv $(DCLEAN) $(QUILT) .ssh/config tmp
## targets ##
.less: .lesskey
lesskey
.ssh/config:
ln -s config.public $@
.xinitrc:
ln -s .xsession .xinitrc
bin/ctar:
ln -s ttar bin/ctar
$(DCLEAN):
ln -s dclean $@
$(QUILT):
ln -s qwrapper $@
.PHONY: .priv
.priv:
@if [ -f .priv/Makefile ]; then $(MAKE) -C .priv ; fi
tmp /tmp/$(USER):
mkdir -m 0700 $@
install-profile:
sudo cp .profile /etc/profile.d/myon-profile.sh
deploy-profile:
test "$(HOST)"
ssh $(HOST) sudo tee /etc/profile.d/myon-profile.sh < .profile
/etc/apt/preferences.d/debian.pref: lib/debian.pref
sudo cp $< $@
install-dev: install-profile /etc/apt/preferences.d/debian.pref
if [ ! -x /usr/bin/sudo ] && [ $$(id -u) = 0 ]; then apt-get install sudo; fi
test -e /etc/dpkg/dpkg.cfg.d/01unsafeio || echo force-unsafe-io | sudo tee /etc/dpkg/dpkg.cfg.d/01unsafeio
test -e /etc/apt/apt.conf.d/20norecommends || echo 'APT::Install-Recommends "false";' | sudo tee /etc/apt/apt.conf.d/20norecommends
test -e /etc/apt/apt.conf.d/50i18n || echo 'Acquire::Languages { "en"; };' | sudo tee /etc/apt/apt.conf.d/50i18n
test -e /etc/apt/apt.conf.d/90keep-downloaded-packages || echo 'Binary::apt::APT::Keep-Downloaded-Packages "1";' | sudo tee /etc/apt/apt.conf.d/90keep-downloaded-packages
sudo rm -f /var/lib/apt/lists/*_Translation-de* \
/etc/apt/apt.conf.d/50appstream \
/etc/apt/apt.conf.d/60icons
sudo apt-get install \
autodep8 \
autopkgtest \
blhc \
build-essential \
ccache \
curl \
debhelper \
devscripts \
diffstat \
dput \
eatmydata \
etckeeper \
exuberant-ctags \
fakeroot \
git \
git-buildpackage \
jq \
less \
libwww-perl \
lintian \
locales \
newpid \
patchutils \
pkgconf \
pristine-lfs \
pristine-tar \
psmisc \
openssh-client \
quilt \
rsync \
strace \
systemd-coredump \
tig \
tree \
vim \
vim-gitgutter \
w3m \
wdiff \
wget
if ! grep -q '^de_DE.UTF-8 UTF-8' /etc/locale.gen; then \
echo 'de_DE.UTF-8 UTF-8' | sudo tee -a /etc/locale.gen; \
sudo locale-gen; \
fi
if ! sudo grep -q '^%sudo.*NOPASSWD' /etc/sudoers; then \
sudo sed -i -e 's/^%sudo.*/%sudo ALL = NOPASSWD: ALL/' /etc/sudoers; \
fi
test -e /etc/postgresql-common/createcluster.d/myon.conf || \
{ sudo mkdir -p /etc/postgresql-common/createcluster.d/ ; \
echo "create_main_cluster = false" | sudo tee /etc/postgresql-common/createcluster.d/myon.conf ; }
sudo update-alternatives --set editor /usr/bin/vim.basic
/etc/default/keyboard: lib/default.keyboard
sudo cp $< $@
install-desktop: install-dev /etc/default/keyboard
sudo apt-get install \
arandr \
awesome \
bind9-dnsutils \
chromium \
diodon \
fdpowermon \
finger \
firefox \
fonts-dejavu \
gnome-keyring \
gpg-agent \
imagemagick \
libsecret-tools \
manpages-dev \
mtr-tiny \
mutt \
ncdu \
net-tools \
network-manager-gnome \
pass \
pasystray \
pavucontrol \
pinfo \
postfix \
pspg \
pulseaudio-utils \
pwgen \
python3-icalendar \
rxvt-unicode \
sbuild \
scdaemon \
screen \
schroot \
udiskie \
vim \
whois \
workrave \
xscreensaver \
--
if grep -q '99:battery-charging.png$$' /etc/fdpowermon/theme.cfg; then \
sudo sed -i -e 's/99:battery-charging.png$$/100:battery-charging.png/' /etc/fdpowermon/theme.cfg; \
fi
if ! grep -q '^/run/user' /etc/schroot/default/fstab; then \
sudo sh -c 'echo "/run/user /run/user none rw,rbind 0 0" >> /etc/schroot/default/fstab'; \
fi
sudo update-alternatives --set x-terminal-emulator /usr/bin/urxvt
sudo update-alternatives --set x-www-browser /usr/bin/firefox
install-chroot:
sudo apt-get install \
ssmtp
sudo sed -i -e 's/^#\(FromLineOverride\)/\1/' -e 's/^mailhub=.*/mailhub=localhost/' /etc/ssmtp/ssmtp.conf
sudo sed -i -e 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers
deploy:
test "$(HOST)"
ssh "$(HOST)" "test ! -d .git && \
rm -f .bash* .profile && \
if ! [ -x /usr/bin/git ] || ! [ -x /usr/bin/make ]; then \
sudo apt-get update && \
sudo apt-get install --no-install-recommends -y git make; \
fi && \
if [ -f /etc/ssl/ca-global/ca-certificates.crt ]; then \
export GIT_SSL_CAINFO=/etc/ssl/ca-global/ca-certificates.crt; \
fi && \
git init && \
git remote add origin https://github.com/df7cb/dotfiles.git && \
git fetch origin && \
git checkout master && \
make"
scp:
test "$(HOST)"
ssh "$(HOST)" mkdir -p bin lib
scp \
.bash_bind \
.bash_profile \
.bashrc \
.env \
.profile \
$(HOST):
vim: .vim/spell/de.utf-8.spl .vim/spell/all.utf-8.add
.vim/spell/de.utf-8.spl:
mkdir -p .vim/spell
cd .vim/spell && wget http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl
.vim/spell/all.utf-8.add:
mkdir -p .vim/spell
touch $@
cd .vim/spell && vim -c ":mkspell! all.utf-8.add.spl all.utf-8.add" -c ":q"
reset
## cleanup stuff ##
cleanup:
@[ "$(shell stat -c %a .gnupg)" = 700 ] || chmod --changes 700 .gnupg
## update stuff ##
up: update
update: cleanup
@gpg -k 5C48FE6157F49179597087C64C5A6BAB12D2A7AE > /dev/null || gpg --import .plan
@if grep -q ChristophBerg .git/config; then sed -i -e 's/ChristophBerg/df7cb/g' .git/config; fi
git fetch --tags --force
case $$(git describe --always --contains master) in signed-head~*) $(MAKE) checkout ;; esac
@if [ -d .priv ] ; then $(MAKE) -C .priv update ; fi
@MAKEFLAGS= MAKELEVEL= make all
checkout:
git verify-tag --raw signed-head 2>&1 | grep 'VALIDSIG 5C48FE6157F49179597087C64C5A6BAB12D2A7AE'
git merge --ff-only signed-head
push:
-git tag -d signed-head
git tag -s -m "HEAD" signed-head
git push
git push --tags --force
com: commit
commit: cleanup
@if [ -d .priv ] ; then $(MAKE) -C .priv commit ; fi
ci:
$(MAKE) update
$(MAKE) commit
$(MAKE) -C lib