lcr.spec 3.1 KB
Newer Older
L
lifeng68 已提交
1 2
%global _version 2.0.3
%global _release 20200810.102757.git9fc48b6c
H
haozi007 已提交
3 4
%global _inner_name isula_libutils

O
overweight 已提交
5 6
Name:      lcr
Version:   %{_version}
Z
zhuchunyi 已提交
7
Release:   %{_release}
D
dogsheng 已提交
8
URL:       lcr
L
LiFeng 已提交
9
Source:    lcr-2.0.tar.gz
O
overweight 已提交
10 11
Summary:   Lightweight Container Runtime
Group:     Applications/System
H
haozi007 已提交
12
License:   LGPLv2.1+
Z
zhuchunyi 已提交
13
BuildRoot: %{_tmppath}/lcr-%{version}
O
overweight 已提交
14 15 16 17

BuildRequires: cmake
BuildRequires: lxc
BuildRequires: lxc-devel
H
haozi007 已提交
18 19
BuildRequires: zlib-devel yajl-devel gtest-devel
Requires:      lxc yajl zlib
O
overweight 已提交
20 21 22 23
ExclusiveArch:  x86_64 aarch64

%ifarch x86_64
Provides:       liblcr.so()(64bit)
H
haozi007 已提交
24
Provides:       libisula_libutils.so()(64bit)
O
overweight 已提交
25 26 27 28
%endif

%ifarch aarch64
Provides:       liblcr.so()(64bit)
H
haozi007 已提交
29
Provides:       libisula_libutils.so()(64bit)
O
overweight 已提交
30 31 32 33 34 35 36 37 38 39 40
%endif

%description
Containers are insulated areas inside a system, which have their own namespace
for filesystem, network, PID, IPC, CPU and memory allocation and which can be
created using the Control Group and Namespace features included in the Linux
kernel.

This package provides the lightweight container tools and library to control
lxc-based containers.

H
haozi007 已提交
41 42 43 44 45 46 47 48 49
%package devel
Summary: Huawei container runtime, json and log C Library
Group:   Libraries
ExclusiveArch:  x86_64 aarch64
Requires:       %{name} = %{version}-%{release}

%description devel
the %{name}-libs package contains libraries for running iSula applications.

O
overweight 已提交
50 51

%prep
Z
zhuchunyi 已提交
52
%setup -c -n lcr-%{version}
O
overweight 已提交
53 54 55 56

%build
mkdir -p build
cd build
Y
YoungJQ 已提交
57
%cmake -DDEBUG=ON -DENABLE_UT=ON -DLIB_INSTALL_DIR=%{_libdir} ../
O
overweight 已提交
58 59 60 61 62
%make_build

%install
rm -rf %{buildroot}
cd build
Z
zhuchunyi 已提交
63
mkdir -p %{buildroot}/{%{_libdir},%{_libdir}/pkgconfig,%{_includedir}/lcr,%{_bindir}}
O
overweight 已提交
64 65
install -m 0644 ./src/liblcr.so            %{buildroot}/%{_libdir}/liblcr.so
install -m 0644 ./conf/lcr.pc          %{buildroot}/%{_libdir}/pkgconfig/lcr.pc
Z
zhuchunyi 已提交
66
install -m 0644 ../src/lcrcontainer.h  %{buildroot}/%{_includedir}/lcr/lcrcontainer.h
Y
YoungJQ 已提交
67
chmod +x %{buildroot}/%{_libdir}/liblcr.so
O
overweight 已提交
68

H
haozi007 已提交
69 70 71 72 73
install -m 0644 ./src/libisula_libutils.so        %{buildroot}/%{_libdir}/libisula_libutils.so
install -d $RPM_BUILD_ROOT/%{_includedir}/%{_inner_name}
install -m 0644 ../build/json/*.h  %{buildroot}/%{_includedir}/%{_inner_name}/
install -m 0644 ../src/json/*.h  %{buildroot}/%{_includedir}/%{_inner_name}/
install -m 0644 ../third_party/log.h  %{buildroot}/%{_includedir}/%{_inner_name}/log.h
L
lifeng68 已提交
74
install -m 0644 ../third_party/go_crc64.h  %{buildroot}/%{_includedir}/%{_inner_name}/go_crc64.h
Y
YoungJQ 已提交
75
chmod +x %{buildroot}/%{_libdir}/libisula_libutils.so
H
haozi007 已提交
76

O
overweight 已提交
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
find %{buildroot} -name '*.a' -exec rm -f {} ';'
find %{buildroot} -name '*.cmake' -exec rm -f {} ';'

%clean
rm -rf %{buildroot}

%pre

%post  -p /sbin/ldconfig

%postun  -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_libdir}/*
Z
zhuchunyi 已提交
93
%{_libdir}/pkgconfig/lcr.pc
H
haozi007 已提交
94 95 96

%files devel
%defattr(-,root,root,-)
Z
zhuchunyi 已提交
97
%{_includedir}/lcr/lcrcontainer.h
H
haozi007 已提交
98 99
%{_includedir}/%{_inner_name}/*.h

O
overweight 已提交
100 101

%changelog
Y
YoungJQ 已提交
102 103 104 105 106 107
* Mon Aug 03 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.2-20200803.120020.git8462c29a
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: add debug packages

O
overweight 已提交
108 109
* Fri Apr 14 2017 Hui Wang <hw.huiwang@huawei.com> - 0.0.1
- Initial RPM release