Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 79f01fc

Browse files
authored
Create RPM spec (#152)
Fixes #97.
1 parent 586cb88 commit 79f01fc

9 files changed

+194
-62
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ doc/apidoc
2020
# benchmarks results
2121
bench.*.result.txt
2222

23+
# packpack build directory
24+
/build
25+
2326
# temporary directory for make apidoc-lint
2427
doc/apidoc-lint-tmp

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "test-run"]
22
path = test-run
33
url = https://github.com/tarantool/test-run.git
4+
[submodule "3rd_party/packpack"]
5+
path = 3rd_party/packpack
6+
url = https://github.com/packpack/packpack.git

.travis.yml

+67-56
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,76 @@
11
language: c
22

3-
sudo: true
3+
sudo: required
44

5-
dist: trusty
5+
services:
6+
- docker
67

7-
env:
8-
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
9-
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
10-
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
11-
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0
12-
13-
branches:
14-
only:
15-
- master
8+
cache:
9+
directories:
10+
- $HOME/.cache
1611

17-
before_install:
18-
- sudo apt-get -qq update
19-
- curl http://download.tarantool.org/tarantool/1.9/gpgkey |
20-
sudo apt-key add -release=`lsb_release -c -s`
12+
git:
13+
depth: 100500
2114

22-
# install https download transport for APT
23-
- sudo apt-get -y install apt-transport-https
15+
env:
16+
matrix:
17+
- OS=el DIST=6
18+
- OS=el DIST=7
19+
- OS=fedora DIST=26
20+
- OS=fedora DIST=27
21+
- SHARD_VERSION=1.2 AVRO_SCHEMA=2.3.2
22+
- SHARD_VERSION=2.1 AVRO_SCHEMA=2.3.2
23+
- SHARD_VERSION=1.2 AVRO_SCHEMA=3.0.0
24+
- SHARD_VERSION=2.1 AVRO_SCHEMA=3.0.0
2425

25-
# append two lines to a list of source repositories
26-
- sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
27-
- echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
28-
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
29-
- echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ trusty main" |
30-
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list
26+
script:
27+
- git describe --long
28+
- |
29+
if [ -n "${OS}" ]; then
30+
git submodule update --recursive --init
31+
./3rd_party/packpack/packpack
32+
else
33+
./tools/ubuntu.trusty.test.sh
34+
fi
3135
32-
install:
33-
- sudo apt-get update
34-
- sudo apt-get -y install tarantool tarantool-dev
35-
- cd ..
36-
- git clone https://github.com/rtsisyk/msgpuck
37-
- cd msgpuck
38-
- cmake .
39-
- sudo make install
40-
- cd ..
41-
- tarantoolctl rocks install shard "${SHARD_VERSION}"
42-
- tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"
43-
- cd graphql
44-
- git submodule update --recursive --init
45-
- tarantoolctl rocks install lulpeg
46-
- tarantoolctl rocks install lrexlib-pcre
47-
- tarantoolctl rocks install http
48-
- cd ..
49-
# lua (with dev headers) is necessary for luacheck
50-
- sudo apt-get install lua5.1
51-
- sudo apt-get install liblua5.1-0-dev
52-
- wget "http://luarocks.github.io/luarocks/releases/luarocks-2.4.4.tar.gz"
53-
- tar xf luarocks-2.4.4.tar.gz
54-
- cd luarocks-2.4.4
55-
- ./configure
56-
- make build
57-
- sudo make install
58-
- cd ../graphql
59-
- sudo luarocks install luacheck
60-
- sudo pip install virtualenv
61-
- sudo luarocks install ldoc
36+
before_deploy:
37+
- ls -l build/
6238

