Skip to content

Commit

Permalink
Add make pkginfo function.
Browse files Browse the repository at this point in the history
Use `make pkginfo` to export package information in bash variables compatible format for integration automation purposes.
  • Loading branch information
shadinua committed Jan 18, 2018
1 parent e4efcb3 commit 4409fd1
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions Makefile
Expand Up @@ -49,6 +49,7 @@ PRINT_WARNING_ = printf "$(WARN_STRING)\n" | $(AWK_CMD) && printf "$(CMD)\n$$LOG
BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -eq 1 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
BUILD_CMD_ = LOG=$$($(CMD) 2>&1) ; if [ $$? -eq 1 ]; then $(PRINT_ERROR_); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_); else $(PRINT_OK_); fi;

PKGINFO_PATH = PKGINFO

UNAME=$(shell uname)

Expand Down Expand Up @@ -501,7 +502,7 @@ else
NAME_SUFFIX = $(RPM_VERSION).$(OS_NAME)$(OS_VERSION).$(ARCHITECTURE).rpm
endif

PACKAGE_NAME = themis
PACKAGE_NAME = libthemis
PACKAGE_CATEGORY = security
SHORT_DESCRIPTION = Data security library for network communication and data storage
RPM_SUMMARY = Data security library for network communication and data storage. \
Expand Down Expand Up @@ -548,15 +549,15 @@ deb: test soter_static themis_static soter_shared themis_shared collect_headers
#libPACKAGE-dev
@fpm --input-type dir \
--output-type deb \
--name lib$(PACKAGE_NAME)-dev \
--name $(PACKAGE_NAME)-dev \
--license $(LICENSE_NAME) \
--url '$(COSSACKLABS_URL)' \
--description '$(SHORT_DESCRIPTION)' \
--maintainer $(MAINTAINER) \
--package $(BIN_PATH)/deb/lib$(PACKAGE_NAME)-dev_$(NAME_SUFFIX) \
--package $(BIN_PATH)/deb/$(PACKAGE_NAME)-dev_$(NAME_SUFFIX) \
--architecture $(DEBIAN_ARCHITECTURE) \
--version $(VERSION)+$(OS_CODENAME) \
$(DEBIAN_DEPENDENCIES) --depends "lib$(PACKAGE_NAME) = $(VERSION)+$(OS_CODENAME)" \
$(DEBIAN_DEPENDENCIES) --depends "$(PACKAGE_NAME) = $(VERSION)+$(OS_CODENAME)" \
--deb-priority optional \
--after-install $(POST_INSTALL_SCRIPT) \
--after-remove $(POST_UNINSTALL_SCRIPT) \
Expand All @@ -566,12 +567,12 @@ deb: test soter_static themis_static soter_shared themis_shared collect_headers
#libPACKAGE
@fpm --input-type dir \
--output-type deb \
--name lib$(PACKAGE_NAME) \
--name $(PACKAGE_NAME) \
--license $(LICENSE_NAME) \
--url '$(COSSACKLABS_URL)' \
--description '$(SHORT_DESCRIPTION)' \
--maintainer $(MAINTAINER) \
--package $(BIN_PATH)/deb/lib$(PACKAGE_NAME)_$(NAME_SUFFIX) \
--package $(BIN_PATH)/deb/$(PACKAGE_NAME)_$(NAME_SUFFIX) \
--architecture $(DEBIAN_ARCHITECTURE) \
--version $(VERSION)+$(OS_CODENAME) \
$(DEBIAN_DEPENDENCIES) \
Expand All @@ -590,23 +591,23 @@ rpm: test themis_static themis_shared soter_static soter_shared collect_headers
#libPACKAGE-devel
@fpm --input-type dir \
--output-type rpm \
--name lib$(PACKAGE_NAME)-devel \
--name $(PACKAGE_NAME)-devel \
--license $(LICENSE_NAME) \
--url '$(COSSACKLABS_URL)' \
--description '$(SHORT_DESCRIPTION)' \
--rpm-summary '$(RPM_SUMMARY)' \
$(RPM_DEPENDENCIES) --depends "lib$(PACKAGE_NAME) = $(RPM_VERSION)-$(RPM_RELEASE_NUM)" \
$(RPM_DEPENDENCIES) --depends "$(PACKAGE_NAME) = $(RPM_VERSION)-$(RPM_RELEASE_NUM)" \
--maintainer $(MAINTAINER) \
--after-install $(POST_INSTALL_SCRIPT) \
--after-remove $(POST_UNINSTALL_SCRIPT) \
--package $(BIN_PATH)/rpm/lib$(PACKAGE_NAME)-devel-$(NAME_SUFFIX) \
--package $(BIN_PATH)/rpm/$(PACKAGE_NAME)-devel-$(NAME_SUFFIX) \
--version $(RPM_VERSION) \
--category $(PACKAGE_CATEGORY) \
$(HEADER_FILES_MAP)
#libPACKAGE
@fpm --input-type dir \
--output-type rpm \
--name lib$(PACKAGE_NAME) \
--name $(PACKAGE_NAME) \
--license $(LICENSE_NAME) \
--url '$(COSSACKLABS_URL)' \
--description '$(SHORT_DESCRIPTION)' \
Expand All @@ -615,9 +616,22 @@ rpm: test themis_static themis_shared soter_static soter_shared collect_headers
--after-install $(POST_INSTALL_SCRIPT) \
--after-remove $(POST_UNINSTALL_SCRIPT) \
$(RPM_DEPENDENCIES) \
--package $(BIN_PATH)/rpm/lib$(PACKAGE_NAME)-$(NAME_SUFFIX) \
--package $(BIN_PATH)/rpm/$(PACKAGE_NAME)-$(NAME_SUFFIX) \
--version $(RPM_VERSION) \
--category $(PACKAGE_CATEGORY) \
$(BINARY_LIBRARY_MAP)
# it's just for printing .rpm files
@find $(BIN_PATH) -name \*.rpm

define PKGINFO
PACKAGE=$(PACKAGE_NAME)
SECTION=$(PACKAGE_CATEGORY)
MAINTAINER=$(MAINTAINER)
VERSION=$(VERSION)
HOMEPAGE=$(COSSACKLABS_URL)
LICENSE=$(LICENSE_NAME)
DESCRIPTION="$(SHORT_DESCRIPTION)"
endef
export PKGINFO
pkginfo:
@echo "$$PKGINFO" > $(PKGINFO_PATH)

0 comments on commit 4409fd1

Please sign in to comment.