summaryrefslogtreecommitdiff
path: root/apparmor-parser.spec
blob: cf534496af0fc012b5ee1d20646c96b216bb3cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
# Conditional build:
%bcond_without	tests	# don't perform "make tests"
%bcond_with	dynamic	# link libstdc++ and libgcc dynamically
#
Summary:	AppArmor userlevel parser utility
Summary(pl.UTF-8):	Narzędzie przestrzeni użytkownika do przetwarzania AppArmor
Name:		apparmor-parser
Version:	2.9.0
Release:	1
Epoch:		1
License:	GPL v2
Group:		Applications/System
Source0:	http://launchpad.net/apparmor/2.9/%{version}/+download/apparmor-%{version}.tar.gz
# Source0-md5:	daaeb859452f793abfdafd33f88d3e90
Source1:	%{name}.init
Patch0:		%{name}-pld.patch
URL:		http://apparmor.wiki.kernel.org/
BuildRequires:	bison
BuildRequires:	flex
BuildRequires:	gettext-devel
BuildRequires:	libapparmor-devel
BuildRequires:	libcap-devel
BuildRequires:	libstdc++-devel
# for apparmor_profile which links statically sometimes
%if %{without dynamic}
BuildRequires:	libapparmor-static
BuildRequires:	libstdc++-static
%endif
BuildRequires:	perl-tools-pod
%if %{with tests}
BuildRequires:	perl-Locale-gettext
BuildRequires:	perl-Test-Harness
BuildRequires:	perl-tools-devel
%endif
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
AppArmor Parser is a userlevel program that is used to load in program
profiles to the AppArmor Security kernel module. This package is part
of a suite of tools that used to be named SubDomain.

%description -l pl.UTF-8
AppArmor Parser to program przestrzeni użytkownika służący do
wczytywania profili programów dla modułu bezpieczeństwa AppArmor jądra
Linuksa. Ten pakiet jest częścią zestawu narzędzi nazywanych
SubDomain.

%prep
%setup -q -n apparmor-%{version}
%patch0 -p0

%build
%{__make} -j1 -C parser \
	CC="%{__cc}" \
	CXX="%{__cxx}" \
	CFLAGS="%{rpmcflags} %{rpmcppflags}" \
	%{?with_dynamic:AAREOBJECTS='$(AAREOBJECT)' AARE_LDFLAGS= AALIB=-lapparmor} \
	USE_SYSTEM=1

%if %{with tests}
%{__make} -j1 -C parser tests \
	CC="%{__cc}" \
	%{?with_dynamic:AAREOBJECTS='$(AAREOBJECT)' AARE_LDFLAGS=-lstdc++ AALIB=-lapparmor} \
	USE_SYSTEM=1
%endif

%install
rm -rf $RPM_BUILD_ROOT
cd parser

install -d $RPM_BUILD_ROOT{%{_mandir}/man{5,7,8},%{_sysconfdir}/{apparmor,rc.d/init.d},/sbin,/subdomain,/var/lib/apparmor}

install apparmor_parser $RPM_BUILD_ROOT/sbin
install subdomain.conf $RPM_BUILD_ROOT%{_sysconfdir}/apparmor
install rc.apparmor.functions $RPM_BUILD_ROOT%{_sysconfdir}/apparmor
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/apparmor
install *.5 $RPM_BUILD_ROOT%{_mandir}/man5
install *.7 $RPM_BUILD_ROOT%{_mandir}/man7
install *.8 $RPM_BUILD_ROOT%{_mandir}/man8

%{__make} -j1 -C po install \
	DESTDIR=$RPM_BUILD_ROOT \
	NAME=%{name}

cd ..
%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add apparmor

%preun
if [ "$1" = "0" ]; then
        /sbin/chkconfig --del apparmor
fi

%files -f %{name}.lang
%defattr(644,root,root,755)
%doc parser/README
%attr(755,root,root) /sbin/apparmor_parser
%dir %{_sysconfdir}/apparmor
%{_sysconfdir}/apparmor/rc.apparmor.functions
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/subdomain.conf
%attr(754,root,root) /etc/rc.d/init.d/apparmor
/subdomain
/var/lib/apparmor
%{_mandir}/man5/apparmor.d.5*
%{_mandir}/man5/subdomain.conf.5*
%{_mandir}/man7/apparmor.7*
%{_mandir}/man8/apparmor_parser.8*