]> git.pld-linux.org Git - packages/libsemanage.git/blob - libsemanage.spec
3c6a03d35037e5209f6fc8e41a7f185eb985ecd9
[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.7
15 Release:        2
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/20170804/%{name}-%{version}.tar.gz
20 # Source0-md5:  a6b5c451fbe45ff9e3e0e65f2db0ae1d
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.7
27 BuildRequires:  libsepol-devel >= 2.7
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.7
33 Requires:       libsepol >= 2.7
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.7
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.7
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=%{_libdir} \
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=%{_libdir} \
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=$RPM_BUILD_ROOT%{_libdir} \
120         LIBEXECDIR=$RPM_BUILD_ROOT%{_libexecdir} \
121         SHLIBDIR=$RPM_BUILD_ROOT/%{_lib} \
122         PYPREFIX=python2 \
123         PYSITEDIR=$RPM_BUILD_ROOT%{py_sitedir} \
124         PYTHON=%{__python} \
125         DESTDIR=$RPM_BUILD_ROOT
126
127 # changed in 2.4
128 install -d $RPM_BUILD_ROOT/%{_lib}
129 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsemanage.so.* $RPM_BUILD_ROOT/%{_lib}
130 # adjust .so symlink, make symlink across / absolute
131 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libsemanage.so.*) \
132         $RPM_BUILD_ROOT%{_libdir}/libsemanage.so
133
134 %if %{with python2}
135 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
136 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
137 %py_postclean
138 %endif
139
140 %if %{with python3}
141 %{__make} -C src install-pywrap \
142         LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
143         LIBEXECDIR=$RPM_BUILD_ROOT%{_libexecdir} \
144         PYPREFIX=python3 \
145         PYSITEDIR=$RPM_BUILD_ROOT%{py3_sitedir} \
146         PYTHON=%{__python3} \
147         DESTDIR=$RPM_BUILD_ROOT
148
149 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
150 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
151 %endif
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %post   -p /sbin/ldconfig
157 %postun -p /sbin/ldconfig
158
159 %files
160 %defattr(644,root,root,755)
161 %attr(755,root,root) /%{_lib}/libsemanage.so.1
162 %dir %{_sysconfdir}/selinux
163 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/selinux/semanage.conf
164 %dir %{_libexecdir}/selinux
165 %{_mandir}/man5/semanage.conf.5*
166
167 %files devel
168 %defattr(644,root,root,755)
169 %attr(755,root,root) %{_libdir}/libsemanage.so
170 %{_pkgconfigdir}/libsemanage.pc
171 %{_includedir}/semanage
172 %{_mandir}/man3/semanage_*.3*
173
174 %files static
175 %defattr(644,root,root,755)
176 %{_libdir}/libsemanage.a
177
178 %if %{with python2}
179 %files -n python-semanage
180 %defattr(644,root,root,755)
181 %attr(755,root,root) %{py_sitedir}/_semanage.so
182 %{py_sitedir}/semanage.py[co]
183 %attr(755,root,root) %{_libexecdir}/selinux/semanage_migrate_store
184 %endif
185
186 %if %{with python3}
187 %files -n python3-semanage
188 %defattr(644,root,root,755)
189 %attr(755,root,root) %{py3_sitedir}/_semanage.cpython-*.so
190 %{py3_sitedir}/semanage.py
191 %{py3_sitedir}/__pycache__/semanage.cpython-*.py[co]
192 %endif
This page took 0.032362 seconds and 2 git commands to generate.