Package Details: libselinux 2.8-1

Git Clone URL: (read-only)
Package Base: libselinux
Description: SELinux library and simple utilities
Upstream URL:
Keywords: selinux
Licenses: custom
Groups: selinux
Conflicts: selinux-usr-libselinux
Provides: selinux-usr-libselinux=2.8-1
Submitter: Siosm
Maintainer: IooNag
Last Packager: IooNag
Votes: 92
Popularity: 2.612594
First Submitted: 2013-11-03 20:05
Last Updated: 2018-05-26 16:44

Latest Comments

IooNag commented on 2017-06-02 11:48

netrunn3r: if I correctly understand, the issue you report comes from the fact that pkg-config does not use the same Ruby version as the one from your shell environment. However I fail to see the point of building the package with a non-system ruby command. Such a setup would build and install Ruby packages for a Ruby version which is different from the system one (eg. it would put files in the "wrong" system directory, like /usr/lib/ruby/2.3.0/ instead of /usr/lib/ruby/2.4.0/)...

Actually it makes sense to define RUBY=/usr/bin/ruby (and use the full paths for PYTHON definitions too) in the PKGBUILD in order to ensure the package is built with the packaged (system-wide) Ruby. Could you please add "RUBY=/usr/bin/ruby" to these lines:
* make rubywrap
* make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib install-rubywrap"
... and tell whether this fixed your issue?

netrunn3r commented on 2017-06-02 08:52

I had the same problem which cminus. Problem was with this two lines:
RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
RUBYINC ?= $(shell $(PKG_CONFIG) --exists ruby-$(RUBYLIBVER) && $(PKG_CONFIG) --cflags ruby-$(RUBYLIBVER) || $(PKG_CONFIG) --cflags ruby)

First one return wrong version:
[netrunner@nightcity] libselinux $ ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")'

Where I have installed 2.4:
[netrunner@nightcity] libselinux $ pacman -Qi ruby
Name : ruby
Version : 2.4.1-3

pkg-config confirm that:
[netrunner@nightcity] libselinux $ pkg-config --exists ruby-2.3 ; echo $?
[netrunner@nightcity] libselinux $ pkg-config --exists ruby-2.4 ; echo $?

So variable $RUBYINC is empty and my cc looks like that (without /usr/include/ruby-2.4)
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -I../include -I/usr/include -D_GNU_SOURCE -DDISABLE_RPM -DNO_ANDROID_BACKEND -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations -fPIC -DSHARED -c -o selinuxswig_ruby_wrap.lo selinuxswig_ruby_wrap.c

This happen because I also have rvm and I had set default ruby version to 2.3:
[netrunner@nightcity] libselinux $ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
[netrunner@nightcity] libselinux $ rvm list
rvm rubies

=* ruby-2.3.3 [ x86_64 ]

# => - current
# =* - current && default
# * - default

As you see, I don't had 2.4. After installing and setting as default version 2.4:
[netrunner@nightcity] libselinux $ /bin/bash --login # needed for installing ruby with rvm
[netrunner@nightcity] libselinux $ rvm install ruby-2.4.1
[netrunner@nightcity] libselinux $ rvm list

rvm rubies

* ruby-2.3.3 [ x86_64 ]
=> ruby-2.4.1 [ x86_64 ]

# => - current
# =* - current && default
# * - default
[netrunner@nightcity] libselinux $ rvm --default use 2.4.1

[netrunner@nightcity] libselinux $ rvm list

rvm rubies

ruby-2.3.3 [ x86_64 ]
=* ruby-2.4.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
[netrunner@nightcity] libselinux $ makepkg # still in login shell

libselinux build successfully.

Maybe use something like that:
pacman -Q ruby | cut -d ' ' -f 2 | cut -d '.' -f 1,2
to get ruby version?

cminus commented on 2017-02-19 22:53

I am not sure what happened, but it worked and got installed..
PS: I have removed old rvm and let the process continue.. I am not sure how this relates to the system-installed ruby..
Kinda strange

Here there are the current outputs of the lines you requested

Arch% echo $RUBY
# Blank line

Arch% ${RUBY:-ruby} -e 'print RUBY_VERSION.split(".")[0..1].join(".")'

Arch% pkg-config --cflags ruby-2.4
-I/usr/include/ruby-2.4.0/x86_64-linux -I/usr/include/ruby-2.4.0

Arch% ls /usr/include/ruby-2.4.0/
ruby ruby.h x86_64-linux

