-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (61 loc) · 2.02 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
#
# Makefile
#
XXV = xxv
VERSION = 1.7.0
### The name of the distribution archive:
ARCHIVE = $(XXV)-$(VERSION)
PACKAGE = $(ARCHIVE)
TMPDIR = /tmp
### The subdirectories:
### Targets:
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)
copyfiles:
@mkdir -p $(TMPDIR)/$(ARCHIVE)
@git checkout-index -a -f --prefix=$(TMPDIR)/$(ARCHIVE)/
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
updateversion:
@sed -e "s/__VERSION__/$(VERSION)/g" bin/xxvd > $(TMPDIR)/$(ARCHIVE)/bin/xxvd
DBTABLES = $(shell cat ./contrib/update-xxv | grep tables= | cut -d '=' -f 2 | sed -e s/\'//g;)
updatesql:
@echo Please type the DB-Password for root:
@mysqldump --add-drop-table=FALSE --set-charset=FALSE -u root -p -n -d xxv $(DBTABLES) -r $(TMPDIR)/$(ARCHIVE)/contrib/upgrade-xxv-db.sql
@sed -e "s/CREATE TABLE/CREATE TABLE IF NOT EXISTS/g" -e "s/\ ENGINE=MyISAM.*;/;/g" $(TMPDIR)/$(ARCHIVE)/contrib/upgrade-xxv-db.sql > ./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
@chmod a+x $(TMPDIR)/$(ARCHIVE)/install-debian.sh
dist: tmpfolder\
copyfiles\
removefiles\
updateversion\
setpermission
@chown root.root -R $(TMPDIR)/$(ARCHIVE)/*
@tar czf $(PACKAGE).tgz --exclude=.git -C $(TMPDIR) $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
all: dist