kumquat-buildroot/package/setools/setools.mk

53 lines
2.0 KiB
Makefile
Raw Normal View History

################################################################################
#
# setools
#
################################################################################
SETOOLS_VERSION = 4.4.0
SETOOLS_SITE = $(call github,SELinuxProject,setools,$(SETOOLS_VERSION))
SETOOLS_DEPENDENCIES = libselinux libsepol python-setuptools host-bison host-flex host-python-cython host-swig
SETOOLS_INSTALL_STAGING = YES
SETOOLS_LICENSE = GPL-2.0+, LGPL-2.1+
SETOOLS_LICENSE_FILES = COPYING COPYING.GPL COPYING.LGPL
SETOOLS_CPE_ID_VENDOR = selinuxproject
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
SETOOLS_SETUP_TYPE = setuptools
HOST_SETOOLS_DEPENDENCIES = host-python3-cython host-libselinux host-libsepol host-python-networkx
HOST_SETOOLS_NEEDS_HOST_PYTHON = python3
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
define SETOOLS_FIX_SETUP
# By default, setup.py will look for libsepol.a in the host machines
# /usr/lib directory. This needs to be changed to the staging directory.
$(SED) "s@lib_dirs =.*@lib_dirs = ['$(STAGING_DIR)/usr/lib']@g" \
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
$(@D)/setup.py
endef
SETOOLS_POST_PATCH_HOOKS += SETOOLS_FIX_SETUP
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
define HOST_SETOOLS_FIX_SETUP
# By default, setup.py will look for libsepol.a in the host machines
# /usr/lib directory. This needs to be changed to the host directory.
$(SED) "s@lib_dirs =.*@lib_dirs = ['$(HOST_DIR)/lib']@g" \
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
$(@D)/setup.py
endef
HOST_SETOOLS_POST_PATCH_HOOKS += HOST_SETOOLS_FIX_SETUP
# apol requires pyqt5. However, the setools installation
# process will install apol even if pyqt5 is missing.
# Remove these scripts from the target it pyqt5 is not selected.
ifeq ($(BR2_PACKAGE_PYTHON_PYQT5),)
define SETOOLS_REMOVE_QT_SCRIPTS
$(RM) $(TARGET_DIR)/usr/bin/apol
$(RM) -r $(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/setoolsgui/
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
endef
SETOOLS_POST_INSTALL_TARGET_HOOKS += SETOOLS_REMOVE_QT_SCRIPTS
endif
# pyqt5 is not a host-package, remove apol from the host directory.
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
define HOST_SETOOLS_REMOVE_BROKEN_SCRIPTS
$(RM) $(HOST_DIR)/bin/apol
endef
HOST_SETOOLS_POST_INSTALL_HOOKS += HOST_SETOOLS_REMOVE_BROKEN_SCRIPTS
libsepol: bump to 2.7, setools: bump to 4.1.1 The reason for combining these patches is because the old version of setools is not compatible iwth libsepol 2.7. If a user where to do a git pull on a patch that only updates libsepol or setools, the build would fail to compile. setools has been completely rewritten in python instead of C. The current version of setools includes a few programs that require python-qt5 or python-networkx to run, however the package does not check to see if these exist when compiling, and will install the scripts to the target directory even if they don't exist. In the case of python-networkx, this package is not available on Buildroot. The scripts that require them are: sedta and seinfoflow. In the case of python-qt5, qpol is the script that requires it. Some setools.mk notes to get the package to compile: - Convert the package .mk to use python-package instead of autotools-package. - setup.py hard codes base_lib_dirs to point to several host directories. To fix this, sed is used before compiling to point the base_lib_dirs to the staging directory. - setup.py also includes the "Werror" flag, however compilers before gcc6 cause a few autogenerated variables to not be initialized before use, causing the build to fail. To fix this, a patch is provided that removes the Werror flag. - Remove sedta and seinfoflow from the target system after install. These packages rely on the package python-networkx which is not available in buildroot. - Remove the installed apol package and the setoolsgui directory from the target directory if python-qt5 is not selected. Other changes: - Removed all patches, as they are not compatible with the new version of setools. - Add COPYING, COPYING.GPL, and COPYING.LGPL to setools.hash Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-10-18 00:32:16 +02:00
$(eval $(python-package))
$(eval $(host-python-package))