
Name: secpaver
Summary: Security policy development tool
Version: 1.0.2
Release: 1
License: Mulan PSL v2
URL: https://gitee.com/openeuler/secpaver
Source: https://gitee.com/openeuler/secpaver/repository/archive/%{name}-%{version}.tar.gz

BuildRequires: golang make

%define  debug_package %{nil}

%description
Security policy development tool

%package selinux
Summary: SELinux plugin for secPaver
License: MuLan PSL v2
BuildRequires: libselinux-devel libsepol-devel libsemanage-devel
Requires: %{name} = %{version}-%{release}
Requires: libselinux libsepol libsemanage checkpolicy policycoreutils

%description selinux
SELinux plugin for secPaver.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%make_build everything

%install
%make_install DESTDIR="%{buildroot}"

%check

%files
%defattr(0600,root,root,0700)
%attr(0700,root,root) %{_bindir}/pav
%attr(0700,root,root) %{_bindir}/pavd
%dir %{_sysconfdir}/secpaver
%dir %{_sysconfdir}/secpaver/pavd
%dir %{_libdir}/secpaver
%dir %{_datadir}/secpaver
%dir %{_datadir}/secpaver/scripts
%dir %{_localstatedir}/local/secpaver
%dir %{_localstatedir}/local/secpaver/policies
%dir %{_localstatedir}/local/secpaver/projects
%config(noreplace) %{_sysconfdir}/secpaver/pavd/config.json
%{_unitdir}/pavd.service

%files selinux
%defattr(0600,root,root,0700)
%attr(0700,root,root) %{_libdir}/secpaver/selinux.so
%dir %{_localstatedir}/local/secpaver/policies/selinux
%dir %{_datadir}/secpaver/scripts/selinux
%{_datadir}/secpaver/scripts/selinux/config
%attr(0700,root,root) %{_datadir}/secpaver/scripts/selinux/*.sh

%post
%systemd_post pavd.service

%preun
%systemd_preun pavd.service

%postun
%systemd_postun_with_restart pavd.service

%changelog
* Thu Sep 30 2021 luhuaxin <1539327763@qq.com> - 1.0.2-1
- Package init
