Giter VIP home page Giter VIP logo

Comments (5)

matthew-l-weber avatar matthew-l-weber commented on July 23, 2024

#52

from selinux.

fishilico avatar fishilico commented on July 23, 2024

$(DESTDIR) is used by packagers to install libselinux in a directory from which a package archive is crafted (for example with fakeroot and tar). For example when $(DESTDIR) is /tmp/makepkg/libselinux/pkg and the system uses Python 3.6, $(PYSITEDIR) is defined as /tmp/makepkg/libselinux/pkg/usr/lib/python3.6/site-packages and make install-pywrap installs the Python libselinux wrappers in this directory.

Therefore what you describe is actually the expected behavior of $(DESTDIR) unless I missed something. How are you using $(DESTDIR)?

from selinux.

matthew-l-weber avatar matthew-l-weber commented on July 23, 2024

I execute the following as part of a build with Buildroot building libselinux as a host tool used for policy debugging.

# Install python interface wrapper
PATH="/home/user/powerpc_defconfig/host/bin:/home/user/powerpc_defconfig/host/sbin:/home/user/powerpc_defconfig/host/usr/bin:/home/user/powerpc_defconfig/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" PKG_CONFIG="/home/user/powerpc_defconfig/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/user/powerpc_defconfig/host/usr/lib/pkgconfig:/home/user/powerpc_defconfig/host/usr/share/pkgconfig" /usr/bin/make -j64 -C /home/user/powerpc_defconfig/build/host-libselinux-2.6 PATH="/home/user/powerpc_defconfig/host/bin:/home/user/powerpc_defconfig/host/sbin:/home/user/powerpc_defconfig/host/usr/bin:/home/user/powerpc_defconfig/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" PKG_CONFIG="/home/user/powerpc_defconfig/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/user/powerpc_defconfig/host/usr/lib/pkgconfig:/home/user/powerpc_defconfig/host/usr/share/pkgconfig" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/user/powerpc_defconfig/host/usr/include" CFLAGS="-O2 -I/home/user/powerpc_defconfig/host/usr/include" CXXFLAGS="-O2 -I/home/user/powerpc_defconfig/host/usr/include" LDFLAGS="-L/home/user/powerpc_defconfig/host/lib -L/home/user/powerpc_defconfig/host/usr/lib -Wl,-rpath,/home/user/powerpc_defconfig/host/usr/lib" INTLTOOL_PERL=/usr/bin/perl LDFLAGS="-L/home/user/powerpc_defconfig/host/lib -L/home/user/powerpc_defconfig/host/usr/lib -Wl,-rpath,/home/user/powerpc_defconfig/host/usr/lib -lpcre -lpthread" PYINC="-I/home/user/powerpc_defconfig/host/usr/include/python3.6m/" PYTHONLIBDIR="-L/home/user/powerpc_defconfig/host/usr/lib/python3.6/" PYLIBVER="python3.6" SWIG_LIB="/home/user/powerpc_defconfig/host/usr/share/swig/3.0.10/" DESTDIR=/home/user/powerpc_defconfig/host install-pywrap
/usr/bin/make -C src install-pywrap
test -d /home/user/powerpc_defconfig/host/home/user/powerpc_defconfig/host/usr/lib/python3.6/site-packages/selinux || install -m 755 -d /home/user/powerpc_defconfig/host/home/user/powerpc_defconfig/host/usr/lib/python3.6/site-packages/selinux
install -m 755 python_selinux.so /home/user/powerpc_defconfig/host/home/user/powerpc_defconfig/host/usr/lib/python3.6/site-packages/_selinux.so
install -m 755 pythonaudit2why.so /home/user/powerpc_defconfig/host/home/user/powerpc_defconfig/host/usr/lib/python3.6/site-packages/selinux/audit2why.so
install -m 644 selinux.py /home/user/powerpc_defconfig/host/home/user/powerpc_defconfig/host/usr/lib/python3.6/site-packages/selinux/__init__.py
``` 

from selinux.

fishilico avatar fishilico commented on July 23, 2024

It seems that the Buildroot Makefile (https://git.busybox.net/buildroot/tree/package/libselinux/libselinux.mk?id=f4ba984ade64541fdfbfaa15a4aebed67c41abbf) defines many variables in order to build in a directory. Why is PYSITEDIR not defined too?
More precisely, it currently defines PYLIBVER which has been removed when PYSITEDIR has been introduced, in 8162f10. Defining PYSITEDIR to /usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages in Buildroot's libselinux.mk should solve the issue you have.

from selinux.

matthew-l-weber avatar matthew-l-weber commented on July 23, 2024

from selinux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.