forked from imapsync/imapsync
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
300 lines (222 loc) · 8.32 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# $Id: Makefile,v 1.94 2012/04/15 19:19:14 gilles Exp gilles $
.PHONY: help usage all
help: usage
usage:
@echo " imapsync $(VERSION), You can do :"
@echo "make install # as root"
@echo "make testf # run tests"
@echo "make testv # run tests verbosely"
@echo "make test_quick # few tests verbosely"
@echo "make test3xx # run tests with (last) Mail-IMAPClient-3.xy"
@echo "make test229 # run tests with Mail-IMAPClient-2.2.9"
@echo "make tests_win32 # run tests on win32"
@echo "make tests_win32_dev # run test2.bat on win32"
@echo "make all "
@echo "make upload_index"
@echo "make upload_ks"
@echo "make imapsync.exe"
@echo "make imapsync_elf_x86.bin"
@echo "make publish"
DIST_NAME=imapsync-$(VERSION)
DIST_FILE=$(DIST_NAME).tgz
DEB_FILE=$(DIST_NAME).deb
VERSION=$(shell perl -I$(IMAPClient) ./imapsync --version)
VERSION_EXE=$(shell cat ./VERSION_EXE)
HELLO=$(shell date;uname -a)
IMAPClient_2xx=./Mail-IMAPClient-2.2.9
IMAPClient_3xx=./Mail-IMAPClient-3.31/lib
IMAPClient=$(IMAPClient_3xx)
hello:
echo "$(VERSION)"
echo "$(IMAPClient)"
all: ChangeLog README VERSION imapsync_elf_x86.bin imapsync.exe
testp :
perl -c imapsync
ChangeLog: imapsync
rlog imapsync > ChangeLog
README: imapsync
perldoc -t imapsync > README
VERSION: imapsync
perl -I./$(IMAPClient) ./imapsync --version > VERSION
.PHONY: clean clean_tilde clean_test
clean: clean_tilde clean_man
clean_test:
rm -f .test_3xx .test_229
clean_tilde:
rm -f *~
.PHONY: install dist man
man: imapsync.1
clean_man:
rm -f imapsync.1
imapsync.1: imapsync
pod2man imapsync > imapsync.1
install: testp imapsync.1
mkdir -p $(DESTDIR)/usr/bin
install imapsync $(DESTDIR)/usr/bin/imapsync
chmod 755 $(DESTDIR)/usr/bin/imapsync
mkdir -p $(DESTDIR)/usr/share/man/man1
install imapsync.1 $(DESTDIR)/usr/share/man/man1/imapsync.1
chmod 644 $(DESTDIR)/usr/share/man/man1/imapsync.1
.PHONY: cidone ci
ci: cidone
cidone:
rcsdiff RCS/*
###############
# Local goals
###############
.PHONY: test tests testp testf test3xx testv2 testv3
test_quick : test_quick_3xx test_quick_229
test_quick_229: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh -x tests.sh locallocal
test_quick_3xx: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh -x tests.sh locallocal
testv2: .test_229
CMD_PERL='perl -I./$(IMAPClient_2xx) /usr/bin/time sh tests.sh
touch .test_229
testv3:.test_3xx
CMD_PERL='perl -I./$(IMAPClient_3xx)' sh -x tests.sh
touch .test_3xx
test: .test_229 .test_3xx
tests: test
test3xx: .test_3xx
test229: .test_229
.test_229: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_229
.test_3xx: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_3xx
testf: clean_test test
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone
.dosify_bat: build_exe.bat test_exe.bat test.bat test2.bat imapsync_example.bat.txt
unix2dos build_exe.bat test.bat test_exe.bat test2.bat imapsync_example.bat.txt
touch .dosify_bat
dosify_bat: .dosify_bat
copy_win32:
scp imapsync Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
tests_win32: dosify_bat
scp imapsync test.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
# ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests_debug'
ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
# ssh Admin@c 'tasklist /FI "PID eq 0"'
# ssh Admin@c 'tasklist /NH /FO CSV'
tests_win32_dev: dosify_bat
scp imapsync file.txt test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
test_imapsync_exe: dosify_bat
scp test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
imapsync.exe: imapsync build_exe.bat .dosify_bat
rcsdiff imapsync
ssh Admin@c 'perl -V'
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
scp imapsync build_exe.bat test_exe.bat \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/imapsync.exe --version' > VERSION_EXE
dos2unix VERSION_EXE
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
# vadrouille or petite
imapsync_elf_x86.bin: imapsync
rcsdiff imapsync
{ test 'vadrouille' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
imapsync ; \
} || :
{ test 'petite' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
-I NTLM-1.09/blib/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
-M Tie::Hash::NamedCapture \
-a '/usr/lib/perl/5.10.1/auto/POSIX/SigAction;auto/POSIX/SigAction' \
imapsync ; \
} || :
{ test 'ks200821.kimsufi.com' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
-M Tie::Hash::NamedCapture \
-a '/usr/lib/perl/5.10.1/auto/POSIX/SigAction;auto/POSIX/SigAction' \
imapsync ; \
} || :
./imapsync_elf_x86.bin
lfo: cidone niouze_lfo upload_lfo
dist: cidone test clean all INSTALL dist_prepa dist_prepa_exe
tarball: cidone all
echo making tarball $(DIST_FILE)
mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME)
rsync -aCv --delete --omit-dir-times --exclude dist/ --exclude imapsync.exe ./ ../prepa_dist/$(DIST_NAME)/
#rsync -av ./imapsync.exe ../prepa_dist/$(DIST_NAME)/
cd ../prepa_dist && (tar czfv $(DIST_FILE) $(DIST_NAME) || tar czfv $(DIST_FILE) $(DIST_NAME))
#ln -f ../prepa_dist/$(DIST_FILE) dist/
cd ../prepa_dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt
cd ../prepa_dist && md5sum -c $(DIST_FILE).md5.txt
ls -l ../prepa_dist/$(DIST_FILE)
DO_IT := $(shell test -f ./dist/path_$(VERSION).txt || makepasswd --chars 4 > ./dist/path_$(VERSION).txt)
DIST_SECRET := $(shell cat ./dist/path_$(VERSION).txt)
DIST_PATH := ./dist/$(DIST_SECRET)
lalala:
echo $(DIST_SECRET)
dist_prepa: tarball dist_dir
ln -f ../prepa_dist/$(DIST_FILE) $(DIST_PATH)/
rcsdiff imapsync
cp -a imapsync $(DIST_PATH)/
#cd $(DIST_PATH)/ && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt
#cd $(DIST_PATH)/ && md5sum -c $(DIST_FILE).md5.txt
ls -l $(DIST_PATH)/
dist_dir:
@echo $(DIST_SECRET)
@echo $(DIST_PATH)
mkdir -p $(DIST_PATH)
ln -f ./dist/path_$(VERSION).txt ./dist/path_last.txt
dist_prepa_exe: imapsync.exe
mkdir -p $(DIST_PATH)
cp -a ./imapsync.exe $(DIST_PATH)/
#cd $(DIST_PATH)/ && md5sum ./imapsync.exe > ./imapsync.exe.md5.txt
#cd $(DIST_PATH)/ && md5sum -c ./imapsync.exe.md5.txt
.PHONY: publish upload_ks ks
ks:
rsync -avz --delete --exclude imapsync.exe \
. imapsync@ks.lamiral.info:public_html/imapsync/
publish: upload_ks ks
PUBLIC_FILES = ./ChangeLog ./COPYING ./CREDITS ./FAQ \
./index.shtml ./INSTALL ./TIME \
./logo_imapsync.png ./logo_imapsync_s.png \
./paypal.shtml ./paypal_return.shtml ./paypal_return_support.shtml \
./README ./style.css ./TODO ./VERSION ./VERSION_EXE ./memo ./file.txt \
./imapsync_example.bat.txt
upload_ks:
rsync -lptvHzP $(PUBLIC_FILES) \
root@ks.lamiral.info:/var/www/imapsync/
rsync -lptvHzrP ./dist/ \
root@ks.lamiral.info:/var/www/imapsync/dist/
upload_lfo:
#rm -rf /home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
#rm -rf /home/gilles/public_html/www.linux-france.org/ftp/prj/imapsync/
rsync -avHz $(PUBLIC_FILES) \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
rsync -lptvHzP ./lfo.htaccess \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/.htaccess
sh ~/memo/lfo-rsync
upload_index: index.shtml FAQ
validate --verbose index.shtml
rcsdiff index.shtml
rsync -avH index.shtml FAQ root@ks.lamiral.info:/var/www/imapsync/
rsync -avH index.shtml FAQ \
../../public_html/www.linux-france.org/html/prj/imapsync/
sh $(HOME)/memo/lfo-rsync
niouze_lfo :
echo "CORRECT ME: . ./memo && lfo_announce"
niouze_fm: VERSION
. ./memo && fm_announce
public: niouze_fm