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