isula-build: package init
Signed-off-by: xiadanni <xiadanni1@huawei.com>
This commit is contained in:
parent
e50288ce82
commit
7c7b5d03f2
12
gen-commit.sh
Normal file
12
gen-commit.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
|
||||||
|
# Description: This shell script is used to generate commitID store file.
|
||||||
|
# Author: xiadanni1@huawei.com
|
||||||
|
# Create: 2020-07-20
|
||||||
|
|
||||||
|
changeID=`git log -1 | grep Change-Id | awk '{print $2}' | head -c 40`
|
||||||
|
if [ "${changeID}" = "" ]; then
|
||||||
|
changeID=`date | sha256sum | head -c 40`
|
||||||
|
fi
|
||||||
|
echo "${changeID}" > git-commit
|
||||||
1
git-commit
Normal file
1
git-commit
Normal file
@ -0,0 +1 @@
|
|||||||
|
0a9feef9a4e6568efb13f6f143407a31a3e60549
|
||||||
BIN
isula-build-v0.9.0.tar.gz
Normal file
BIN
isula-build-v0.9.0.tar.gz
Normal file
Binary file not shown.
80
isula-build.spec
Normal file
80
isula-build.spec
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
%global is_systemd 1
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
Name: isula-build
|
||||||
|
Version: 0.9.0
|
||||||
|
Release: 1
|
||||||
|
Summary: A tool to build container images
|
||||||
|
License: Mulan PSL V2
|
||||||
|
URL: https://gitee.com/openeuler/isula-build
|
||||||
|
Source0: isula-build-v0.9.0.tar.gz
|
||||||
|
Source1: git-commit
|
||||||
|
BuildRequires: make btrfs-progs-devel device-mapper-devel glib2-devel gpgme-devel
|
||||||
|
BuildRequires: libassuan-devel libseccomp-devel git bzip2 go-md2man systemd-devel
|
||||||
|
BuildRequires: golang >= 1.13
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
BuildRequires: pkgconfig(systemd)
|
||||||
|
Requires: systemd-units
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
isula-build is a tool used for container images building.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}
|
||||||
|
|
||||||
|
%build
|
||||||
|
cp %{SOURCE1} .
|
||||||
|
%{make_build} safe
|
||||||
|
|
||||||
|
%install
|
||||||
|
install -d %{buildroot}%{_bindir}
|
||||||
|
# install binary
|
||||||
|
install -p -m 550 ./bin/isula-build %{buildroot}%{_bindir}/isula-build
|
||||||
|
install -p -m 550 ./bin/isula-builder %{buildroot}%{_bindir}/isula-builder
|
||||||
|
# install service
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
install -d %{buildroot}%{_unitdir}
|
||||||
|
install -p -m 640 isula-build.service %{buildroot}%{_unitdir}/isula-build.service
|
||||||
|
%endif
|
||||||
|
# install config file
|
||||||
|
install -d %{buildroot}%{_sysconfdir}/isula-build
|
||||||
|
install -p -m 600 ./cmd/daemon/config/configuration.toml %{buildroot}%{_sysconfdir}/isula-build/configuration.toml
|
||||||
|
install -p -m 600 ./cmd/daemon/config/storage.toml %{buildroot}%{_sysconfdir}/isula-build/storage.toml
|
||||||
|
install -p -m 600 ./cmd/daemon/config/registries.toml %{buildroot}%{_sysconfdir}/isula-build/registries.toml
|
||||||
|
install -p -m 600 ./cmd/daemon/config/policy.json %{buildroot}%{_sysconfdir}/isula-build/policy.json
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
|
%post
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
systemctl start isula-build
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
%systemd_preun isula-build
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
%systemd_postun_with_restart isula-build
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files
|
||||||
|
# default perm for files and folder
|
||||||
|
%defattr(0640,root,root,0550)
|
||||||
|
%if 0%{?is_systemd}
|
||||||
|
%config(noreplace) %attr(0640,root,root) %{_unitdir}/isula-build.service
|
||||||
|
%endif
|
||||||
|
%attr(550,root,root) %{_bindir}/isula-build
|
||||||
|
%attr(550,root,root) %{_bindir}/isula-builder
|
||||||
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/isula-build/configuration.toml
|
||||||
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/isula-build/storage.toml
|
||||||
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/isula-build/registries.toml
|
||||||
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/isula-build/policy.json
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sat Jul 25 2020 lixiang <lixiang172@huawei.com> - 0.9.0-1
|
||||||
|
- Package init
|
||||||
Loading…
x
Reference in New Issue
Block a user