]> git.pld-linux.org Git - packages/dumb-init.git/blob - dumb-init.spec
rel 2
[packages/dumb-init.git] / dumb-init.spec
1 #
2 # Conditional build:
3 %bcond_without  static          # don't build static version
4
5 Summary:        A minimal init system for Linux containers
6 Name:           dumb-init
7 Version:        1.0.1
8 Release:        2
9 License:        MIT
10 Group:          Base
11 Source0:        https://github.com/Yelp/dumb-init/archive/v%{version}/%{name}-%{version}.tar.gz
12 # Source0-md5:  8eb97a95d886a26dfc939adbce0d028c
13 URL:            https://github.com/Yelp/dumb-init
14 %if %{with static}
15 BuildRequires:  musl-devel
16 %endif
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         _sbindir        /sbin
20
21 %description
22 dumb-init is a simple process supervisor and init system designed to
23 run as PID 1 inside minimal container environments (such as Docker).
24 It is a deployed as a small, statically-linked binary written in C.
25
26 %package static
27 Summary:        A minimal init system for Linux containers (static)
28 Group:          Base
29
30 %description static
31 dumb-init is a simple process supervisor and init system designed to
32 run as PID 1 inside minimal container environments (such as Docker).
33 It is a deployed as a small, statically-linked binary written in C.
34
35 This package contains statically linked version of dumb-init.
36
37 %prep
38 %setup -q
39
40 %build
41 %if %{with static}
42 %{__make} \
43         CC="musl-gcc" \
44         CFLAGS="%{rpmcflags} -std=gnu99 -Wall -Werror"
45 mv dumb-init dumb-init-static
46 %{__make} clean
47 %endif
48
49 %{__make} \
50         CC="%{__cc}" \
51         CFLAGS="%{rpmcflags} -std=gnu99 -Wall -Werror"
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT%{_sbindir}
56 install -p dumb-init $RPM_BUILD_ROOT%{_sbindir}
57 %if %{with static}
58 install -p dumb-init-static $RPM_BUILD_ROOT%{_sbindir}
59 %endif
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %files
65 %defattr(644,root,root,755)
66 %doc README.md LICENSE
67 %attr(755,root,root) %{_sbindir}/dumb-init
68
69 %if %{with static}
70 %files static
71 %defattr(644,root,root,755)
72 %doc README.md LICENSE
73 %attr(755,root,root) %{_sbindir}/dumb-init-static
74 %endif
This page took 0.053957 seconds and 4 git commands to generate.