63-
script:
64-
- make apidoc-lint
65-
- make test
39+
deploy:
40+
# Deploy packages to PackageCloud
41+
- provider: packagecloud
42+
username: ${PACKAGECLOUD_USER}
43+
repository: "1_9"
44+
token: ${PACKAGECLOUD_TOKEN}
45+
dist: ${OS}/${DIST}
46+
package_glob: build/*.{rpm,deb}
47+
skip_cleanup: true
48+
on:
49+
branch: master
50+
condition: -n "${OS}"
51+
- provider: packagecloud
52+
username: ${PACKAGECLOUD_USER}
53+
repository: "1_10"
54+
token: ${PACKAGECLOUD_TOKEN}
55+
dist: ${OS}/${DIST}
56+
package_glob: build/*.{rpm,deb}
57+
skip_cleanup: true
58+
on:
59+
branch: master
60+
condition: -n "${OS}"
61+
- provider: packagecloud
62+
username: ${PACKAGECLOUD_USER}
63+
repository: "2_0"
64+
token: ${PACKAGECLOUD_TOKEN}
65+
dist: ${OS}/${DIST}
66+
package_glob: build/*.{rpm,deb}
67+
skip_cleanup: true
68+
on:
69+
branch: master
70+
condition: -n "${OS}"
71+
notifications:
72+
email:
73+
recipients:
74+
75+
on_success: change
76+
on_failure: always

3rd_party/packpack

Submodule packpack added at 30ff7b5

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ serve-apidoc: apidoc
6969
.PHONY: demo
7070
demo:
7171
./demo/demo.lua $(TESTDATA)
72+
73+
.PHONY: rpm
74+
rpm:
75+
OS=el DIST=7 ./3rd_party/packpack/packpack

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,19 @@ make test
374374
* For use:
375375
* tarantool,
376376
* lulpeg,
377-
* >=tarantool/avro-schema-2.0-71-gfea0ead,
378-
* >=tarantool/shard-1.1-91-gfa88bf8 (but < 2.0) or
379-
>=tarantool/shard-2.1-0-g0a7d98f (optional),
377+
* \>=tarantool/avro-schema-2.0-71-gfea0ead,
378+
* \>=tarantool/shard-1.1-91-gfa88bf8 (but < 2.0) or
379+
\>=tarantool/shard-2.1-0-g0a7d98f (optional),
380380
* lrexlib-pcre2 or lrexlib-pcre (optional),
381381
* tarantool/http (optional, for GraphiQL).
382382
* For test (additionally to 'for use'):
383383
* python 2.7,
384384
* virtualenv,
385385
* luacheck,
386-
* >=tarantool/avro-schema-2.2.2-4-g1145e3e,
387-
* >=tarantool/shard-1.1-92-gec1a27e (but < 2.0) or
388-
>=tarantool/shard-2.1-0-g0a7d98f,
386+
* \>=tarantool/avro-schema-2.2.2-4-g1145e3e,
387+
* \>=tarantool/shard-1.1-92-gec1a27e (but < 2.0) or
388+
\>=tarantool/shard-2.1-0-g0a7d98f,
389+
* lrexlib-pcre2 or lrexlib-pcre,
389390
* tarantool/http.
390391
* For building apidoc (additionally to 'for use'):
391392
* ldoc.

rpm/prebuild-el-6.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
set -exu # Strict shell (w/o -o pipefail)
4+
5+
sudo yum -y install https://centos6.iuscommunity.org/ius-release.rpm
6+
sudo yum -y install python27 python27-devel

rpm/tarantool-graphql.spec

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Name: tarantool-graphql
2+
# During package building {version} is overwritten by Packpack with
3+
# VERSION. It is set to major.minor.patch.number_of_commits_above_last_tag.
4+
# major.minor.patch tag and number of commits above are taken from the
5+
# github repository: https://github.com/tarantool/graphql
6+
Version: 0.0.1
7+
Release: 1%{?dist}
8+
Summary: Set of adapters for GraphQL query language to the Tarantool data model
9+
Group: Applications/Databases
10+
License: BSD
11+
URL: https://github.com/tarantool/graphql
12+
Source0: https://github.com/tarantool/graphql/archive/%{version}/graphql-%{version}.tar.gz
13+
BuildArch: noarch
14+
15+
# Dependencies for `make test`
16+
BuildRequires: python-virtualenv
17+
BuildRequires: tarantool-luacheck
18+
BuildRequires: tarantool >= 1.9.0.0
19+
BuildRequires: tarantool-lulpeg
20+
BuildRequires: tarantool-avro-schema >= 2.2.2.4
21+
BuildRequires: tarantool-shard >= 1.1.92
22+
BuildRequires: tarantool-lrexlib-pcre2
23+
BuildRequires: tarantool-http
24+
25+
# Weak references are not supported in RHEL / CentOS.
26+
#
27+
# https://fedoraproject.org/wiki/Packaging:WeakDependencies
28+
# https://bugzilla.redhat.com/show_bug.cgi?id=91458
29+
# https://bugzilla.redhat.com/show_bug.cgi?id=1427674
30+
31+
# Dependencies for a user
32+
Requires: tarantool >= 1.9.0.0
33+
Requires: tarantool-lulpeg
34+
Requires: tarantool-avro-schema >= 2.0.71
35+
#Suggests: tarantool-shard >= 1.1.91
36+
#Suggests: tarantool-lrexlib-pcre2
37+
#Suggests: tarantool-http
38+
39+
%description
40+
Set of adapters for GraphQL query language to the Tarantool data model
41+
42+
# /usr/share/tarantool
43+
%define module_dir %{_datadir}/tarantool
44+
%define br_module_dir %{buildroot}%{module_dir}
45+
46+
%prep
47+
%setup -q -n %{name}-%{version}
48+
49+
%check
50+
# Originally 'check' section is executed in
51+
# /build/usr/src/degub/tarantool-graphql directory.
52+
# It makes names of unix sockets too long and therefore tests fail.
53+
# To avoid it we copy sources to /build/graphql and run tests there.
54+
cp -R . /build/graphql
55+
cd /build/graphql
56+
make test
57+
58+
%install
59+
mkdir -p %{br_module_dir}
60+
cp -r graphql %{br_module_dir}
61+
62+
%files
63+
%{module_dir}/graphql
64+
65+
%changelog
66+
* Thu Jul 12 2018 Ivan Koptelov <[email protected]> 0.0.1-1
67+
- Initial release 0.0.1
68+
69+
* Sun May 20 2018 Alexander Turenko <[email protected]> 0.0.0-1
70+
- Create pseudo-release 0.0.0 for testing deployment

tools/ubuntu.trusty.test.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
set -exu # Strict shell (w/o -o pipefail)
4+
5+
sudo apt-get -qq update
6+
curl http://download.tarantool.org/tarantool/1.9/gpgkey | \
7+
sudo apt-key add -
8+
release=`lsb_release -c -s`
9+
10+
# install https download transport for APT
11+
sudo apt-get -y install apt-transport-https
12+
13+
# append two lines to a list of source repositories
14+
sudo rm -f /etc/apt/sources.list.d/*tarantool*.list
15+
echo "deb http://download.tarantool.org/tarantool/1.9/ubuntu/ ${release} main" | \
16+
sudo tee /etc/apt/sources.list.d/tarantool_1_9.list
17+
echo "deb-src http://download.tarantool.org/tarantool/1.9/ubuntu/ ${release} main" | \
18+
sudo tee -a /etc/apt/sources.list.d/tarantool_1_9.list
19+
20+
sudo apt-get update
21+
sudo apt-get -y install tarantool tarantool-dev libmsgpuck-dev luarocks
22+
23+
tarantoolctl rocks install lulpeg
24+
tarantoolctl rocks install lrexlib-pcre
25+
tarantoolctl rocks install http
26+
tarantoolctl rocks install shard "${SHARD_VERSION}"
27+
tarantoolctl rocks install avro-schema "${AVRO_SCHEMA}"
28+
29+
sudo luarocks install luacheck
30+
sudo pip install virtualenv
31+
32+
git submodule update --recursive --init
33+
make test

0 commit comments

Comments
 (0)