aboutsummaryrefslogtreecommitdiff
path: root/makedist
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-07-01 15:21:16 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-07-01 22:54:07 -0300
commit98d1f1da856ab59cf8355c1e2e11e3c0eb954fb2 (patch)
treeaeb6d9e6f45423cf5698930aea2bc55a8d721fa9 /makedist
parentcc4c9f6321ebaaf71f8c9c26bd30967e93bd2cbb (diff)
downloadluarocks-98d1f1da856ab59cf8355c1e2e11e3c0eb954fb2.tar.gz
luarocks-98d1f1da856ab59cf8355c1e2e11e3c0eb954fb2.tar.bz2
luarocks-98d1f1da856ab59cf8355c1e2e11e3c0eb954fb2.zip
Unix: new build system
* Reworked configure script * Now passes shellcheck * New Makefile for Unix * Simplified `make` and `make install` targets * Simplified `make bootstrap` target * New targets `make binary` and `make install-binary` build and install an all-in-one binary of LuaRocks
Diffstat (limited to 'makedist')
-rwxr-xr-xmakedist45
1 files changed, 12 insertions, 33 deletions
diff --git a/makedist b/makedist
index 02ba9e03..08feb4c1 100755
--- a/makedist
+++ b/makedist
@@ -8,16 +8,23 @@ fi
8 8
9if ! [ -d ".git" ] 9if ! [ -d ".git" ]
10then 10then
11 echo "Should be run inside a git repo dir." 11 echo "Should be run from the LuaRocks git repo dir."
12 exit 1 12 exit 1
13fi 13fi
14 14
15make clean || exit 1 15make clean || exit 1
16 16
17if [ "$1" != "scm" ] 17if [ "$1" != "dev" ]
18then 18then
19 19
20grep -q "\"$1\"" rockspec || { 20ROCKSPEC="luarocks-$1-1.rockspec"
21
22[ -e "$ROCKSPEC" ] || {
23 echo
24 echo "$ROCKSPEC is missing. Please check rockspec version is correct."
25}
26
27grep -q "\"$1-1\"" "$ROCKSPEC" || {
21 echo 28 echo
22 echo "version in rockspec is incorrect. Please fix it." 29 echo "version in rockspec is incorrect. Please fix it."
23 exit 1 30 exit 1
@@ -61,7 +68,7 @@ fi
61out="luarocks-$1" 68out="luarocks-$1"
62rm -rf "$out" 69rm -rf "$out"
63mkdir "$out" 70mkdir "$out"
64rm -f "missing_ref" 71
65git ls-files | while read i 72git ls-files | while read i
66do 73do
67 if [ -f "$i" ] 74 if [ -f "$i" ]
@@ -69,36 +76,8 @@ do
69 dir=`dirname $i` 76 dir=`dirname $i`
70 mkdir -p "$out/$dir" 77 mkdir -p "$out/$dir"
71 cp "$i" "$out/$dir" 78 cp "$i" "$out/$dir"
72 if echo "$i" | grep -v "/bin/" | grep -q "^src/"
73 then
74 grep -qw `basename "$i"` Makefile.setup.inc || {
75 echo "Missing ref in Makefile.setup.inc: $i"
76 touch "missing_ref"
77 exit 1
78 }
79 fi
80 fi
81done
82if [ -e "missing_ref" ]
83then
84 rm -f "missing_ref"
85 exit 1
86fi
87
88cat Makefile.setup.inc | tr ' \\' '\n\n' | grep 'lua$' | while read i
89do
90 if [ ! -e src/luarocks/$i ]
91 then
92 echo "Ref in Makefile.setup.inc for file that no longer exists: $i"
93 touch "outdated_ref"
94 exit 1
95 fi 79 fi
96done 80done
97if [ -e "outdated_ref" ]
98then
99 rm -f "outdated_ref"
100 exit 1
101fi
102 81
103rm -rf "release-unix" "release-windows" "$out.tar.gz" "$out-win32.zip" 82rm -rf "release-unix" "release-windows" "$out.tar.gz" "$out-win32.zip"
104 83
@@ -115,7 +94,7 @@ cd ..
115rm -rf "release-unix" 94rm -rf "release-unix"
116 95
117cd "release-windows/$out-win32" 96cd "release-windows/$out-win32"
118rm -rf makedist Makefile* configure .travis.yml .gitignore test appveyor* .appveyor 97rm -rf makedist Makefile configure .travis.yml .gitignore test appveyor* .appveyor
119cd .. 98cd ..
120zip -r ../"$out-win32.zip" "$out-win32" 99zip -r ../"$out-win32.zip" "$out-win32"
121cd .. 100cd ..