IooNag commented on 2017-02-19 22:05

cminus: what is the compiler line right before your error? Is it "cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -I../include -I/usr/include -D_GNU_SOURCE -DDISABLE_RPM -DNO_ANDROID_BACKEND -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations -I/usr/include/ruby-2.4.0/x86_64-linux -I/usr/include/ruby-2.4.0 -fPIC -DSHARED -c -o selinuxswig_ruby_wrap.lo selinuxswig_ruby_wrap.c"?

Also I am interested in the result of these commands on your system (the second and the third ones are used by libselinux Makefile to find where Ruby header files are installed):
* echo $RUBY
* ${RUBY:-ruby} -e 'print RUBY_VERSION.split(".")[0..1].join(".")'
* pkg-config --cflags ruby-2.4
* ls /usr/include/ruby-2.4.0/

cminus commented on 2017-02-19 21:50

I have this error and I don't know how to resolve..
Any help will be appreciated.

selinuxswig_ruby_wrap.c:855:18: fatal error: ruby.h: No such file or directory
#include <ruby.h>

IooNag commented on 2016-10-20 07:16

chrisbdaemon: pkg-config is in base-devel, which has to be installed before building any AUR package (cf. Hence I won't add it to makedepends.

chrisbdaemon commented on 2016-10-19 19:24

Can pkg-config be added to the list of makedepends as well?

v1rous commented on 2016-02-07 17:50

Not sure if this is helpful or not, but I was able to build and install this package and its dependency libsepol on armv7h (RPi 2).

IooNag commented on 2015-07-23 12:02

Thanks for your comment, but actually it is not libselinux which requires flex to be built but libsepol and libsemanage. I've just added "flex" to their makedepends.

nebulon commented on 2015-07-20 12:02

The package dependencies are missing 'flex' currently.

grondinm commented on 2015-01-01 19:14

works now thank you

IooNag commented on 2014-12-31 13:39

I updated the PKGBUILD to use /usr/bin instead of /usr/sbin and while at it cleaned up a few things ( ). Does it work better?

grondinm commented on 2014-12-31 01:55

Wont install for me

error: failed to commit transaction (conflicting files)
libselinux: /usr/sbin exists in filesystem
Errors occurred, no packages were upgraded.

IooNag commented on 2014-09-16 06:10

Upstream moved to GitHub a few weeks ago ( and link "Wiki"->"Release").

I've patched SELinux PKGBUILDs in GitHub:
Waiting for maintainer to update AUR packages.


s4ncho commented on 2014-09-15 18:47

source url doesn't exist.

correct path:

please correct pkgbuild.

IooNag commented on 2014-05-23 12:50

As following Fedora patch changes is quite painful, I'd like to drop this patch from the package. Moreover, it contains some changes which have explicitly been rejected by upstream ( If people are interested in the Go port, please report it upstream.

For users who are interested in testing libselinux 2.3 (without the Fedora patch) before the package is updated, the new PKGBUILD is waiting for testers on

Chocobozzz commented on 2014-05-23 09:30

Thank's Alda but sha256sum changed (line 27) :


Alda commented on 2014-02-20 07:38

PKGBUILD is currently broken, here is the patch to make it work again:

< 'd60265f59b7fca51724e401f0ff4d1bbb9ad790ba9595ed4534942b286a7a1e4'
> '4078b4a8fd94f529cd64bf465bacf0acd2c108edc28a5d73a619857c00104a32'
< sed -i 's|pkg-config --cflags ruby|pkg-config --cflags ruby-2.0|' src/Makefile
> sed -i 's|pkg-config --cflags ruby|pkg-config --cflags ruby-2.1|' src/Makefile

errier commented on 2014-01-13 19:50

I second RobertGasteins comment! Please add armv6h arch to PKGBUILD.

Siosm commented on 2014-01-02 21:47

Renamed to libselinux

Anonymous comment on 2013-08-11 11:22

I have installed it on my Raspberry by adding armv6h to PKGBUILD,
because i need this package for the seafile-server!
Is it possible to add armv6h to the install script for this package!?

Nicky726 commented on 2013-07-20 17:22

Thank you, added the patch you mentioned.

hi117 commented on 2013-06-10 20:01

Package is broken due to known issue involving a Fedora specific patch being sent upstream, Gentoo has a patch to fix it, here is a diff to apply their patch if licencing permits.
--- a/PKGBUILD 2013-06-10 16:00:39.701454119 -0400
+++ b/PKGBUILD 2013-06-10 16:00:44.051506513 -0400
@@ -16,14 +16,19 @@
+ 'd71f0923c7bd7cce8d3d305865736aa56d4038de319a1d016582f1470108cb07')

