diff --git a/README.md b/README.md deleted file mode 100644 index 7342728d557c602f51c6d278bba9f3dd9faaf356..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Anolis OS -======================================= -# 代码仓库说明 -## 分支说明 ->进行代码开发工作时,请注意选择当前版本对应的分支 -* aX分支为对应大版本的主分支,如a8分支对应当前最新版本 -* aX.Y分支为对应小版本的维护分支,如a8.2分支对应8.2版本 -## 开发流程 -1. 首先fork目标分支到自己的namespace -2. 在自己的fork分支上做出修改 -3. 向对应的仓库中提交merge request,源分支为fork分支 diff --git a/libselinux-3.3.tar.gz b/libselinux-3.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..200b297e794cdbff714e03bf2647e045720b5404 Binary files /dev/null and b/libselinux-3.3.tar.gz differ diff --git a/libselinux.spec b/libselinux.spec new file mode 100644 index 0000000000000000000000000000000000000000..108116313a8fab09e36f89d6388cf50e972190b3 --- /dev/null +++ b/libselinux.spec @@ -0,0 +1,144 @@ +Name: libselinux +Version: 3.3 +Release: 1%{?dist} +Summary: SELinux library and simple utilities + +License: Public Domain +URL: https://github.com/SELinuxProject/selinux/wiki +Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc make systemd python3 python3-devel ruby-devel ruby libsepol-static swig pcre2-devel xz-devel +Requires: libsepol%{?_isa} pcre2 + +%description +Security-enhanced Linux is a feature of the Linux® kernel and a number +of utilities with enhanced security functionality designed to add +mandatory access controls to Linux. The Security-enhanced Linux +kernel contains new architectural components originally developed to +improve the security of the Flask operating system. These +architectural components provide general support for the enforcement +of many kinds of mandatory access control policies, including those +based on the concepts of Type Enforcement®, Role-based Access +Control, and Multi-level Security. + +libselinux provides an API for SELinux applications to get and set +process and file security contexts and to obtain security policy +decisions. Required for any applications that use the SELinux API. + +%package utils +Summary: SELinux libselinux utilities +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description utils +The libselinux-utils package contains the utilities + +%package -n python3-libselinux +Summary: SELinux python 3 bindings for libselinux +Requires: %{name}%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-libselinux} +# Remove before F30 +Provides: %{name}-python3 = %{version}-%{release} +Provides: %{name}-python3%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python3 < %{version}-%{release} + +%description -n python3-libselinux +The libselinux-python3 package contains python 3 bindings for developing +SELinux applications. + +%package ruby +Summary: SELinux ruby bindings for libselinux +Requires: %{name}%{?_isa} = %{version}-%{release} +Provides: ruby(selinux) + +%description ruby +The libselinux-ruby package contains the ruby bindings for developing +SELinux applications. + +%package devel +Summary: Header files and libraries used to build SELinux +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: libsepol-devel%{?_isa} >= 3.3-1 + +%description devel +The libselinux-devel package contains the libraries and header files +needed for developing SELinux applications. + +%package static +Summary: Static libraries used to build SELinux +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +The libselinux-static package contains the static libraries +needed for developing SELinux applications. + + +%prep +%autosetup + + +%build + +export DISABLE_RPM="y" +export USE_PCRE2="y" + +%set_build_flags +CFLAGS="$CFLAGS -fno-semantic-interposition" + +%make_build LIBDIR="%{_libdir}" swigify +%make_build LIBDIR="%{_libdir}" all +%make_build PYTHON=%{__python3} LIBDIR="%{_libdir}" pywrap +%make_build RUBYINC=%(pkg-config --cflags ruby) SHLIBDIR="%{_libdir}" LIBDIR="%{_libdir}" LIBSEPOLA="%{_libdir}/libsepol.a" rubywrap + + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p %{buildroot}%{_tmpfilesdir} +mkdir -p %{buildroot}%{_libdir} +mkdir -p %{buildroot}%{_includedir} +mkdir -p %{buildroot}%{_sbindir} +install -d -m 0755 %{buildroot}%{_rundir}/setrans +echo "d %{_rundir}/setrans 0755 root root" > %{buildroot}%{_tmpfilesdir}/libselinux.conf +make PYTHON=%{__python3} DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}" LIBSEPOLA="%{_libdir}/libsepol.a" install-pywrap +%make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" + +make DESTDIR="%{buildroot}" RUBYINSTALL=%{ruby_vendorarchdir} install-rubywrap + +rm -f %{buildroot}%{_sbindir}/{compute_*,deftype,execcon,getenforcemode,getfilecon,getfilecon,getpidcon,mkdircon,policyvers,setfilecon,selinuxconfig,getseuser,togglesebool,selinux_check_securetty_context} +mv %{buildroot}%{_sbindir}/getdefaultcon %{buildroot}%{_sbindir}/selinuxdefcon +mv %{buildroot}%{_sbindir}/getconlist %{buildroot}%{_sbindir}/selinuxconlist + +%ldconfig_scriptlets + +%files +%license LICENSE +%{_libdir}/libselinux.so.* +%dir %{_rundir}/setrans/ +%{_tmpfilesdir}/libselinux.conf + +%files utils +%{_sbindir}/* +%{_mandir}/man5/* +%{_mandir}/man8/* +%{_mandir}/ru/man5/* +%{_mandir}/ru/man8/* + +%files devel +%{_libdir}/libselinux.so +%{_libdir}/pkgconfig/libselinux.pc +%{_includedir}/selinux/ +%{_mandir}/man3/* + +%files static +%{_libdir}/libselinux.a + +%files -n python3-libselinux +%{python3_sitearch}/selinux/ +%{python3_sitearch}/selinux-%{version}* +%{python3_sitearch}/_selinux* + +%files ruby +%{ruby_vendorarchdir}/selinux.so + +%changelog +* Thu Mar 10 2022 forrest_ly - 3.3-1 +- Init for Anolis OS 23