aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-03-17 22:31:13 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-03-17 22:31:13 -0300
commitccab32f2a64f990c75023cad39d6b3966e9aeabb (patch)
tree5744a751a391e80048371bfac1e67436d08ec3ee
parentff6fdfcbe7b62a61840359ac9ae472cba1989364 (diff)
parent855259b52e0e7c5ed81539c975dcaef4469797b9 (diff)
downloadluarocks-ccab32f2a64f990c75023cad39d6b3966e9aeabb.tar.gz
luarocks-ccab32f2a64f990c75023cad39d6b3966e9aeabb.tar.bz2
luarocks-ccab32f2a64f990c75023cad39d6b3966e9aeabb.zip
Merge branch 'new-makefile'
-rw-r--r--Makefile41
-rw-r--r--Makefile.install.inc22
-rw-r--r--Makefile.luarocks15
-rw-r--r--Makefile.setup.inc19
-rwxr-xr-xmakedist6
-rw-r--r--rockspec12
6 files changed, 67 insertions, 48 deletions
diff --git a/Makefile b/Makefile
index 8159ddee..c56ebd0c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,16 @@
1 1
2include config.unix 2include config.unix
3include Makefile.setup.inc
4include Makefile.install.inc
3 5
4.PHONY: all build dev build_bins luadoc check_makefile cleanup_bins clean \ 6.PHONY: all build dev build_bins luadoc check_makefile cleanup_bins clean \
5 install_bins install_luas install_site_config write_sysconfig \ 7 install_site_config write_sysconfig install bootstrap install_rock
6 install bootstrap install_rock
7 8
8DESTDIR =
9PREFIX ?= /usr/local
10ROCKS_TREE ?= $(PREFIX) 9ROCKS_TREE ?= $(PREFIX)
11SYSCONFDIR ?= $(PREFIX)/etc/luarocks 10SYSCONFDIR ?= $(PREFIX)/etc/luarocks
12BINDIR ?= $(PREFIX)/bin
13LUADIR ?= $(PREFIX)/share/lua/$(LUA_VERSION)/
14LUA_DIR ?= /usr/local 11LUA_DIR ?= /usr/local
15LUA_BINDIR ?= $(LUA_DIR)/bin 12LUA_BINDIR ?= $(LUA_DIR)/bin
16 13
17BIN_FILES = luarocks luarocks-admin
18LUAROCKS_FILES = fs/unix/tools.lua fs/unix.lua fs/win32/tools.lua fs/win32.lua \
19fs/lua.lua persist.lua list.lua require.lua repos.lua dir.lua make_manifest.lua \
20command_line.lua install.lua build/command.lua build/cmake.lua build/make.lua \
21build/builtin.lua fetch/cvs.lua fetch/git.lua fetch/sscm.lua tools/patch.lua \
22fetch/svn.lua tools/zip.lua tools/tar.lua pack.lua type_check.lua make.lua \
23remove.lua fs.lua manif.lua add.lua deps.lua build.lua search.lua show.lua \
24manif_core.lua fetch.lua unpack.lua validate.lua cfg.lua download.lua \
25help.lua util.lua index.lua cache.lua refresh_cache.lua loader.lua \
26admin_remove.lua fetch/hg.lua fetch/git_file.lua new_version.lua lint.lua \
27purge.lua path.lua path_cmd.lua write_rockspec.lua doc.lua upload.lua \
28upload/api.lua upload/multipart.lua fetch/git_http.lua
29
30CONFIG_FILE = $(SYSCONFDIR)/config-$(LUA_VERSION).lua 14CONFIG_FILE = $(SYSCONFDIR)/config-$(LUA_VERSION).lua
31 15
32SAFEPWD=`echo "$$PWD" | sed -e 's/\([][]\)\1/]]..'\''\1\1'\''..[[/g'` 16SAFEPWD=`echo "$$PWD" | sed -e 's/\([][]\)\1/]]..'\''\1\1'\''..[[/g'`
@@ -139,25 +123,6 @@ cleanup_bins:
139clean: cleanup_bins 123clean: cleanup_bins
140 rm -f src/luarocks/site_config.lua 124 rm -f src/luarocks/site_config.lua
141 125
142install_bins:
143 mkdir -p "$(DESTDIR)$(BINDIR)"
144 cd src/bin && \
145 luaver="$(LUA_VERSION)" && [ -n "$$luaver" ] || luaver=`$(LUA) -e 'print(_VERSION:sub(5))'`; \
146 for f in $(BIN_FILES); \
147 do \
148 cp "$$f" "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \
149 ln -nfs "$$f-$$luaver" "$(DESTDIR)$(BINDIR)/$$f"; \
150 done
151
152install_luas:
153 mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"
154 cd src/luarocks && for f in $(LUAROCKS_FILES); \
155 do \
156 d="$(DESTDIR)$(LUADIR)/luarocks"/`dirname "$$f"` && \
157 mkdir -p "$$d" && \
158 cp "$$f" "$$d" || exit 1; \
159 done
160
161install_site_config: src/luarocks/site_config.lua 126install_site_config: src/luarocks/site_config.lua
162 mkdir -p "$(DESTDIR)$(LUADIR)/luarocks" 127 mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"
163 cp src/luarocks/site_config.lua "$(DESTDIR)$(LUADIR)/luarocks" 128 cp src/luarocks/site_config.lua "$(DESTDIR)$(LUADIR)/luarocks"
diff --git a/Makefile.install.inc b/Makefile.install.inc
new file mode 100644
index 00000000..20d96a12
--- /dev/null
+++ b/Makefile.install.inc
@@ -0,0 +1,22 @@
1
2.PHONY: install_bins install_luas
3
4install_bins:
5 mkdir -p "$(DESTDIR)$(BINDIR)"
6 cd src/bin && \
7 luaver="$(LUA_VERSION)" && [ -n "$$luaver" ] || luaver=`$(LUA) -e 'print(_VERSION:sub(5))'`; \
8 for f in $(BIN_FILES); \
9 do \
10 cp "$$f" "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \
11 ln -nfs "$$f-$$luaver" "$(DESTDIR)$(BINDIR)/$$f"; \
12 done
13
14install_luas:
15 mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"
16 cd src/luarocks && for f in $(LUAROCKS_FILES); \
17 do \
18 d="$(DESTDIR)$(LUADIR)/luarocks"/`dirname "$$f"` && \
19 mkdir -p "$$d" && \
20 cp "$$f" "$$d" || exit 1; \
21 done
22
diff --git a/Makefile.luarocks b/Makefile.luarocks
new file mode 100644
index 00000000..1eecfeae
--- /dev/null
+++ b/Makefile.luarocks
@@ -0,0 +1,15 @@
1
2include Makefile.setup.inc
3include Makefile.install.inc
4
5.PHONY: all install copy_site_config
6
7all:
8 @echo This Makefile is used by the LuaRocks rockspec for upgrading itself.
9
10install: install_bins install_luas copy_site_config
11
12copy_site_config:
13 luaver="$(LUA_VERSION)" && [ -n "$$luaver" ] || luaver=`$(LUA) -e 'print(_VERSION:sub(5))'`; \
14 mkdir -p "$(DESTDIR)$(LUADIR)/luarocks"; \
15 cp $(LUAROCKS_PREFIX)/share/lua/$$luaver/luarocks/site_config.lua "$(DESTDIR)$(LUADIR)/luarocks"
diff --git a/Makefile.setup.inc b/Makefile.setup.inc
new file mode 100644
index 00000000..eb51ba5e
--- /dev/null
+++ b/Makefile.setup.inc
@@ -0,0 +1,19 @@
1
2DESTDIR =
3PREFIX ?= /usr/local
4BINDIR ?= $(PREFIX)/bin
5LUADIR ?= $(PREFIX)/share/lua/$(LUA_VERSION)/
6
7BIN_FILES = luarocks luarocks-admin
8LUAROCKS_FILES = fs/unix/tools.lua fs/unix.lua fs/win32/tools.lua fs/win32.lua \
9fs/lua.lua persist.lua list.lua require.lua repos.lua dir.lua make_manifest.lua \
10command_line.lua install.lua build/command.lua build/cmake.lua build/make.lua \
11build/builtin.lua fetch/cvs.lua fetch/git.lua fetch/sscm.lua tools/patch.lua \
12fetch/svn.lua tools/zip.lua tools/tar.lua pack.lua type_check.lua make.lua \
13remove.lua fs.lua manif.lua add.lua deps.lua build.lua search.lua show.lua \
14manif_core.lua fetch.lua unpack.lua validate.lua cfg.lua download.lua \
15help.lua util.lua index.lua cache.lua refresh_cache.lua loader.lua \
16admin_remove.lua fetch/hg.lua fetch/git_file.lua new_version.lua lint.lua \
17purge.lua path.lua path_cmd.lua write_rockspec.lua doc.lua upload.lua \
18upload/api.lua upload/multipart.lua fetch/git_http.lua
19
diff --git a/makedist b/makedist
index 797e1b34..482c77f7 100755
--- a/makedist
+++ b/makedist
@@ -39,8 +39,8 @@ do
39 cp "$i" "$out/$dir" 39 cp "$i" "$out/$dir"
40 if echo "$i" | grep -v "/bin/" | grep -q "^src/" 40 if echo "$i" | grep -v "/bin/" | grep -q "^src/"
41 then 41 then
42 grep -qw `basename "$i"` Makefile || { 42 grep -qw `basename "$i"` Makefile.setup.inc || {
43 echo "Missing ref in makefile: $i" 43 echo "Missing ref in Makefile.setup.inc: $i"
44 touch "missing_ref" 44 touch "missing_ref"
45 exit 1 45 exit 1
46 } 46 }
@@ -68,7 +68,7 @@ cd ..
68rm -rf "release-unix" 68rm -rf "release-unix"
69 69
70cd "release-windows/$out-win32" 70cd "release-windows/$out-win32"
71rm -rf makedist Makefile configure lfw .travis.yml .gitignore test 71rm -rf makedist Makefile* configure lfw .travis.yml .gitignore test
72cd .. 72cd ..
73zip -r ../"$out-win32.zip" "$out-win32" 73zip -r ../"$out-win32.zip" "$out-win32"
74cd .. 74cd ..
diff --git a/rockspec b/rockspec
index f2f26b19..5b0ffc9c 100644
--- a/rockspec
+++ b/rockspec
@@ -1,7 +1,9 @@
1package = "LuaRocks" 1package = "LuaRocks"
2local VER = "scm" 2local VER = "scm-1"
3local REV = "1" 3
4version = VER.."-"..REV 4source = {
5 url = "--this rockspec is used by `make bootstrap` only--",
6}
5 7
6description = { 8description = {
7 summary = "A deployment and management system for Lua modules.", 9 summary = "A deployment and management system for Lua modules.",
@@ -23,10 +25,6 @@ dependencies = {
23 "lua >= 5.1" 25 "lua >= 5.1"
24} 26}
25 27
26source = {
27 url = "http://luarocks.org/releases/luarocks-"..VER..".tar.gz",
28}
29
30build = { 28build = {
31 type = "make", 29 type = "make",
32 install_target = "install_rock", 30 install_target = "install_rock",