lcr.spec 1.9 KB
Newer Older
1 2
%global _version 1.0.20
%global _release 20200215.125545.git330d8cda
O
overweight 已提交
3 4
Name:      lcr
Version:   %{_version}
Z
zhuchunyi 已提交
5
Release:   %{_release}
D
dogsheng 已提交
6
URL:       lcr
Z
zhuchunyi 已提交
7
Source:    lcr-1.0.tar.gz
O
overweight 已提交
8 9 10
Summary:   Lightweight Container Runtime
Group:     Applications/System
License:   Mulan PSL v1
Z
zhuchunyi 已提交
11
BuildRoot: %{_tmppath}/lcr-%{version}
O
overweight 已提交
12 13 14 15 16

BuildRequires: cmake
BuildRequires: lxc
BuildRequires: lxc-devel
BuildRequires: yajl yajl-devel
H
haozi007 已提交
17
Requires:      lxc
O
overweight 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
ExclusiveArch:  x86_64 aarch64

%ifarch x86_64
Provides:       liblcr.so()(64bit)
%endif

%ifarch aarch64
Provides:       liblcr.so()(64bit)
%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.

%global debug_package %{nil}

%prep
Z
zhuchunyi 已提交
40
%setup -c -n lcr-%{version}
O
overweight 已提交
41 42 43 44 45 46 47 48 49 50

%build
mkdir -p build
cd build
%cmake -DDEBUG=OFF -DLIB_INSTALL_DIR=%{_libdir} ../
%make_build

%install
rm -rf %{buildroot}
cd build
Z
zhuchunyi 已提交
51
mkdir -p %{buildroot}/{%{_libdir},%{_libdir}/pkgconfig,%{_includedir}/lcr,%{_bindir}}
O
overweight 已提交
52 53
install -m 0644 ./src/liblcr.so            %{buildroot}/%{_libdir}/liblcr.so
install -m 0644 ./conf/lcr.pc          %{buildroot}/%{_libdir}/pkgconfig/lcr.pc
Z
zhuchunyi 已提交
54
install -m 0644 ../src/lcrcontainer.h  %{buildroot}/%{_includedir}/lcr/lcrcontainer.h
O
overweight 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

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 已提交
72 73
%{_libdir}/pkgconfig/lcr.pc
%{_includedir}/lcr/lcrcontainer.h
O
overweight 已提交
74 75 76 77

%changelog
* Fri Apr 14 2017 Hui Wang <hw.huiwang@huawei.com> - 0.0.1
- Initial RPM release