From 4bbfdc470b47a56e1e2b1664a897847309f348fa Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Fri, 20 Apr 2012 19:58:37 +0200 Subject: [PATCH] rewrite tarball script as a makefile target --- makefile | 15 ++++++++++++++- utils/release.sh | 28 ++++++++++++---------------- utils/tarball.sh | 31 ------------------------------- 3 files changed, 26 insertions(+), 48 deletions(-) delete mode 100755 utils/tarball.sh diff --git a/makefile b/makefile index 0e79ebca..dfc8af3f 100644 --- a/makefile +++ b/makefile @@ -24,6 +24,8 @@ PDF = $(TARGETS:%=%.pdf) CHORDS = chords.tex CHORDS_SRC = $(shell ls songs/*/*.sg) +DATE = $(shell date +%d)-$(shell date +%m)-$(shell date +%Y) + PRINT=printf "%s\n" PRINTTAB=printf "\t%s\n" @@ -58,7 +60,6 @@ clean: $(TARGETS:%=%.toc) $(TARGETS:%=%.out) $(TARGETS:%=%.log) \ $(TARGETS:%=%.nav) $(TARGETS:%=%.snm) @rm -f *.sbx *.sxd *.sxc - @rm -f lilypond/*.ps @rm -f *.pyc cleanall: clean @@ -90,6 +91,18 @@ $(PDF): %.pdf: %.tex %.aux $(CHORDS): $(CHORDS_SRC) $(MAKE_CHORDS) -o $@ +archive: clean + tar -czvf songbook-$(DATE).tar.gz \ + --exclude=*pdf \ + --exclude=.git --exclude=.gitignore \ + --exclude=$(BOOKS_DIR)/default.sb \ + --exclude=perso/* --exclude=perso \ + --exclude=build/* --exclude=build \ + --exclude=covers/* --exclude=covers \ + --exclude=data/* --exclude=data \ + --exclude=*tar.gz \ + ../songbook + ifeq (.pdf,$(suffix $(MAKECMDGOALS))) include $(MAKECMDGOALS:%.pdf=%.d) else ifneq ($(MAKECMDGOALS),clean) diff --git a/utils/release.sh b/utils/release.sh index b545833d..5a743e2b 100755 --- a/utils/release.sh +++ b/utils/release.sh @@ -54,21 +54,17 @@ fi; #build all songbooks rm -f *.d make cleanall -make naheulbeuk.pdf -make volume-1.pdf -make volume-2.pdf -make volume-3.pdf -make volume-4.pdf -make volume-5.pdf -make english.pdf -make french.pdf -make songbook.pdf -make lyricbook.pdf - -#clean -make clean - -./utils/tarball.sh +make -j 4 naheulbeuk.pdf +make -j 4 volume-1.pdf +make -j 4 volume-2.pdf +make -j 4 volume-3.pdf +make -j 4 volume-4.pdf +make -j 4 volume-5.pdf +make -j 4 english.pdf +make -j 4 french.pdf +make -j 4 songbook.pdf +make -j 4 lyricbook.pdf +make -j 4 archive git status @@ -77,7 +73,7 @@ then ./utils/new-songs-list.sh | cat - NEWS > /tmp/out && mv -f /tmp/out NEWS echo "\nversion $MAIN.$MAJOR.$MINOR\n" | cat - NEWS > /tmp/out && mv -f /tmp/out NEWS git add templates/*.tmpl - git add books/volume-5.sb NEWS + git add books/*.sb NEWS git commit -m "patacrep release version $MAIN.$MAJOR.$MINOR" git tag "patacrep_$MAIN.$MAJOR.$MINOR" fi diff --git a/utils/tarball.sh b/utils/tarball.sh deleted file mode 100755 index b66cf929..00000000 --- a/utils/tarball.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -#Author: Romain Goffe -#Date: 13/10/2011 -#Description: Build a tarball from the songbook git repo - -#Copy songbook directory -cd $HOME -cp -RH songbook songbook-$(date +%d)-$(date +%m)-$(date +%Y); - -#Remove unecessary directories -cd songbook-$(date +%d)-$(date +%m)-$(date +%Y); -rm -rf perso/ ; -rm -rf build/ ; -rm -rf data/ ; -rm -rf .git/ ; -rm -f .gitignore ; -rm -f utils/send.sh ; -rm -f books/tmp.sb books/default.sb -rm -f default* - -#Clean tmp files -find . -name "*~" -or -name "#*#" -type f -exec rm -f {} \; -make cleanall - -#Tarball -cd $HOME -tar czvf songbook.tar.gz songbook-$(date +%d)-$(date +%m)-$(date +%Y) - -#Remove copy -rm -rf songbook-$(date +%d)-$(date +%m)-$(date +%Y)/