]>
Commit | Line | Data |
---|---|---|
ba95cc77 JB |
1 | # TODO: PLDify SysV init scripts |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without static_libs # static library | |
5 | # | |
6 | Summary: Linux cgroup manager | |
7 | Summary(pl.UTF-8): Zarządca linuksowych cgroup | |
8 | Name: cgmanager | |
9 | Version: 0.36 | |
10 | Release: 1 | |
11 | License: GPL v2 | |
12 | Group: Daemons | |
13 | Source0: https://linuxcontainers.org/downloads/cgmanager/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: eaa1ead225b4cb3aa91111865faa6e35 | |
15 | URL: https://linuxcontainers.org/cgmanager/ | |
16 | BuildRequires: dbus-devel >= 1.2.16 | |
17 | BuildRequires: help2man | |
18 | BuildRequires: libnih-devel >= 1.0.3 | |
19 | BuildRequires: pkgconfig | |
20 | BuildRequires: rpmbuild(macros) >= 1.647 | |
21 | Requires(post,preun): /sbin/ldconfig | |
22 | Requires(post,preun,postun): systemd-units >= 38 | |
23 | Requires: %{name}-libs = %{version}-%{release} | |
24 | Requires: dbus >= 1.2.16 | |
25 | Requires: rc-scripts | |
26 | Requires: systemd-units >= 38 | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | CGManager is a central privileged daemon that manages all your cgroups | |
31 | for you through a simple DBus API. It's designed to work with nested | |
32 | LXC containers as well as accepting unprivileged requests including | |
33 | resolving user namespaces UIDs/GIDs. | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | CGManager to centralny, uprzywilejowany demon zarządzający wszystkimi | |
37 | cgroupami poprzez proste API DBus. Jest zaprojektowany do pracy z | |
38 | zagnieżdżonymi kontenerami LXC, a także przyjmowania | |
39 | nieuprzywilejowanych żądań, w tym rozwiązywania UID-ów/GID-ów | |
40 | przestrzeni nazw użytkowników. | |
41 | ||
42 | %package libs | |
43 | Summary: Linux cgroup manager library | |
44 | Summary(pl.UTF-8): Biblioteka do zarządzania linuksowymi cgroupami | |
45 | Group: Libraries | |
46 | Requires: dbus-libs >= 1.2.16 | |
47 | Requires: libnih >= 1.0.3 | |
48 | ||
49 | %description libs | |
50 | Linux cgroup manager library. | |
51 | ||
52 | %description libs -l pl.UTF-8 | |
53 | Biblioteka do zarządzania linuksowymi cgroupami. | |
54 | ||
55 | %package devel | |
56 | Summary: Header files for cgmanager library | |
57 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgmanager | |
58 | Group: Development/Libraries | |
59 | Requires: %{name}-libs = %{version}-%{release} | |
60 | Requires: libnih-devel >= 1.0.3 | |
61 | ||
62 | %description devel | |
63 | Header files for cgmanager library. | |
64 | ||
65 | %description devel -l pl.UTF-8 | |
66 | Pliki nagłówkowe biblioteki cgmanager. | |
67 | ||
68 | %package static | |
69 | Summary: Static cgmanager library | |
70 | Summary(pl.UTF-8): Statyczna biblioteka cgmanager | |
71 | Group: Development/Libraries | |
72 | Requires: %{name}-devel = %{version}-%{release} | |
73 | ||
74 | %description static | |
75 | Static cgmanager library. | |
76 | ||
77 | %description static -l pl.UTF-8 | |
78 | Statyczna biblioteka cgmanager. | |
79 | ||
80 | %prep | |
81 | %setup -q | |
82 | ||
83 | %build | |
84 | %configure \ | |
85 | %{!?with_static_libs:--disable-static} \ | |
86 | --with-init-script=sysvinit,systemd | |
87 | %{__make} | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %{__make} install \ | |
93 | DESTDIR=$RPM_BUILD_ROOT \ | |
94 | SYSTEMD_UNIT_DIR=%{systemdunitdir} | |
95 | ||
96 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/cgmanager/tests | |
97 | rmdir $RPM_BUILD_ROOT%{_datadir}/cgmanager | |
98 | # obsoleted by pkg-config | |
99 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libcgmanager.la | |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %post | |
105 | /sbin/chkconfig --add cgmanager | |
106 | /sbin/chkconfig --add cgproxy | |
107 | %service cgmanger restart | |
108 | %service cgproxy restart | |
109 | %systemd_post cgmanager.service | |
110 | %systemd_post cgproxy.service | |
111 | ||
112 | %preun | |
113 | if [ "$1" = "0" ]; then | |
114 | %service -q cgproxy stop | |
115 | %service -q cgmanager stop | |
116 | /sbin/chkconfig --del cgproxy | |
117 | /sbin/chkconfig --del cgmanager | |
118 | fi | |
119 | %systemd_preun cgproxy.service | |
120 | %systemd_preun cgmanager.service | |
121 | ||
122 | %postun | |
123 | %systemd_reload | |
124 | ||
125 | %post libs -p /sbin/ldconfig | |
126 | %postun libs -p /sbin/ldconfig | |
127 | ||
128 | %files | |
129 | %defattr(644,root,root,755) | |
130 | %attr(755,root,root) %{_bindir}/cgm | |
131 | %attr(755,root,root) %{_sbindir}/cgm-release-agent | |
132 | %attr(755,root,root) %{_sbindir}/cgmanager | |
133 | %attr(755,root,root) %{_sbindir}/cgproxy | |
134 | %attr(754,root,root) /etc/rc.d/init.d/cgmanager | |
135 | %attr(754,root,root) /etc/rc.d/init.d/cgproxy | |
136 | %{systemdunitdir}/cgmanager.service | |
137 | %{systemdunitdir}/cgproxy.service | |
138 | %{_mandir}/man1/cgm.1* | |
139 | %{_mandir}/man8/cgmanager.8* | |
140 | %{_mandir}/man8/cgproxy.8* | |
141 | ||
142 | %files libs | |
143 | %defattr(644,root,root,755) | |
144 | %doc ChangeLog README | |
145 | %attr(755,root,root) %{_libdir}/libcgmanager.so.*.*.* | |
146 | %attr(755,root,root) %ghost %{_libdir}/libcgmanager.so.0 | |
147 | ||
148 | %files devel | |
149 | %defattr(644,root,root,755) | |
150 | %attr(755,root,root) %{_libdir}/libcgmanager.so | |
151 | %{_includedir}/cgmanager | |
152 | %{_pkgconfigdir}/libcgmanager.pc | |
153 | ||
154 | %if %{with static_libs} | |
155 | %files static | |
156 | %defattr(644,root,root,755) | |
157 | %{_libdir}/libcgmanager.a | |
158 | %endif |