Skip to content

Commit

Permalink
libselinux: Add separate patch file and fix build process.
Browse files Browse the repository at this point in the history
Added a separate (git) patch file and appropriate use of it in spec
file. Modified the spec file to set correct dirs for make.
  • Loading branch information
LaakkonenJussi committed Oct 16, 2018
1 parent d0af4d3 commit 2db9ea0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpm/libselinux.spec
Expand Up @@ -39,7 +39,7 @@ Source: %{name}-%{version}.tar.bz2
#Source1: selinuxconlist.8
#Source2: selinuxdefcon.8
Url: https://github.com/SELinuxProject/selinux/wiki
Patch1: ln_old_coreutils.patch
Patch1: ln_old_coreutils_libselinux.patch
BuildRequires: libsepol-static >= %{libsepolver} swig xz-devel python3-base python3-devel pcre-devel
BuildRequires: systemd
# we don't build python2 modules, but make clean expects python2 (could be patched out though)
Expand Down Expand Up @@ -105,7 +105,7 @@ needed for developing SELinux applications.

%prep
%setup -q -n %{name}-%{version}/upstream
%patch1
%patch1 -p1

%build
# only build libsepol
Expand Down Expand Up @@ -166,7 +166,7 @@ echo "d %{_rundir}/setrans 0755 root root" > %{buildroot}%{_tmpfilesdir}/libseli

InstallPythonWrapper %{__python3}

make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}%{_libdir}" BINDIR="%{buildroot}%{_bindir}" SBINDIR="%{buildroot}%{_sbindir}" install
make DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}" install

# Nuke the files we don't want to distribute
rm -f %{buildroot}%{_sbindir}/compute_*
Expand Down
14 changes: 14 additions & 0 deletions rpm/ln_old_coreutils_libselinux.patch
@@ -0,0 +1,14 @@
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 977b5c8..5da105b 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -190,7 +190,8 @@ install: all
install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
- ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
+ # Since --relative is not present in ln provided by our coreutils use lib.so directly in ln
+ ln -sf $(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)

install-pywrap: pywrap
test -d $(DESTDIR)$(PYTHONLIBDIR)/selinux || install -m 755 -d $(DESTDIR)$(PYTHONLIBDIR)/selinux

0 comments on commit 2db9ea0

Please sign in to comment.