-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (87 loc) · 3.06 KB
/
Makefile
File metadata and controls
93 lines (87 loc) · 3.06 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Makefile for Flatnuke building
#
# Flatnuke version
VER = "4.0.0"
DEV ?=
# Current user name
USER = $(shell whoami)
# Current date
DATE = $(shell date +%Y%m%d)
# Filename for public release
FILEDIST = flatnuke$(DEV)-$(VER).tar.gz
# Filename for snapshot release
FILE = flatnuke$(DEV)-$(VER)-$(DATE).tar.gz
# Directory where to create the package
FNUSER = $(shell cat ~/.flatnukerc)
# Directory of the webserver
WEBDIR=/var/www
##
## This option creates a daily snapshot of Flatnuke package
##
snapshot:
@cd ..;\
rm -fr $(FILE) $(FILE).md5;\
cp -dpR flatnuke$(DEV) flatnuke$(DEV)-$(VER);\
find flatnuke$(DEV)-$(VER) -name CVS -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -name .git -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -type f \( -iname "\.*" ! -iname "\.htaccess" \) -exec rm -fr \{\} \; 2>/dev/null;\
rm flatnuke$(DEV)-$(VER)/Makefile;\
tar vfzc $(FILE) flatnuke$(DEV)-$(VER) > /dev/null;\
rm -fr flatnuke$(DEV)-$(VER);\
md5sum $(FILE) | cut -d" " -f1 > $(FILE).md5;\
scp $(FILE) $(FILE).md5 $(FNUSER);\
rm -fr $(FILE) $(FILE).md5;
##
## This option creates the official Flatnuke package to be distributed
##
dist:
@cd ..;\
rm -fr $(FILEDIST);\
cp -dpR flatnuke$(DEV) flatnuke$(DEV)-$(VER);\
find flatnuke$(DEV)-$(VER) -name CVS -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -name .git -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -type f \( -iname "\.*" ! -iname "\.htaccess" \) -exec rm -fr \{\} \; 2>/dev/null;\
rm flatnuke$(DEV)-$(VER)/Makefile;\
tar vfzc $(FILEDIST) flatnuke$(DEV)-$(VER) > /dev/null;\
rm -fr flatnuke$(DEV)-$(VER);\
scp $(FILEDIST) $(FNUSER);\
rm -fr $(FILEDIST)
##
## This option builds local Flatnuke test environment
## (usually installed in /var/www directory)
##
webtest:
@cd ..;\
rm -fr $(WEBDIR)/flatnuke$(DEV)-$(VER);\
cp -dpR flatnuke$(DEV) flatnuke$(DEV)-$(VER);\
find flatnuke$(DEV)-$(VER) -name CVS -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -name .git -exec rm -fr \{\} \; 2>/dev/null;\
find flatnuke$(DEV)-$(VER) -type f \( -iname "\.*" ! -iname "\.htaccess" \) -exec rm -fr \{\} \; 2>/dev/null;\
rm flatnuke$(DEV)-$(VER)/Makefile;\
mv flatnuke$(DEV)-$(VER) $(WEBDIR);\
chown -R $(USER):$(USER) $(WEBDIR)/flatnuke$(DEV)-$(VER);
##
## This option cleans local Flatnuke test environment
## (usually installed in /var/www directory)
##
cleantest:
@su -c "rm -fr $(WEBDIR)/flatnuke$(DEV)-$(VER)"
##
## This option fixes all files/directories permissions'
## to make them 644 and 755.
##
fixperms:
@echo "----------------------";\
echo "List of files to fix :";\
echo "----------------------";\
find ./ -type f -ls | grep -v drwx | grep -v rw-r--r--;\
find ./ -type d -ls | grep -v drwxr-xr-x;\
echo "----------------------";\
echo "Fixing ....";\
find ./ -type f | grep -v drwx | grep -v rw-r--r-- | xargs chmod 644;\
find ./ -type d | xargs chmod 755;\
echo "----------------------";\
echo "Now check manually :";\
echo "----------------------";\
find ./ -type f -ls | grep -v drwx | grep -v rw-r--r--;\
find ./ -type d -ls | grep -v drwxr-xr-x;