build() {
cd "${srcdir}/${_origname}-${pkgver}"

CFLAGS="${CFLAGS} -lpcre -pthread"

+ # Add gentoo patches for fedora specific functions
+ patch -p1 < "${srcdir}/gentoo-patches/0006-introduce-selinux_current_policy_path-from-fedora-needed-by-policycoreutils.patch"
# Set python version
sed -i -e "s/ python/ python2/" src/Makefile
sed -i -e "s/PYLIBDIR ?= \$(LIBDIR)\/\$(PYLIBVER)/PYLIBDIR ?=\$(LIBDIR)\/python2.7/g" "src/Makefile"

Nicky726 commented on 2013-02-25 10:29

Thanx, added.

xangelux commented on 2013-02-24 10:13

audit2allow and practically every python utility doesn't work, I found a workaround for it, add this sed in the build process:

sed -i -e "s/PYLIBDIR ?= \$(LIBDIR)\/\$(PYLIBVER)/PYLIBDIR ?= \$(LIBDIR)\/python2.7/g" "src/Makefile"

Nicky726 commented on 2013-02-20 20:51

So I added a feature request:

Nicky726 commented on 2013-02-20 20:33

Oh, I see. It's that python issue. Quick workaround is:
# cd /usr/lib/pkgconfig/
# ln -s python-2.7.pc python2.pc
I think I did requested python2 maintainers to add the link, but apparently I did not... Will do now.

Nicky726 commented on 2013-02-20 20:21

Strange, I built it on 64bit system like 10 days ago. I'll look into it later, if I can reproduce it.

dejavu commented on 2013-02-20 19:05

Doesn't build on 64 bit:

cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -lpcre -I../include -D_GNU_SOURCE -Wl,-O1,--sort-common,--as-needed,-z,relro avcstat.c -L../src -lselinux -L/usr/lib -o avcstat
make[1]: Leaving directory `/tmp/yaourt-tmp-root/aur-selinux-usr-libselinux/src/libselinux-2.1.12/utils'
make[1]: Entering directory `/tmp/yaourt-tmp-root/aur-selinux-usr-libselinux/src/libselinux-2.1.12/man'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/yaourt-tmp-root/aur-selinux-usr-libselinux/src/libselinux-2.1.12/man'
make -C src pywrap pywrap
make[1]: Entering directory `/tmp/yaourt-tmp-root/aur-selinux-usr-libselinux/src/libselinux-2.1.12/src'
bash > selinuxswig_python_exception.i
Package python2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `python2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python2' found
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -lpcre -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -DSHARED -c -o python2audit2why.lo audit2why.c
audit2why.c:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
make[1]: *** [python2audit2why.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/tmp/yaourt-tmp-root/aur-selinux-usr-libselinux/src/libselinux-2.1.12/src'
make: *** [pywrap] Error 2
==> ERROR: A failure occurred in build().
==> ERROR: Makepkg was unable to build selinux-usr-libselinux.
==> Restart building selinux-usr-libselinux ? [y/N]

xangelux commented on 2013-02-17 18:20

Yeah, that was fine, I forgot to delete that part when I was testing what the issue was

Nicky726 commented on 2013-02-17 12:50

So it's the -lpcre in CFLAGS... OK, addopted. I'm not sure though whats the use of buildflags in options, since I think that is default and of the -L/usr/local/lib in CFLAGS, since I have that directory empty and manage to build the package fine.

So from now SELinux userspace is updated to the release of 2012-09-24.

Nicky726 commented on 2013-02-17 10:55

I updated whole SELinux userspace to the release of 2012-02-16 which should build fine, so the dependency for selinux-systemd is satisfied. There is a newer release of 2012-09-24, but I'm still failing to build that for some of the SELinux userspace packages. Now I am stuck with selinux-usr-libselinux, which fail to build due to pcre, though it is installed. Don't quite get it... The trouble with SELinux userspace of 2012-02-16 is that it fails to load the policy for me...

xangelux commented on 2013-02-12 20:58

Updated it, hope it's fine:

xangelux commented on 2013-02-12 20:57

Updated it, hope it's fine: