]> git.pld-linux.org Git - packages/libsemanage.git/blob - libsemanage.spec
- updated to 2.8
[packages/libsemanage.git] / libsemanage.spec
1 #
2 # Conditional build:
3 %bcond_without  python  # Python (any) bindings
4 %bcond_without  python2 # Python 2 binding
5 %bcond_without  python3 # Python 3 binding
6 #
7 %if %{without python}
8 %undefine       with_python2
9 %undefine       with_python3
10 %endif
11 Summary:        An interface for SELinux management
12 Summary(pl.UTF-8):      Interfejs do zarządzania SELinuksem
13 Name:           libsemanage
14 Version:        2.8
15 Release:        1
16 License:        LGPL v2.1+
17 Group:          Libraries
18 #Source0Download: https://github.com/SELinuxProject/selinux/wiki/Releases
19 Source0:        https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/%{name}-%{version}.tar.gz
20 # Source0-md5:  62ed7bb2ede677a735f2750751677a4f
21 Patch0:         %{name}-libexecdir.patch
22 URL:            https://github.com/SELinuxProject/selinux/wiki
23 BuildRequires:  bison
24 BuildRequires:  bzip2-devel
25 BuildRequires:  flex
26 BuildRequires:  libselinux-devel >= 2.8
27 BuildRequires:  libsepol-devel >= 2.8
28 %{?with_python2:BuildRequires:  python-devel >= 2}
29 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.714
32 Requires:       libselinux >= 2.8
33 Requires:       libsepol >= 2.8
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
37 An interface for SELinux management.
38
39 %description -l pl.UTF-8
40 Interfejs do zarządzania SELinuksem.
41
42 %package devel
43 Summary:        Header files for libsemanage library
44 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libsemanage
45 Group:          Development/Libraries
46 Requires:       %{name} = %{version}-%{release}
47
48 %description devel
49 This package contains the header files for libsemanage library.
50
51 %description devel -l pl.UTF-8
52 Ten pakiet zawiera pliki nagłówkowe biblioteki libsemanage.
53
54 %package static
55 Summary:        Static version of libsemanage library
56 Summary(pl.UTF-8):      Statyczna wersja biblioteki libsemanage
57 Group:          Development/Libraries
58 Requires:       %{name}-devel = %{version}-%{release}
59
60 %description static
61 Static version of libsemanage library.
62
63 %description static -l pl.UTF-8
64 Statyczna wersja biblioteki libsemanage.
65
66 %package -n python-semanage
67 Summary:        Python 2 binding for semanage library
68 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki semanage
69 Group:          Libraries/Python
70 Requires:       %{name} = %{version}-%{release}
71 Requires:       python-selinux >= 2.8
72
73 %description -n python-semanage
74 Python 2 binding for semanage library.
75
76 %description -n python-semanage -l pl.UTF-8
77 Wiązania Pythona 2 do biblioteki semanage.
78
79 %package -n python3-semanage
80 Summary:        Python 3 binding for semanage library
81 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki semanage
82 Group:          Libraries/Python
83 Requires:       %{name} = %{version}-%{release}
84 Requires:       python3-selinux >= 2.8
85
86 %description -n python3-semanage
87 Python 3 binding for semanage library.
88
89 %description -n python3-semanage -l pl.UTF-8
90 Wiązania Pythona 3 do biblioteki semanage.
91
92 %prep
93 %setup -q
94 %patch0 -p1
95
96 %build
97 %{__make} -j1 all %{?with_python2:pywrap} \
98         CC="%{__cc}" \
99         CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
100         LIBDIR=%{_libdir} \
101         LIBEXECDIR=%{_libexecdir} \
102         PYPREFIX=python2 \
103         PYTHON=%{__python}
104
105 %if %{with python3}
106 %{__make} -j1 -C src pywrap \
107         CC="%{__cc}" \
108         CFLAGS="%{rpmcflags} %{rpmcppflags} -Wall -fno-strict-aliasing" \
109         LIBDIR=%{_libdir} \
110         LIBEXECDIR=%{_libexecdir} \
111         PYPREFIX=python3 \
112         PYTHON=%{__python3}
113 %endif
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117
118 %{__make} install %{?with_python2:install-pywrap} \
119         LIBDIR=%{_libdir} \
120         LIBEXECDIR=%{_libexecdir} \
121         PYPREFIX=python2 \
122         PYSITEDIR=%{py_sitedir} \
123         PYTHON=%{__python} \
124         DESTDIR=$RPM_BUILD_ROOT
125
126 # changed in 2.4
127 install -d $RPM_BUILD_ROOT/%{_lib}
128 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsemanage.so.* $RPM_BUILD_ROOT/%{_lib}
129 # adjust .so symlink, make symlink across / absolute
130 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \
131         $RPM_BUILD_ROOT%{_libdir}/libsemanage.so
132
133 %if %{with python2}
134 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
135 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
136 %py_postclean
137 %endif
138
139 %if %{with python3}
140 %{__make} -C src install-pywrap \
141         LIBDIR=%{_libdir} \
142         LIBEXECDIR=%{_libexecdir} \
143         PYPREFIX=python3 \
144         PYSITEDIR=%{py3_sitedir} \
145         PYTHON=%{__python3} \
146         DESTDIR=$RPM_BUILD_ROOT
147
148 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
149 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
150 %endif
151
152 %clean
153 rm -rf $RPM_BUILD_ROOT
154
155 %post   -p /sbin/ldconfig
156 %postun -p /sbin/ldconfig
157
158 %files
159 %defattr(644,root,root,755)
160 %attr(755,root,root) /%{_lib}/libsemanage.so.1
161 %dir %{_sysconfdir}/selinux
162 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf
163 %dir %{_libexecdir}/selinux
164 %{_mandir}/man5/semanage.conf.5*
165
166 %files devel
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_libdir}/libsemanage.so
169 %{_pkgconfigdir}/libsemanage.pc
170 %{_includedir}/semanage
171 %{_mandir}/man3/semanage_*.3*
172
173 %files static
174 %defattr(644,root,root,755)
175 %{_libdir}/libsemanage.a
176
177 %if %{with python2}
178 %files -n python-semanage
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{py_sitedir}/_semanage.so
181 %{py_sitedir}/semanage.py[co]
182 %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store
183 %endif
184
185 %if %{with python3}
186 %files -n python3-semanage
187 %defattr(644,root,root,755)
188 %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so
189 %{py3_sitedir}/semanage.py
190 %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co]
191 %endif
This page took 0.090044 seconds and 3 git commands to generate.