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