forked from tarantool/mysql-tarantool-replication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplicatord.spec
85 lines (74 loc) · 2.15 KB
/
replicatord.spec
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
76
77
78
79
80
81
82
83
84
85
%define name replicatord
%define _rel 1
License: Proprietary
Vendor: Mail.Ru
Group: RB
URL: https://confluence.mail.ru/display/RB
Source0: %{name}-%{current_datetime}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{current_datetime}
Name: %{name}
Version: 1.0.12
Release: %{_rel}%{version_suffix}
Group: Applications/Databases
BuildRequires: gcc, make, gcc-c++, zeromq_rb-devel, boost-devel
BuildRequires: cmake >= 2.8
Requires: boost-system, boost-serialization, zeromq_rb
%if 0%{rhel} < 7
BuildRequires: mysql-devel
Requires: mysql-libs
Requires: mailru-wrapper
%else
Buildrequires: mysql-devel >= 1:5.5.42
Requires: mysql-libs >= 1:5.5.42
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: systemd
%endif
Summary: Mysql to Tarantool replication daemon
%description
Package contains Mysql to Tarantool replication daemon
Git version: %{git_version} (branch: %{git_branch})
%define __bindir /usr/local/sbin
%define __etcdir /usr/local/etc
%prep
%{__rm} -rf %{buildroot}
%setup -n %{name}-%{current_datetime}
%build
cd ..
cd %{name}-%{current_datetime}
cmake . && make
%install
[ "%{buildroot}" != "/" ] && rm -fr %{buildroot}
%{__mkdir} -p %{buildroot}/usr
%{__mkdir} -p %{buildroot}/usr/local/sbin
%if 0%{rhel} >= 7
%{__mkdir} -p %{buildroot}/usr/lib/systemd/system/
%{__install} -pD -m 644 %{name}.service %{buildroot}/usr/lib/systemd/system/%{name}.service
%else
%{__mkdir} -p %{buildroot}/etc/rc.d/init.d
%{__install} -m 755 rc.%{name} %{buildroot}/etc/rc.d/init.d/%{name}
%endif
make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor install
%post
%if 0%{rhel} >= 7
%systemd_post %{name}.service
%endif
%preun
%if 0%{rhel} >= 7
%systemd_preun %{name}.service
%endif
%postun
%if 0%{rhel} >= 7
%systemd_postun
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
/usr/local/sbin/%{name}
%config(noreplace) /usr/local/etc/%{name}.cfg
%if 0%{rhel} >= 7
/usr/lib/systemd/system/%{name}.service
%else
/etc/rc.d/init.d/%{name}
%endif