packaing: Add WITH_SMACK option to switch smack feature 65/309465/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 5 Apr 2024 10:00:55 +0000 (19:00 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 11 Apr 2024 05:58:48 +0000 (14:58 +0900)
Add WITH_SMACK option to switch smack feature during compile time.
- If WITH_SMACK is 1, systemd requires SMACK feature for security.
- If WITH_SMACK is 0, systemd doesn't require SMACK feature.

Change-Id: I3da62402a8d2e8eb4c8b22aad7ea7afb92610aa3
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/systemd.spec

index 073ff31..fd3ad0f 100644 (file)
@@ -13,6 +13,7 @@
 %define WITH_DOC 0
 %define WITH_HOSTNAMED 0
 %define WITH_VIRT 1
+%define WITH_SMACK 1
 
 %define build_dir _build
 %define dbuspolicydir %{_datadir}/dbus-1
@@ -182,6 +183,9 @@ cp %{SOURCE8} .
 %define _vpath_builddir %{build_dir}
 %meson \
        -Dkdbus=true \
+%if ! 0%{?WITH_SMACK}
+       -Dsmack=false \
+%endif
 %if ! 0%{?WITH_VIRT}
        -Dvirt=false \
 %endif
@@ -228,7 +232,9 @@ cp %{SOURCE8} .
        -Drpmmacrosdir=%{_sysconfdir}/rpm/ \
        -Dsysvinit-path="" \
        -Dsysvrcnd-path="" \
+%if 0%{?WITH_SMACK}
        -Dsmack-run-label=System::Privileged \
+%endif
        -Dinstall-tests=true \
        -Ddefault-hierarchy=legacy \
        -Db_pie=true