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

365 lines
11 KiB
Makefile
Raw Normal View History

2011-03-12 03:39:59 +01:00
2014-02-13 18:34:20 +01:00
# $Id: Makefile,v 1.141 2014/02/13 03:18:50 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"
2014-02-13 18:34:20 +01:00
@echo "make install_dependencies # it installs needed Perl modules from CPAN"
@echo ""
@echo "All other goals are for the upstream developper"
2011-03-12 03:44:47 +01:00
@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"
2013-07-06 00:26:28 +02:00
@echo "make tests_win32 # run --test and W/test.bat on win32"
@echo "make tests_win32_dev # run W/test2.bat on win32"
@echo "make tests_win32_dev3 # run W/test3.bat on win32"
2013-08-04 03:27:37 +02:00
@echo "make .prereq_win32 # run examples/install_modules.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"
2013-07-25 23:42:01 +02:00
@echo "make perlcritic"
2011-03-12 03:45:00 +01:00
2013-05-21 00:04:57 +02:00
PREFIX ?= /usr
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)
2013-12-30 03:03:13 +01:00
IMAPClient_3xx=./W/Mail-IMAPClient-3.35/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
2013-09-26 23:59:52 +02:00
GOOD_PRACTICES.html: GOOD_PRACTICES.t2t
txt2tags -i GOOD_PRACTICES.t2t -t html --toc -o GOOD_PRACTICES.html
2011-03-12 03:45:02 +01:00
2013-09-26 23:59:52 +02:00
TUTORIAL.html: TUTORIAL.t2t
txt2tags -i TUTORIAL.t2t -t html --toc -o TUTORIAL.html
doc: README ChangeLog TUTORIAL.html GOOD_PRACTICES.html
.PHONY: clean clean_tilde clean_test doc
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:47 +01:00
clean: clean_tilde clean_man
2011-03-12 03:39:59 +01:00
clean_test:
2013-04-22 21:50:50 +02:00
rm -f .test_3xx
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
mkdir -p $(DESTDIR)$(PREFIX)/bin
install imapsync $(DESTDIR)$(PREFIX)/bin/imapsync
chmod 755 $(DESTDIR)$(PREFIX)/bin/imapsync
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
install imapsync.1 $(DESTDIR)$(PREFIX)/share/man/man1/imapsync.1
chmod 644 $(DESTDIR)$(PREFIX)/share/man/man1/imapsync.1
2011-03-12 03:39:59 +01:00
2014-02-13 18:34:20 +01:00
install_dependencies:
sh examples/install_modules_linux.sh
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
###############
2013-07-25 23:42:01 +02:00
.PHONY: test tests testp testf test3xx testv3 perlcritic
2013-10-18 02:11:27 +02:00
perlcritic: perlcritic_3.out perlcritic_2.out
2013-07-25 23:42:01 +02:00
perlcritic_1.out: imapsync
perlcritic -1 imapsync > perlcritic_1.out || :
perlcritic_2.out: imapsync
perlcritic -2 imapsync > perlcritic_2.out || :
perlcritic_3.out: imapsync
perlcritic -3 imapsync > perlcritic_3.out || :
2011-03-12 03:45:04 +01:00
2013-04-22 21:50:50 +02:00
test_quick : test_quick_3xx
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
testv3: imapsync tests.sh
2012-11-27 23:32:36 +01:00
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh
2013-12-30 03:03:13 +01:00
./i3 --version >> .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
.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
2013-12-30 03:03:13 +01:00
./i3 --version >> .test_3xx
2011-03-12 03:45:04 +01:00
testf: clean_test test
2011-03-12 03:39:59 +01:00
2013-07-25 23:42:01 +02:00
.PHONY: lfo upload_lfo 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'
2013-07-06 00:26:28 +02:00
tests_win32_dev3: dosify_bat
scp imapsync W/test3.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test3.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'
2013-08-04 03:27:37 +02:00
.prereq_win32: examples/install_modules.bat .dosify_bat
2013-10-18 02:11:27 +02:00
scp examples/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/examples/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/examples/install_modules.bat'
2013-08-04 03:27:37 +02:00
touch .prereq_win32
2011-03-12 03:45:04 +01:00
2013-08-04 03:27:37 +02:00
imapsync.exe: imapsync .prereq_win32
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
2013-07-06 00:26:28 +02:00
scp imapsync 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
2013-07-06 00:26:28 +02:00
exe: imapsync build_exe.bat .dosify_bat
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
scp imapsync build_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/imapsync.exe --modules_version'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
# C:\Users\mansour\Desktop\imapsync
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
2013-07-25 23:42:01 +02:00
lfo: cidone upload_lfo
2011-03-12 03:45:04 +01:00
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)
2013-04-22 21:50:50 +02:00
rsync -aCvH --delete --omit-dir-times --exclude dist/ --exclude imapsync.exe ./ ../prepa_dist/$(DIST_NAME)/
2011-06-14 12:59:46 +02:00
#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
2013-12-30 03:03:13 +01:00
DO_IT := $(shell test -d dist && { test -f ./dist/path_$(VERSION).txt || makepasswd --chars 4 > ./dist/path_$(VERSION).txt ; } )
DIST_SECRET := $(shell test -d dist && cat ./dist/path_$(VERSION).txt)
2011-06-14 13:04:24 +02:00
DIST_PATH := ./dist/$(DIST_SECRET)
lalala:
echo $(DIST_SECRET)
2013-09-26 23:59:52 +02:00
dist: cidone test clean all perlcritic dist_prepa dist_prepa_exe
2012-11-27 23:32:36 +01:00
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 \
2013-12-30 03:03:13 +01:00
. gilles@ks.lamiral.info:public_html/imapsync/
2012-09-03 02:08:57 +02:00
ksa:
2012-11-27 23:32:36 +01:00
rsync -avHz --delete -P \
2013-12-30 03:03:13 +01:00
. gilles@ks.lamiral.info:public_html/imapsync/
2011-03-12 03:45:04 +01:00
2013-08-04 03:27:37 +02:00
upload_ks: ci tarball
rsync -lptvHzP $(PUBLIC_FILES) \
root@ks.lamiral.info:/var/www/imapsync/
rsync -lptvHzP $(PUBLIC_FILES_W) \
root@ks.lamiral.info:/var/www/imapsync/W/
2013-09-26 23:59:52 +02:00
rsync -lptvHzPr $(PUBLIC_FILES_IMAGES) \
2013-08-04 03:27:37 +02:00
root@ks.lamiral.info:/var/www/imapsync/W/images/
rsync -lptvHzP ./W/ks.htaccess \
root@ks.lamiral.info:/var/www/imapsync/.htaccess
2013-09-26 23:59:52 +02:00
rsync -lptvHzPr ./dist/ \
2013-08-04 03:27:37 +02:00
root@ks.lamiral.info:/var/www/imapsync/dist/
2013-09-26 23:59:52 +02:00
rsync -lptvHzPr ./examples/ \
2013-08-04 03:27:37 +02:00
root@ks.lamiral.info:/var/www/imapsync/examples/
2013-09-26 23:59:52 +02:00
publish: dist upload_ks ksa
2013-08-04 03:27:37 +02:00
echo Now ou can do make ml
2011-04-24 23:19:36 +02:00
2013-04-22 21:50:50 +02:00
PUBLIC_FILES = ./ChangeLog ./NOLIMIT ./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 \
2013-10-18 02:11:27 +02:00
./README ./TODO ./TUTORIAL.html ./GOOD_PRACTICES.html
2012-09-03 02:08:57 +02:00
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
2013-09-26 23:59:52 +02:00
PUBLIC_FILES_IMAGES = ./W/images/
2012-09-03 02:08:57 +02:00
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
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-12-30 03:03:13 +01:00
.valid.index.shtml: index.shtml
2014-02-13 18:34:20 +01:00
tidy -q index.shtml> /dev/null
2012-09-12 03:50:53 +02:00
validate --verbose index.shtml
2013-12-30 03:03:13 +01:00
touch .valid.index.shtml
upload_index: .valid.index.shtml FAQ LICENSE CREDITS TUTORIAL.html GOOD_PRACTICES.html W/*.bat examples/*.bat examples/*.sh
rcsdiff index.shtml FAQ LICENSE CREDITS W/*.bat examples/*.bat index.shtml
2013-10-18 02:11:27 +02:00
rsync -avH index.shtml FAQ NOLIMIT LICENSE CREDITS TUTORIAL.html GOOD_PRACTICES.html 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/
2013-12-30 03:03:13 +01:00
rsync -avH examples/*.bat examples/*.sh root@ks.lamiral.info:/var/www/imapsync/examples/
2011-04-24 23:19:36 +02:00