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