]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with tests # don't perform "make tests" | |
4 | %bcond_with dynamic # link libstdc++ and libgcc dynamically | |
5 | # | |
6 | Summary: AppArmor userlevel parser utility | |
7 | Summary(pl.UTF-8): Narzędzie przestrzeni użytkownika do przetwarzania AppArmor | |
8 | Name: apparmor-parser | |
9 | Version: 3.0.8 | |
10 | Release: 1 | |
11 | Epoch: 1 | |
12 | License: GPL v2 | |
13 | Group: Applications/System | |
14 | Source0: http://launchpad.net/apparmor/3.0/%{version}/+download/apparmor-%{version}.tar.gz | |
15 | # Source0-md5: 4a836c7bd1a0c3d1392733afb6e06d73 | |
16 | Source1: %{name}.init | |
17 | Patch0: %{name}-pld.patch | |
18 | # Drop when upstream does cache rebuild based on hash and not on mtime | |
19 | Patch1: %{name}-cache-rebuild.patch | |
20 | Patch2: cap.patch | |
21 | URL: http://wiki.apparmor.net/ | |
22 | BuildRequires: bison | |
23 | BuildRequires: flex | |
24 | BuildRequires: gettext-tools | |
25 | BuildRequires: libapparmor-devel >= 1:%{version} | |
26 | BuildRequires: libcap-devel | |
27 | BuildRequires: libstdc++-devel | |
28 | # for apparmor_profile which links statically sometimes | |
29 | %if %{without dynamic} | |
30 | BuildRequires: libapparmor-static | |
31 | BuildRequires: libstdc++-static | |
32 | %endif | |
33 | BuildRequires: perl-tools-pod | |
34 | %if %{with tests} | |
35 | %if %(test -e /sys/kernel/security/apparmor/features ; echo $?) | |
36 | # apparmor enabled kernel running and fs mounted | |
37 | BuildRequires: /sys/kernel/security/apparmor/features | |
38 | %endif | |
39 | BuildRequires: perl-Locale-gettext | |
40 | BuildRequires: perl-Test-Harness | |
41 | BuildRequires: perl-tools-devel | |
42 | %endif | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | AppArmor Parser is a userlevel program that is used to load in program | |
47 | profiles to the AppArmor Security kernel module. This package is part | |
48 | of a suite of tools that used to be named SubDomain. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | AppArmor Parser to program przestrzeni użytkownika służący do | |
52 | wczytywania profili programów dla modułu bezpieczeństwa AppArmor jądra | |
53 | Linuksa. Ten pakiet jest częścią zestawu narzędzi nazywanych | |
54 | SubDomain. | |
55 | ||
56 | %prep | |
57 | %setup -q -n apparmor-%{version} | |
58 | %patch0 -p1 | |
59 | %patch1 -p1 | |
60 | %patch2 -p1 | |
61 | ||
62 | # avoid unnecessary rebuilding on install | |
63 | %{__sed} -i -e '/^\.PHONY: af_names.h/d' parser/Makefile | |
64 | %{__sed} -i -e '/^\.\(PHONY\|SILENT\): \$(AAREOBJECT)/d' parser/Makefile | |
65 | ||
66 | %build | |
67 | %{__make} -j1 -C parser \ | |
68 | CC="%{__cc}" \ | |
69 | CXX="%{__cxx}" \ | |
70 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
71 | %{?with_dynamic:AAREOBJECTS='$(AAREOBJECT)' AARE_LDFLAGS= AALIB=-lapparmor} \ | |
72 | USE_SYSTEM=1 | |
73 | ||
74 | %if %{with tests} | |
75 | %{__make} -j1 -C parser tests \ | |
76 | CC="%{__cc}" \ | |
77 | %{?with_dynamic:AAREOBJECTS='$(AAREOBJECT)' AARE_LDFLAGS=-lstdc++ AALIB=-lapparmor} \ | |
78 | USE_SYSTEM=1 | |
79 | %endif | |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/lib/apparmor,/var/cache/apparmor} | |
84 | ||
85 | %{__make} -C parser install \ | |
86 | DESTDIR=$RPM_BUILD_ROOT \ | |
87 | DISTRO=systemd \ | |
88 | SYSTEMD_UNIT_DIR=$RPM_BUILD_ROOT%{systemdunitdir} \ | |
89 | USE_SYSTEM=1 | |
90 | ||
91 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apparmor | |
92 | ||
93 | %find_lang %{name} | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %post | |
99 | /sbin/chkconfig --add apparmor | |
100 | ||
101 | %preun | |
102 | if [ "$1" = "0" ]; then | |
103 | /sbin/chkconfig --del apparmor | |
104 | fi | |
105 | ||
106 | %files -f %{name}.lang | |
107 | %defattr(644,root,root,755) | |
108 | %doc parser/README | |
109 | %attr(755,root,root) /sbin/apparmor_parser | |
110 | %attr(755,root,root) %{_sbindir}/aa-teardown | |
111 | %dir %{_sysconfdir}/apparmor | |
112 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/parser.conf | |
113 | %attr(754,root,root) /etc/rc.d/init.d/apparmor | |
114 | %{systemdunitdir}/apparmor.service | |
115 | %dir /lib/apparmor | |
116 | %attr(755,root,root) /lib/apparmor/profile-load | |
117 | /lib/apparmor/rc.apparmor.functions | |
118 | %attr(754,root,root) /lib/apparmor/apparmor.systemd | |
119 | %attr(700,root,root) %dir /var/cache/apparmor | |
120 | %dir /var/lib/apparmor | |
121 | %{_mandir}/man5/apparmor.d.5* | |
122 | %{_mandir}/man7/apparmor.7* | |
123 | %{_mandir}/man7/apparmor_xattrs.7* | |
124 | %{_mandir}/man8/aa-teardown.8* | |
125 | %{_mandir}/man8/apparmor_parser.8* |