Skip to content

Commit 1218744

Browse files
committed
Add centos 7 spec file
1 parent 14a21ab commit 1218744

File tree

5 files changed

+72
-13
lines changed

5 files changed

+72
-13
lines changed

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ POLY2LUA = utils/poly2lua/poly2lua
88

99
DATA = osm/data
1010

11-
.PHONY: all install
11+
.PHONY: build install
1212

13-
all: $(POLY2LUA) data
13+
build: $(POLY2LUA) data
1414

1515
$(POLY2LUA): utils/poly2lua.cpp utils/CMakeLists.txt
1616
mkdir -p utils/poly2lua
@@ -24,14 +24,14 @@ test:
2424
$(LUA) test_inside_iran.lua
2525

2626
data:
27-
$(MAKE) -C $(DATA) all
27+
$(MAKE) -C $(DATA) build
2828

2929
clean:
3030
rm -rf utils/poly2lua
3131
$(MAKE) -C $(DATA) clean
3232

33-
install: all
34-
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/osm
35-
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/osm/data
36-
$(INSTALL) osm/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/osm
33+
install:
34+
$(INSTALL) -m 0755 -d $(DESTDIR)/$(LUA_LIB_DIR)/osm
35+
$(INSTALL) -m 0755 -d $(DESTDIR)/$(LUA_LIB_DIR)/osm/data
36+
$(INSTALL) -m 0644 osm/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/osm
3737
$(MAKE) -C $(DATA) install

osm/data/Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ REGIONS_DATA = asia.lua africa.lua \
1818
central-america.lua \
1919
south-america.lua
2020

21-
.PHONY: all install clean
21+
.PHONY: build install clean
2222

23-
all: $(REGIONS_DATA)
23+
build: $(REGIONS_DATA)
2424
for r in $(REGIONS) ; do \
2525
$(MAKE) -C $$r all ;\
2626
done
@@ -37,10 +37,11 @@ clean:
3737
$(MAKE) -C $$r clean ;\
3838
done
3939

40-
install: all
40+
install:
4141
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DATA_DIR)
42-
$(INSTALL) *.lua $(DESTDIR)/$(LUA_LIB_DATA_DIR)
42+
$(INSTALL) *.lua $(DESTDIR)/$(LUA_LIB_DATA_DIR) || true
4343
for d in $(REGIONS) ; do \
44-
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DATA_DIR)/$$(d)/ ;\
45-
$(INSTALL) $(d)/*.lua $(DESTDIR)/$(LUA_LIB_DATA_DIR)/$$(d)/ ;\
44+
[[ -d $$d ]] || continue ;\
45+
$(INSTALL) -m 0755 -d $(DESTDIR)/$(LUA_LIB_DATA_DIR)/$$d/ ;\
46+
$(INSTALL) -m 0644 $$d/*.lua $(DESTDIR)/$(LUA_LIB_DATA_DIR)/$$d/ || true ;\
4647
done

rpm/build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
SPEC=lua-nginx-osm.spec
6+
VER=$(awk '/Version:/ {print $2}' $SPEC)
7+
SRC=$HOME/rpmbuild/SOURCES/$VER.tar.gz
8+
9+
if ! [ -e "$SRC" ]; then
10+
spectool -g -R $SPEC
11+
fi
12+
13+
rpmbuild -ba $SPEC

rpm/install-dev-tools.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
yum install -y rpmdevtools make yum-utils '@Development Tools'
4+
rpmdev-setuptree

rpm/lua-nginx-osm.spec

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
%define lua_version 5.1
2+
%define lua_lib_dir /share/lua/%{lua_version}
3+
4+
Name: lua-nginx-osm
5+
Version: 0.50
6+
Release: 0
7+
Summary: Lua Tirex/renderd client drivers for the ngx_lua based on the cosocket API.
8+
URL: https://github.com/tierpod/lua-nginx-osm
9+
License: GPLv3
10+
11+
Source: https://github.com/tierpod/lua-nginx-osm/archive/%{version}.tar.gz
12+
BuildArch: noarch
13+
Requires: lua >= %{lua_version}
14+
Requires: nginx
15+
Requires: nginx-module-lua
16+
17+
%description
18+
Lua Tirex/renderd/http client drivers for the ngx_lua based on the cosocket API.
19+
20+
%prep
21+
%setup -q
22+
23+
%build
24+
25+
%install
26+
#make LUA_LIB_DIR=%{buildroot}/usr/share/lua/%{lua_ver} install
27+
make DESTDIR=%{buildroot}%{_prefix} LUA_LIB_DIR=%{lua_lib_dir} install
28+
29+
%clean
30+
rm -rf %{buildroot}
31+
32+
%post
33+
34+
%files
35+
%defattr(644,root,root,755)
36+
%{_prefix}%{lua_lib_dir}/osm
37+
38+
%changelog
39+
* Mon May 13 2019 Pavel Podkorytov <pod.pavel@gmail.com> 0.50.0
40+
- Initial version
41+

0 commit comments

Comments
 (0)