# -*-makefile-*-
#
# Copyright (C) 2019 by WMSC
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_LIBSEPOL) += libsepol

#
# Paths and names
#
LIBSEPOL_VERSION        := 2.8
LIBSEPOL_MD5            := a7a8f0e4e2818000a546b030c15b8401
LIBSEPOL                := libsepol_$(LIBSEPOL_VERSION)
LIBSEPOL_SUFFIX         := orig.tar.gz
LIBSEPOL_URL            := http://cdn-fastly.deb.debian.org/debian/pool/main/libs/libsepol/$(LIBSEPOL).$(LIBSEPOL_SUFFIX)
LIBSEPOL_SOURCE         := $(SRCDIR)/$(LIBSEPOL).$(LIBSEPOL_SUFFIX)
LIBSEPOL_DIR            := $(BUILDDIR)/$(LIBSEPOL)
LIBSEPOL_LICENSE        := LGPL2.1

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

#$(LIBSEPOL_SOURCE):
#       @$(call targetinfo)
#       @$(call get, LIBSEPOL)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

#
# autoconf
#
LIBSEPOL_CONF_TOOL      := NO
#LIBSEPOL_CONF_OPT      := $(CROSS_AUTOCONF_USR)

#$(STATEDIR)/libsepol.prepare:
#       @$(call targetinfo)
#       @$(call clean, $(LIBSEPOL_DIR)/config.cache)
#       cd $(LIBSEPOL_DIR) && \
#               $(LIBSEPOL_PATH) $(LIBSEPOL_ENV) \
#               ./configure $(LIBSEPOL_CONF_OPT)
#       @$(call touch)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

LIBSEPOL_MAKE_ENV := $(CROSS_ENV)

LIBSEPOL_MAKE_OPT := \
                -Wno-error=shadow

#$(STATEDIR)/libsepol.compile:
#       @$(call targetinfo)
#       @$(call world/compile, LIBSEPOL)
#       @$(call touch)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

#$(STATEDIR)/libsepol.install:
#       @$(call targetinfo)
#       @$(call world/install, LIBSEPOL)
#       @$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/libsepol.targetinstall:
        @$(call targetinfo)

        @$(call install_init, libsepol)
        @$(call install_fixup, libsepol,PRIORITY,optional)
        @$(call install_fixup, libsepol,SECTION,base)
        @$(call install_fixup, libsepol,AUTHOR,"WMSC")
        @$(call install_fixup, libsepol,DESCRIPTION,missing)

        @$(call install_lib, libsepol, 0, 0, 0644, libsepol)
        @$(call install_finish, libsepol)

        @$(call touch)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

#$(STATEDIR)/libsepol.clean:
#       @$(call targetinfo)
#       @$(call clean_pkg, LIBSEPOL)

# vim: syntax=make
