diff --git a/ocid.spec b/ocid.spec index 9a04761..f57e597 100644 --- a/ocid.spec +++ b/ocid.spec @@ -25,7 +25,7 @@ # https://github.com/kubernetes-incubator/cri-o %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} -%global commit0 6bd7c53568eddd818fa8c64bdb8eba56ab09fc23 +%global commit0 0639f06d0360d3317e4d862607c9c0f8c7f6ba72 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global git1 https://github.com/containernetworking/cni @@ -60,6 +60,7 @@ BuildRequires: gpgme-devel BuildRequires: libassuan-devel BuildRequires: libseccomp-static BuildRequires: pkgconfig(systemd) +BuildRequires: runc >= 1.0.0-1.rc2 BuildRequires: device-mapper-devel Requires(pre): container-selinux Requires: runc >= 1.0.0-1.rc2 @@ -417,6 +418,7 @@ providing packages with %{import_path} prefix. %autosetup -Sgit -n %{name}-1-%{commit0} cp %{SOURCE1} . cp %{SOURCE3} contrib/systemd/. +sed -i 's/$(GO) install/$(GO) build/g' Makefile tar zxf %{SOURCE2} @@ -430,16 +432,29 @@ popd ln -s vendor src export GOPATH=$(pwd)/_build:$(pwd):%{gopath} -make all -_build/bin/ocid --selinux=true config > ocid.conf +make binaries docs + +touch %{name}.conf pushd cni-%{commit1} ./build +popd %install export GOPATH=$(pwd)/_build:$(pwd):%{gopath} -%make_install DESTDIR=%{buildroot} PREFIX=%{buildroot}/usr install.config install.systemd install.completions +make DESTDIR=%{buildroot} PREFIX=%{buildroot}%{_prefix} install.config install.systemd install.completions + +#install -dp %{buildroot}%{_sysconfdir}/%{name} +#install -p -m 644 seccomp.json %{buildroot}%{_sysconfdir}/%{name} + +# install binaries +install -dp %{buildroot}{%{_bindir},%{_libexecdir}/%{name}} +install -p -m 755 %{name} %{buildroot}%{_bindir} +install -p -m 755 ocic %{buildroot}%{_bindir} +install -p -m 755 kpod %{buildroot}%{_bindir} +install -p -m 755 conmon/conmon %{buildroot}%{_libexecdir}/%{name} +install -p -m 755 pause/pause %{buildroot}%{_libexecdir}/%{name} install -dp %{buildroot}%{_libexecdir}/%{name}/cni install -p -m 755 cni-%{commit1}/bin/* %{buildroot}%{_libexecdir}/%{name}/cni @@ -448,9 +463,11 @@ install -dp %{buildroot}%{_sysconfdir}/sysconfig install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-network install -p -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-storage -%{buildroot}%{_bindir}/%{name} --root %{_sharedstatedir}/containers \ ---storage-driver=devmapper config > \ -%{buildroot}%{_sysconfdir}/%{name}/%{name}.conf +install -dp %{buildroot}%{_mandir}/man{1,5,8} +install -m 644 docs/*.1 %{buildroot}%{_mandir}/man1 +install -m 644 docs/*.5 %{buildroot}%{_mandir}/man5 +install -m 644 docs/*.8 %{buildroot}%{_mandir}/man8 + mkdir -p %{buildroot}%{_sharedstatedir}/containers # source codes for building projects @@ -492,12 +509,19 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif +%post +%systemd_post %{name} + %preun %systemd_preun %{name} %postun %systemd_postun_with_restart %{name} +%posttrans +%{_bindir}/%{name} --selinux=true --root %{_sharedstatedir}/containers \ +--storage-driver=devmapper config > %{_sysconfdir}/%{name}/%{name}.conf + #define license tag if not already defined %{!?_licensedir:%global license %doc}