summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2007-08-13 18:41:27 +0000
committerAndreas Brachold <vdr07@deltab.de>2007-08-13 18:41:27 +0000
commitbcbf441e09fb502cf64924ff2530fa144bdf52c5 (patch)
treef377707a2dac078db8cd0c7d7abfe69ac1006d71 /Makefile
downloadxxv-bcbf441e09fb502cf64924ff2530fa144bdf52c5.tar.gz
xxv-bcbf441e09fb502cf64924ff2530fa144bdf52c5.tar.bz2
* Move files to trunk
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile84
1 files changed, 84 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e1be477
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,84 @@
+#
+# Makefile
+#
+# $Id$
+
+XXV = xxv
+VERSION = 0.93
+
+### The name of the distribution archive:
+
+ARCHIVE = $(XXV)-$(VERSION)
+PACKAGE = $(ARCHIVE)
+TMPDIR = /tmp
+
+### The subdirectories:
+
+### Targets:
+INCLUDE = bin contrib doc etc html share lib locale wml README.txt Makefile install.sh
+EXCLUDE = "*~" "*.bak" "*.org" "*.diff" "xxvd.pid" "$(XXV)-*.tgz"
+
+
+clean:
+ @for i in $(EXCLUDE) ;\
+ do \
+ find -name "$$i" -exec rm -rf "{}" \; \
+ || exit 1;\
+ done
+
+tmpfolder:
+ @-rm -rf $(TMPDIR)/$(ARCHIVE)
+ @mkdir -p $(TMPDIR)/$(ARCHIVE)
+
+copyfiles:
+ @for i in $(INCLUDE) ;\
+ do \
+ cp -a $$i $(TMPDIR)/$(ARCHIVE) \
+ || exit 1;\
+ done
+
+removefiles:
+ @for i in $(EXCLUDE) ;\
+ do \
+ find $(TMPDIR)/$(ARCHIVE) -name "$$i" -exec rm -f "{}" \; \
+ || exit 1;\
+ done
+ @for i in $(EXCLUDEFOLDER) ;\
+ do \
+ find "$(TMPDIR)/$(ARCHIVE)/$$i" -exec rm -rf "{}" \; \
+ || exit 1;\
+ done
+
+compatiblesqldump:
+ @sed -e "s/ DEFAULT CHARSET=latin1//g" contrib/upgrade-xxv-db.sql > $(TMPDIR)/$(ARCHIVE)/contrib/upgrade-xxv-db.sql
+
+updateversion:
+ @sed -e "s/__VERSION__/$(VERSION)/g" bin/xxvd > $(TMPDIR)/$(ARCHIVE)/bin/xxvd
+
+updatesql:
+ @echo Please type the DB-Password for root:
+ @mysqldump -p -n -d --add-drop-table -p -u root xxv 1> ./contrib/upgrade-xxv-db.sql
+
+setpermission:
+ @find $(TMPDIR)/$(ARCHIVE) -type d -exec chmod 755 {} \;
+ @find $(TMPDIR)/$(ARCHIVE) -type f -exec chmod 644 {} \;
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/bin/xxvd
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/contrib/update-xxv
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/contrib/at-vdradmin2xxv.pl
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/locale/xgettext.pl
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/etc/xxvd
+ @chmod a+x $(TMPDIR)/$(ARCHIVE)/install.sh
+
+dist: tmpfolder\
+ updatesql\
+ copyfiles\
+ removefiles\
+ updateversion\
+ compatiblesqldump\
+ setpermission
+ @chown root.root -R $(TMPDIR)/$(ARCHIVE)/*
+ @tar czf $(PACKAGE).tgz --exclude=.svn -C $(TMPDIR) $(ARCHIVE)
+ @-rm -rf $(TMPDIR)/$(ARCHIVE)
+ @echo Distribution package created as $(PACKAGE).tgz
+
+all: dist