Welcome to mirror list, hosted at ThFree Co, Russian Federation.

makedist - github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a9ca992939303e255394b4a0f9f0596aa6e6388 (plain)
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
#!/bin/sh

if ! [ "$1" ]
then
   echo "usage: $0 <version>"
   exit 1
fi

if ! [ -d ".git" ]
then
   echo "Should be run inside a git repo dir."
   exit 1
fi

make clean || exit 1

grep -q "\"$1\"" rockspec || {
   echo
   echo "Version in rockspec is incorrect. Please fix it."
   exit 1
}

grep -q "program_version = \"$1\"" src/luarocks/cfg.lua || {
   echo
   echo "Version in src/luarocks/cfg.lua is incorrect. Please fix it."
   exit 1
}

out="luarocks-$1"
rm -rf "$out"
mkdir "$out"
rm -f "missing_ref"
git ls-files | while read i
do
   if [ -f "$i" ]
   then
      dir=`dirname $i`
      mkdir -p "$out/$dir"
      cp "$i" "$out/$dir"
      if echo "$i" | grep -v "/bin/" | grep -q "^src/"
      then
         grep -qw `basename "$i"` Makefile.setup.inc || {
            echo "Missing ref in Makefile.setup.inc: $i"
            touch "missing_ref"
            exit 1
         }
      fi
   fi
done
if [ -e "missing_ref" ]
then
   rm -f "missing_ref"
   exit 1
fi

rm -rf "release-unix" "release-windows" "$out.tar.gz" "$out-win32.zip"

mkdir "release-unix"
cp -a "$out" "release-unix"
mkdir "release-windows"
mv "$out" "release-windows/$out-win32"

cd "release-unix/$out"
rm -rf makedist install.bat COPYING_lua COPYING_7z COPYING_win win32 lfw .travis.yml .gitignore appveyor* .appveyor
cd ..
tar czvpf ../"$out.tar.gz" "$out"
cd ..
rm -rf "release-unix"

cd "release-windows/$out-win32"
rm -rf makedist Makefile* configure lfw .travis.yml .gitignore test appveyor* .appveyor
cd ..
zip -r ../"$out-win32.zip" "$out-win32"
cd ..
rm -rf "release-windows"