Skip to content

Commit 4e707cd

Browse files
committed
Build and packaging of rpm
1 parent 86b2814 commit 4e707cd

File tree

11 files changed

+212
-35
lines changed

11 files changed

+212
-35
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ tnt_*
3030

3131
EV-Tarantool16-*/
3232
.vscode
33+
packpack
34+
build

.travis.yml

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,71 @@
1-
language: perl
2-
os:
3-
- linux
4-
perl:
5-
- '5.20'
6-
- '5.18'
7-
- '5.16'
8-
- '5.14'
9-
- '5.12'
10-
- '5.10'
11-
install:
12-
- provision/travis.sh
1+
sudo: false
2+
language: C
3+
services:
4+
- docker
5+
6+
cache:
7+
directories:
8+
- $HOME/.cache
9+
10+
env:
11+
global:
12+
- PRODUCT=EV-Tarantool16
13+
- ARCH=x86_64
14+
matrix:
15+
- OS=el DIST=7
16+
1317
script:
14-
- perl Makefile.PL
15-
- make
16-
- make test
17-
- make dist
18+
- git describe --long
19+
- git clone https://github.com/packpack/packpack.git packpack
20+
- packpack/packpack
21+
22+
before_deploy:
23+
- ls -l build/
24+
1825
deploy:
19-
provider: releases
20-
skip_cleanup: true
21-
api_key:
22-
secure: Xnmab8XGFv2zR8OyszOeRxibYr9c3gavRyPokEPMkscOljamS9Uy0yYJ5x0sUWWozq6Dd1cg5Mkef7GG7tgSCqV+Fu57lpz4aHGu2OpnIsKGwrMDhNsS4qOYbEGpcIiE0YKRtIiGiJmK6kr8lmbCI8fdQakbW/7vZW1a1a154Aw=
23-
file_glob: true
24-
file: EV-Tarantool*.tar.gz
25-
on:
26-
tags: true
26+
# Deploy packages to PackageCloud
27+
- provider: packagecloud
28+
username: igorcoding
29+
repository: "tarantoolcontrib"
30+
token: ${PACKAGECLOUD_TOKEN}
31+
dist: ${OS}/${DIST}
32+
package_glob: build/*.{rpm,deb,dsc}
33+
skip_cleanup: true
34+
on:
35+
branch: master
36+
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
37+
2738
notifications:
2839
email: true
29-
sudo: required
40+
41+
42+
43+
# language: perl
44+
# os:
45+
# - linux
46+
# perl:
47+
# - '5.20'
48+
# - '5.18'
49+
# - '5.16'
50+
# - '5.14'
51+
# - '5.12'
52+
# - '5.10'
53+
# install:
54+
# - provision/travis.sh
55+
# script:
56+
# - perl Makefile.PL
57+
# - make
58+
# - make test
59+
# - make dist
60+
# deploy:
61+
# provider: releases
62+
# skip_cleanup: true
63+
# api_key:
64+
# secure: Xnmab8XGFv2zR8OyszOeRxibYr9c3gavRyPokEPMkscOljamS9Uy0yYJ5x0sUWWozq6Dd1cg5Mkef7GG7tgSCqV+Fu57lpz4aHGu2OpnIsKGwrMDhNsS4qOYbEGpcIiE0YKRtIiGiJmK6kr8lmbCI8fdQakbW/7vZW1a1a154Aw=
65+
# file_glob: true
66+
# file: EV-Tarantool*.tar.gz
67+
# on:
68+
# tags: true
69+
# notifications:
70+
# email: true
71+
# sudo: required

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ WriteMakefile(
3636
'constant' => 0,
3737
},
3838
LIBS => [ $ARES_LDFLAGS ],
39-
DEFINE => '-g -ggdb -O0 -std=c99 -Wall',
39+
DEFINE => '-g -ggdb -O1 -std=c99 -Wall',
4040
LICENSE => 'GPL',
4141
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', PREOP => $preop },
4242
CONFIGURE => sub {

rpm/perl-EV-Tarantool16.spec

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Name: perl-EV-Tarantool16
2+
Version: 0.1
3+
Release: 1%{?dist}
4+
Summary: EV::Tarantool16
5+
License: GPL+
6+
Group: Development/Libraries
7+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
8+
BuildArch: x86_64
9+
BuildRequires: perl >= 0:5.006
10+
BuildRequires: tarantool >= 1.6.8.0
11+
BuildRequires: tarantool-devel >= 1.6.8.0
12+
BuildRequires: c-ares >= 1.10
13+
BuildRequires: c-ares-devel >= 1.10
14+
BuildRequires: libev-devel
15+
BuildRequires: perl(ExtUtils::MakeMaker)
16+
BuildRequires: perl(EV)
17+
BuildRequires: perl(Types::Serialiser)
18+
BuildRequires: perl(Test::More)
19+
BuildRequires: perl(Test::Deep)
20+
BuildRequires: perl(AnyEvent)
21+
BuildRequires: perl(Proc::ProcessTable)
22+
BuildRequires: perl(Time::HiRes)
23+
BuildRequires: perl(Scalar::Util)
24+
BuildRequires: perl(Data::Dumper)
25+
BuildRequires: perl(Carp)
26+
BuildRequires: perl(constant)
27+
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
28+
Requires: tarantool >= 1.6.8.0
29+
Requires: c-ares >= 1.10
30+
Requires: perl(EV)
31+
Requires: perl(Types::Serialiser)
32+
33+
URL: https://github.com/igorcoding/EV-Tarantool16
34+
Source0: https://github.com/igorcoding/EV-Tarantool16/archive/%{version}/EV-Tarantool16-%{version}.tar.gz
35+
36+
%description
37+
EV::Tarantool16 - connector for Tarantool 1.6+
38+
39+
%prep
40+
%setup -q -n EV-Tarantool16-%{version}
41+
42+
%build
43+
%{__perl} Makefile.PL INSTALLDIRS=vendor
44+
make %{?_smp_mflags}
45+
46+
%install
47+
rm -rf $RPM_BUILD_ROOT
48+
49+
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
50+
51+
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
52+
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
53+
54+
%{_fixperms} $RPM_BUILD_ROOT/*
55+
56+
%check
57+
TEST_FAST_MEM=1 make test
58+
59+
%clean
60+
rm -rf $RPM_BUILD_ROOT
61+
62+
%files
63+
%defattr(-,root,root,-)
64+
%doc META.json
65+
%{perl_vendorarch}/auto/*
66+
%{perl_vendorarch}/EV*
67+
%{_mandir}/man3/*
68+
69+
%changelog
70+
* Sun Mar 25 2018 igorcoding 1.39-1
71+
- Create spec

rpm/prebuild-el-7.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /usr/bin/env bash
2+
3+
echo "Installing Tarantool"
4+
5+
# Clean up yum cache
6+
sudo yum clean all
7+
8+
# Enable EPEL repository
9+
sudo yum -y install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
10+
sudo sed 's/enabled=.*/enabled=1/g' -i /etc/yum.repos.d/epel.repo
11+
12+
# Add Tarantool repository
13+
sudo rm -f /etc/yum.repos.d/*tarantool*.repo
14+
sudo tee /etc/yum.repos.d/tarantool_1_7.repo <<- EOF
15+
[tarantool_1_7]
16+
name=EnterpriseLinux-7 - Tarantool
17+
baseurl=http://download.tarantool.org/tarantool/1.7/el/7/x86_64/
18+
gpgkey=http://download.tarantool.org/tarantool/1.7/gpgkey
19+
repo_gpgcheck=1
20+
gpgcheck=0
21+
enabled=1
22+
23+
[tarantool_1_7-source]
24+
name=EnterpriseLinux-7 - Tarantool Sources
25+
baseurl=http://download.tarantool.org/tarantool/1.7/el/7/SRPMS
26+
gpgkey=http://download.tarantool.org/tarantool/1.7/gpgkey
27+
repo_gpgcheck=1
28+
gpgcheck=0
29+
EOF
30+
31+
# Update metadata
32+
sudo yum makecache -y --disablerepo='*' --enablerepo='tarantool_1_7' --enablerepo='epel'
33+
34+
# Install Tarantool
35+
sudo yum -y install tarantool

rpm/prebuild-el.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#! /usr/bin/env bash
2+
3+
echo "Installing cpanm"
4+
sudo yum install -y perl-CPAN
5+
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
6+
7+
echo "Installing Test::Tarantool"
8+
TestTarantool_VER=0.033
9+
TestTarantool_URL=https://github.com/igorcoding/Test-Tarantool16/releases/download/v${TestTarantool_VER}/Test-Tarantool16-${TestTarantool_VER}.tar.gz
10+
TestTarantool_LOCATION=/tmp/test-tarantool16.tar.gz
11+
wget ${TestTarantool_URL} -O ${TestTarantool_LOCATION}
12+
cpanm --sudo ${TestTarantool_LOCATION}
13+
14+
echo "Prebuild finished"

t/01-basic.t

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ my $tnt = {
6161
};
6262

6363
$tnt = Test::Tarantool16->new(
64+
cleanup => 0,
6465
title => $tnt->{name},
6566
host => $tnt->{host},
6667
port => $tnt->{port},
@@ -80,6 +81,12 @@ $tnt->start(timeout => 10, sub {
8081
});
8182
EV::loop;
8283

84+
my $w; $w = EV::timer 1, 0, sub {
85+
undef $w;
86+
EV::unloop;
87+
};
88+
EV::loop;
89+
8390
$tnt->{cnntrace} = 0;
8491
my $SPACE_NAME = 'tester';
8592

@@ -332,7 +339,7 @@ subtest 'Insert tests', sub {
332339
sync => ignore(),
333340
schema_id => ignore(),
334341
}],
335-
342+
336343
# Not all fields supplied tests
337344
# You can't do this in 1.7.5 anymore
338345
];
@@ -644,7 +651,7 @@ subtest 'Upsert tests', sub {
644651
schema_id => ignore(),
645652
}],
646653
];
647-
654+
648655
Renewer::renew_tnt($c, $SPACE_NAME, 0, sub {
649656
EV::unloop;
650657
});
@@ -661,7 +668,7 @@ subtest 'Upsert tests', sub {
661668
});
662669
EV::loop;
663670
}
664-
671+
665672
Renewer::renew_tnt($c, $SPACE_NAME, 1, sub {
666673
EV::unloop;
667674
});

t/02-initial.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $c->connect for 1..10;
7373
$c->disconnect;
7474
is $c->state, 'DISCONNECTED';
7575

76-
my $w;$w = EV::timer 1,0,sub { undef $w; fail "Timed out"; exit; };
76+
$w = EV::timer 1,0,sub { undef $w; fail "Timed out"; exit; };
7777

7878
$c->connect;
7979
EV::run( EV::RUN_ONCE )

t/07-memory.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use Scalar::Util 'weaken';
1010
use Errno;
1111
use EV::Tarantool16;
1212
use Test::More;
13-
BEGIN{ $ENV{TEST_FAST} and plan 'skip_all'; }
13+
BEGIN{ $ENV{TEST_FAST} || $ENV{TEST_FAST_MEM} and plan 'skip_all'; }
1414
use Test::Deep;
1515
use Data::Dumper;
1616
use Renewer;
@@ -109,7 +109,7 @@ diag '==== Memory tests ====' if $ENV{TEST_VERBOSE};
109109

110110
subtest 'connect/disconnect test', sub {
111111
# plan( skip_all => 'skip');
112-
112+
113113
for (0..5) {
114114
my $cnt = 0;
115115
my $start = time;

t/08-multi.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,18 @@ for (@tnts) {
9090
}
9191
});
9292
EV::loop;
93+
94+
my $w; $w = EV::timer 1, 0, sub {
95+
undef $w;
96+
EV::unloop;
97+
};
98+
EV::loop;
9399
}
94100

95101
my $timeout = 5;
96102
my $w_timeout; $w_timeout = AE::timer $timeout, 0, sub {
97103
undef $w_timeout;
98-
104+
99105
fail "Couldn't connect to Multi in $timeout seconds";
100106
EV::unloop;
101107
};

xstarantool/xstnt16.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,10 +1483,10 @@ static inline int parse_index_body_data(HV *spaces, const char *const data_begin
14831483
idx->fields = newAV();
14841484
av_extend(idx->fields, parts_count);
14851485

1486-
uint32_t part_i;
1486+
uint32_t part_i = 0;
14871487
int32_t ix = -1;
14881488
const char *str = NULL;
1489-
uint32_t str_len;
1489+
uint32_t str_len = 0;
14901490

14911491
for (part_i = 0; part_i < parts_count; ++part_i) {
14921492
switch(mp_typeof(*p)) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy