1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/Makefile

336 lines
9.3 KiB
Makefile
Raw Normal View History

2011-03-12 03:39:59 +01:00
2013-02-09 03:40:54 +01:00
# $Id: Makefile,v 1.114 2013/01/29 00:26:51 gilles Exp gilles $
2011-03-12 03:39:59 +01:00
.PHONY: help usage all
help: usage
usage:
2011-03-12 03:44:57 +01:00
@echo " imapsync $(VERSION), You can do :"
2011-03-12 03:44:47 +01:00
@echo "make install # as root"
@echo "make testf # run tests"
@echo "make testv # run tests verbosely"
2011-06-14 13:02:33 +02:00
@echo "make test_quick # few tests verbosely"
2011-03-12 03:44:51 +01:00
@echo "make test3xx # run tests with (last) Mail-IMAPClient-3.xy"
2011-03-12 03:44:47 +01:00
@echo "make test229 # run tests with Mail-IMAPClient-2.2.9"
2011-03-12 03:45:04 +01:00
@echo "make tests_win32 # run tests on win32"
2011-03-12 03:45:06 +01:00
@echo "make tests_win32_dev # run test2.bat on win32"
2011-03-12 03:44:47 +01:00
@echo "make all "
2011-03-12 03:44:59 +01:00
@echo "make upload_index"
2011-09-25 22:31:48 +02:00
@echo "make upload_ks"
2011-03-12 03:45:00 +01:00
@echo "make imapsync.exe"
2011-03-12 03:45:04 +01:00
@echo "make imapsync_elf_x86.bin"
2012-04-17 00:26:18 +02:00
@echo "make publish"
2011-03-12 03:45:00 +01:00
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
DIST_NAME=imapsync-$(VERSION)
DIST_FILE=$(DIST_NAME).tgz
DEB_FILE=$(DIST_NAME).deb
2012-04-17 00:26:18 +02:00
VERSION=$(shell perl -I$(IMAPClient) ./imapsync --version)
2011-06-14 13:04:24 +02:00
VERSION_EXE=$(shell cat ./VERSION_EXE)
HELLO=$(shell date;uname -a)
2012-09-03 02:08:57 +02:00
IMAPClient_2xx=./W/Mail-IMAPClient-2.2.9
2012-09-12 03:50:53 +02:00
IMAPClient_3xx=./W/Mail-IMAPClient-3.32/lib
2012-04-17 00:26:18 +02:00
IMAPClient=$(IMAPClient_3xx)
2011-06-14 13:04:24 +02:00
hello:
2012-04-17 00:26:18 +02:00
echo "$(VERSION)"
echo "$(IMAPClient)"
2011-03-12 03:44:57 +01:00
2012-04-17 00:30:19 +02:00
all: ChangeLog README VERSION imapsync_elf_x86.bin imapsync.exe
2011-03-12 03:39:59 +01:00
testp :
2011-03-12 03:44:57 +01:00
perl -c imapsync
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
ChangeLog: imapsync
rlog imapsync > ChangeLog
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
README: imapsync
perldoc -t imapsync > README
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:02 +01:00
VERSION: imapsync
2012-09-03 02:08:57 +02:00
perl -I./$(IMAPClient) ./imapsync --version > ./VERSION
touch -r ./imapsync ./VERSION
2011-03-12 03:40:54 +01:00
2011-03-12 03:45:02 +01:00
2011-03-12 03:39:59 +01:00
.PHONY: clean clean_tilde clean_test
2011-03-12 03:44:47 +01:00
clean: clean_tilde clean_man
2011-03-12 03:39:59 +01:00
clean_test:
2011-06-14 13:04:24 +02:00
rm -f .test_3xx .test_229
2011-03-12 03:39:59 +01:00
clean_tilde:
rm -f *~
2011-03-12 03:44:29 +01:00
.PHONY: install dist man
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
man: imapsync.1
2011-03-12 03:44:29 +01:00
clean_man:
2011-03-12 03:44:57 +01:00
rm -f imapsync.1
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:57 +01:00
imapsync.1: imapsync
pod2man imapsync > imapsync.1
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:57 +01:00
install: testp imapsync.1
2011-03-12 03:45:06 +01:00
mkdir -p $(DESTDIR)/usr/bin
2011-03-12 03:45:04 +01:00
install imapsync $(DESTDIR)/usr/bin/imapsync
2011-03-12 03:44:57 +01:00
chmod 755 $(DESTDIR)/usr/bin/imapsync
2011-03-12 03:45:06 +01:00
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
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:06 +01:00
.PHONY: cidone ci
2011-03-12 03:44:29 +01:00
2011-03-12 03:45:06 +01:00
ci: cidone
2011-03-12 03:39:59 +01:00
cidone:
2012-09-03 02:08:57 +02:00
rcsdiff RCS/*
cd W && rcsdiff RCS/*
cd examples && rcsdiff RCS/*
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:04 +01:00
###############
2011-03-12 03:39:59 +01:00
# Local goals
2011-03-12 03:45:04 +01:00
###############
2012-04-17 00:26:18 +02:00
.PHONY: test tests testp testf test3xx testv2 testv3
2011-03-12 03:45:04 +01:00
2011-06-14 13:02:33 +02:00
test_quick : test_quick_3xx test_quick_229
2011-03-12 03:45:04 +01:00
test_quick_229: imapsync tests.sh
2012-04-17 00:26:18 +02:00
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh -x tests.sh locallocal
2011-03-12 03:45:04 +01:00
test_quick_3xx: imapsync tests.sh
2012-04-17 00:26:18 +02:00
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh -x tests.sh locallocal
2011-03-12 03:45:04 +01:00
2012-12-29 01:43:39 +01:00
testv2: imapsync tests.sh
2012-11-27 23:32:36 +01:00
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh tests.sh
2011-06-14 13:04:24 +02:00
touch .test_229
2011-06-14 12:59:46 +02:00
2012-12-29 01:43:39 +01:00
testv3: imapsync tests.sh
2012-11-27 23:32:36 +01:00
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh
2012-04-17 00:26:18 +02:00
touch .test_3xx
2011-03-12 03:45:04 +01:00
2013-02-09 03:40:54 +01:00
testv: testv3
2012-11-27 23:32:36 +01:00
2013-02-09 03:40:54 +01:00
test: .test_3xx
2011-03-12 03:45:04 +01:00
tests: test
test3xx: .test_3xx
test229: .test_229
.test_229: imapsync tests.sh
2012-04-17 00:26:18 +02:00
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh tests.sh 1>/dev/null
2011-03-12 03:45:04 +01:00
touch .test_229
.test_3xx: imapsync tests.sh
2012-04-17 00:26:18 +02:00
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh 1>/dev/null
2011-03-12 03:45:04 +01:00
touch .test_3xx
testf: clean_test test
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:04 +01:00
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone
2011-03-12 03:44:57 +01:00
2012-12-29 01:43:39 +01:00
.dosify_bat: W/*.bat examples/*.bat
unix2dos W/*.bat examples/*.bat
2011-03-12 03:45:00 +01:00
touch .dosify_bat
dosify_bat: .dosify_bat
2011-03-12 03:45:02 +01:00
copy_win32:
scp imapsync Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
tests_win32: dosify_bat
2012-09-03 02:08:57 +02:00
scp imapsync W/test.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:04 +01:00
# 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'
2011-03-12 03:45:02 +01:00
# ssh Admin@c 'tasklist /FI "PID eq 0"'
# ssh Admin@c 'tasklist /NH /FO CSV'
2011-03-12 03:45:06 +01:00
tests_win32_dev: dosify_bat
2012-09-03 02:08:57 +02:00
scp imapsync examples/file.txt W/test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:06 +01:00
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
2011-03-12 03:45:00 +01:00
test_imapsync_exe: dosify_bat
2012-09-03 02:08:57 +02:00
scp W/test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:00 +01:00
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
2011-03-12 03:45:04 +01:00
2012-09-03 02:08:57 +02:00
imapsync.exe: imapsync W/build_exe.bat .dosify_bat
2011-03-12 03:45:04 +01:00
rcsdiff imapsync
ssh Admin@c 'perl -V'
2012-09-03 02:08:57 +02:00
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
scp imapsync W/build_exe.bat W/test_exe.bat \
2011-03-12 03:45:00 +01:00
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:04 +01:00
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'
2011-03-12 03:45:00 +01:00
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
2012-09-03 02:08:57 +02:00
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) >> W/.BUILD_EXE_TIME
2011-03-12 03:45:02 +01:00
2011-03-12 03:44:29 +01:00
2011-03-12 03:45:04 +01:00
# vadrouille or petite
imapsync_elf_x86.bin: imapsync
rcsdiff imapsync
{ test 'vadrouille' = "`hostname`" && \
2012-04-17 00:26:18 +02:00
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
2011-03-12 03:45:04 +01:00
-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`" && \
2012-04-17 00:26:18 +02:00
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
2012-09-03 02:08:57 +02:00
-I W/NTLM-1.09/blib/lib \
2011-03-12 03:45:04 +01:00
-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 \
2012-04-17 00:26:18 +02:00
-a '/usr/lib/perl/5.10.1/auto/POSIX/SigAction;auto/POSIX/SigAction' \
2011-03-12 03:45:04 +01:00
imapsync ; \
} || :
{ test 'ks200821.kimsufi.com' = "`hostname`" && \
2012-04-17 00:26:18 +02:00
pp -o imapsync_elf_x86.bin -I $(IMAPClient_3xx) \
2011-03-12 03:45:04 +01:00
-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
2012-12-29 01:43:39 +01:00
tarball: .tarball
.tarball: imapsync
2011-03-12 03:45:04 +01:00
echo making tarball $(DIST_FILE)
2012-12-29 01:43:39 +01:00
rcsdiff RCS/*
cd W && rcsdiff RCS/*
cd examples && rcsdiff RCS/*
2011-03-12 03:45:04 +01:00
mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME)
2011-06-14 12:59:46 +02:00
rsync -aCv --delete --omit-dir-times --exclude dist/ --exclude imapsync.exe ./ ../prepa_dist/$(DIST_NAME)/
#rsync -av ./imapsync.exe ../prepa_dist/$(DIST_NAME)/
2011-03-12 03:45:04 +01:00
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)
2012-12-29 01:43:39 +01:00
touch .tarball
2011-03-12 03:45:04 +01:00
2011-06-14 13:04:24 +02:00
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)
2012-11-27 23:32:36 +01:00
dist: cidone test clean all INSTALL dist_prepa dist_prepa_exe
2011-06-14 13:04:24 +02:00
dist_prepa: tarball dist_dir
ln -f ../prepa_dist/$(DIST_FILE) $(DIST_PATH)/
2011-07-11 23:24:12 +02:00
rcsdiff imapsync
cp -a imapsync $(DIST_PATH)/
2011-06-14 13:04:24 +02:00
#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)
2011-09-25 22:31:48 +02:00
cp -a ./imapsync.exe $(DIST_PATH)/
2011-06-14 13:04:24 +02:00
#cd $(DIST_PATH)/ && md5sum ./imapsync.exe > ./imapsync.exe.md5.txt
#cd $(DIST_PATH)/ && md5sum -c ./imapsync.exe.md5.txt
2012-04-17 00:26:18 +02:00
.PHONY: publish upload_ks ks
2011-06-14 13:04:24 +02:00
2011-03-12 03:45:06 +01:00
ks:
2012-09-03 02:08:57 +02:00
rsync -avHz --delete --exclude imapsync.exe \
. imapsync@ks.lamiral.info:public_html/imapsync/
ksa:
2012-11-27 23:32:36 +01:00
rsync -avHz --delete -P \
2011-07-11 23:24:12 +02:00
. imapsync@ks.lamiral.info:public_html/imapsync/
2011-03-12 03:45:04 +01:00
2012-11-27 23:32:36 +01:00
publish: upload_ks ksa ml
2011-04-24 23:19:36 +02:00
2013-02-09 03:40:54 +01:00
PUBLIC_FILES = ./ChangeLog ./COPYING ./LICENSE ./CREDITS ./FAQ \
2012-09-03 02:08:57 +02:00
./index.shtml ./INSTALL \
2012-09-12 03:50:53 +02:00
./VERSION ./VERSION_EXE \
2012-09-03 02:08:57 +02:00
./README ./TODO
PUBLIC_FILES_W = ./W/style.css \
2012-09-12 03:50:53 +02:00
./W/TIME \
2012-09-03 02:08:57 +02:00
./W/paypal.shtml ./W/paypal_return.shtml ./W/paypal_return_support.shtml
PUBLIC_FILES_IMAGES = ./W/images/logo_imapsync.png ./W/images/logo_imapsync_s.png
2012-12-29 01:43:39 +01:00
ml: dist_dir
2012-09-12 03:50:53 +02:00
m4 -P W/ml_announce.in | mutt -H-
mailq
2011-04-24 23:19:36 +02:00
2012-11-27 23:32:36 +01:00
upload_ks: ci dist
2011-07-11 23:24:12 +02:00
rsync -lptvHzP $(PUBLIC_FILES) \
2011-04-24 23:19:36 +02:00
root@ks.lamiral.info:/var/www/imapsync/
2012-09-03 02:08:57 +02:00
rsync -lptvHzP $(PUBLIC_FILES_W) \
root@ks.lamiral.info:/var/www/imapsync/W/
rsync -lptvHzP $(PUBLIC_FILES_IMAGES) \
root@ks.lamiral.info:/var/www/imapsync/W/images/
rsync -lptvHzP ./W/ks.htaccess \
root@ks.lamiral.info:/var/www/imapsync/.htaccess
2011-07-11 23:24:12 +02:00
rsync -lptvHzrP ./dist/ \
2011-04-24 23:19:36 +02:00
root@ks.lamiral.info:/var/www/imapsync/dist/
2012-09-03 02:08:57 +02:00
rsync -lptvHzrP ./examples/ \
root@ks.lamiral.info:/var/www/imapsync/examples/
2011-04-24 23:19:36 +02:00
2011-03-12 03:45:04 +01:00
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/
2012-09-03 02:08:57 +02:00
#rsync -avHz $(PUBLIC_FILES) \
#/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
rsync -lptvHzP ./W/memo glamiral@linux-france.org:imapsync_stats/memo
rsync -lptvHzP ./W/lfo.htaccess \
2011-07-11 23:24:12 +02:00
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/.htaccess
2011-03-12 03:39:59 +01:00
sh ~/memo/lfo-rsync
2013-02-09 03:40:54 +01:00
upload_index: FAQ LICENSE CREDITS W/*.bat examples/*.bat examples/sync_loop_unix.sh index.shtml
rcsdiff index.shtml FAQ LICENSE CREDITS W/*.bat examples/*.bat index.shtml
2012-09-12 03:50:53 +02:00
validate --verbose index.shtml
2013-02-09 03:40:54 +01:00
rsync -avH index.shtml FAQ COPYING LICENSE CREDITS root@ks.lamiral.info:/var/www/imapsync/
2012-12-29 01:43:39 +01:00
rsync -avH W/*.bat root@ks.lamiral.info:/var/www/imapsync/W/
rsync -avH examples/*.bat examples/sync_loop_unix.sh root@ks.lamiral.info:/var/www/imapsync/examples/
2011-04-24 23:19:36 +02:00
niouze_lfo :
2011-03-12 03:45:04 +01:00
echo "CORRECT ME: . ./memo && lfo_announce"
2011-03-12 03:44:32 +01:00
2011-03-12 03:44:50 +01:00
niouze_fm: VERSION
2011-03-12 03:45:02 +01:00
. ./memo && fm_announce
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:50 +01:00
public: niouze_fm