forked from buildroot/buildroot
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from WebPlatformForEmbedded/agebicz/packager/4
Add possibility to generate DEBIAN 2.0 binary packages from the Buildroot
- Loading branch information
Showing
8 changed files
with
273 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# directory name that will hold temporary package generation files | ||
SIMPLE_OPKG_TOOLS_TEMP_FILENAME=package.tmp | ||
# directory where generated packages will be installed | ||
SIMPLE_OPKG_TOOLS_PKG_OUTPUT_DIR=${BASE_DIR}/ipkg | ||
# packages that needs to be built before | ||
SIMPLE_OPKG_TOOLS_DEPENDENCIES=host-opkg-utils | ||
|
||
define inner-sot-ensure-var-set | ||
@# Checks whether given variable is set and strips it from quotes | ||
$(if ${${1}},\ | ||
@echo "${1}=${${1}}",\ | ||
$(error "${1} not defined!")\ | ||
) | ||
|
||
$(eval ${1} := $(call qstrip,${${1}})) | ||
endef # inner-sot-ensure-var-set | ||
|
||
define SIMPLE_OPKG_TOOLS_INIT | ||
@# Creates necessary files and directories to build package | ||
@# Input arguments: | ||
@# 1 - package name | ||
@# 2 - workdir/destination | ||
|
||
@# ensure that all REQUIRED fields are present | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_NAME) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_VERSION) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_DEPENDS) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_ARCHITECTURE) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_MAINTAINER) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_SOURCE) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_SECTION) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_PRIORITY) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_DESCRIPTION) | ||
|
||
@# prepare necessary files | ||
${INSTALL} -d ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME} | ||
$(RM) -r ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/* | ||
${INSTALL} -d ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL | ||
|
||
@# create fields in control file | ||
@echo "Package: ${${1}_OPKG_NAME}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Version: ${${1}_OPKG_VERSION}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Depends: ${${1}_OPKG_DEPENDS}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Architecture: ${${1}_OPKG_ARCHITECTURE}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Maintainer: ${${1}_OPKG_MAINTAINER}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Section: ${${1}_OPKG_SECTION}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Source: ${${1}_OPKG_SOURCE}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Priority: ${${1}_OPKG_PRIORITY}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
@echo "Description: ${${1}_OPKG_DESCRIPTION}" >> ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
endef # SIMPLE_OPKG_TOOLS_INIT | ||
|
||
define SIMPLE_OPKG_TOOLS_SET_CUSTOM_FIELD | ||
@# Adds custom field to package control file | ||
@# Input arguments: | ||
@# 1 - workdir/destination | ||
@# 2 - custom field key | ||
@# 3 - custom field value | ||
@echo "${2}: ${3}" >> ${1}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}/CONTROL/control | ||
endef # SIMPLE_OPKG_TOOLS_SET_CUSTOM_FIELD | ||
|
||
define SIMPLE_OPKG_TOOLS_BUILD_PACKAGE | ||
@# Builds package from already prepared directory | ||
@# Input arguments: | ||
@# 1 - package target directory | ||
opkg-build ${1}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME} ${1} | ||
endef # SIMPLE_OPKG_TOOLS_BUILD_PACKAGE | ||
|
||
define SIMPLE_OPKG_TOOLS_SET_TARGET | ||
@# Sets new target path to package temporary directory | ||
@# Input arguments: | ||
@# 1 - package name | ||
@# 2 - new TARGET_DIR | ||
$(eval ${1}_ORIGINAL_TARGET := ${TARGET_DIR}) | ||
$(eval TARGET_DIR := ${2}/${SIMPLE_OPKG_TOOLS_TEMP_FILENAME}) | ||
@echo "New TARGET_DIR=${TARGET_DIR}" | ||
endef # SIMPLE_OPKG_TOOLS_SET_TARGET | ||
|
||
define SIMPLE_OPKG_TOOLS_UNSET_TARGET | ||
@# Reverts target path, set by SIMPLE_OPKG_TOOLS_SET_TARGET | ||
@# Input arguments: | ||
@# 1 - package name | ||
$(eval TARGET_DIR := ${${1}_ORIGINAL_TARGET}) | ||
@echo "New TARGET_DIR=${TARGET_DIR}" | ||
endef # SIMPLE_OPKG_TOOLS_UNSET_TARGET | ||
|
||
define SIMPLE_OPKG_TOOLS_INSTALL_PACKAGE | ||
@# Installs built package in output path | ||
@# Input arguments: | ||
@# 1 - package path | ||
${INSTALL} -d ${SIMPLE_OPKG_TOOLS_PKG_OUTPUT_DIR} | ||
${INSTALL} -m 755 ${1} ${SIMPLE_OPKG_TOOLS_PKG_OUTPUT_DIR} | ||
endef # SIMPLE_OPKG_TOOLS_INSTALL_PACKAGE | ||
|
||
define SIMPLE_OPKG_TOOLS_MAKE_PACKAGE | ||
@# Makes package from CPack generated makefile | ||
${MAKE} package -C ${@D} | ||
endef # SIMPLE_OPKG_TOOLS_MAKE_PACKAGE | ||
|
||
define SIMPLE_OPKG_TOOLS_CREATE_CPACK_METADATA | ||
@# Creates CMake build parameters for CPack configuration | ||
@# Input arguments: | ||
@# 1 - package name | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_NAME) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_VERSION) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_ARCHITECTURE) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_MAINTAINER) | ||
$(call inner-sot-ensure-var-set,${1}_OPKG_DESCRIPTION) | ||
|
||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_NAME="${${1}_OPKG_NAME}") | ||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_VERSION="${${1}_OPKG_VERSION}") | ||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_ARCHITECTURE="${${1}_OPKG_ARCHITECTURE}") | ||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_MAINTAINER="${${1}_OPKG_MAINTAINER}") | ||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_DESCRIPTION="${${1}_OPKG_DESCRIPTION}") | ||
$(eval ${1}_OPKG_CPACK_METADATA += -D${1}_OPKG_FILE_NAME="${${1}_OPKG_NAME}_${${1}_OPKG_VERSION}_${${1}_OPKG_ARCHITECTURE}") | ||
endef # SIMPLE_OPKG_TOOLS_CREATE_CPACK_METADATA | ||
|
||
define SIMPLE_OPKG_TOOLS_REMOVE_FROM_TARGET | ||
@# Remove files installed by CMake in TARGET_DIR, that already belongs to the packages | ||
@( \ | ||
for manifest in ${@D}/install_manifest_*; \ | ||
do \ | ||
echo "Removing file(s) included in $${manifest}..."; \ | ||
cat $${manifest} | xargs printf -- "$${TARGET_DIR}/%s\n"; \ | ||
cat $${manifest} | xargs printf -- "$${TARGET_DIR}/%s\n" | xargs rm; \ | ||
done \ | ||
) | ||
endef # SIMPLE_OPKG_TOOLS_REMOVE_FROM_TARGET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,13 @@ WPEFRAMEWORK_NETFLIX_SITE_METHOD = git | |
WPEFRAMEWORK_NETFLIX_SITE = [email protected]:WebPlatformForEmbedded/WPEPluginNetflix.git | ||
WPEFRAMEWORK_NETFLIX_INSTALL_STAGING = YES | ||
|
||
# wpeframework-netflix binary package config | ||
WPEFRAMEWORK_NETFLIX_OPKG_NAME = "wpeframework-netflix" | ||
WPEFRAMEWORK_NETFLIX_OPKG_VERSION = "1.0.0" | ||
WPEFRAMEWORK_NETFLIX_OPKG_ARCHITECTURE = "${BR2_ARCH}" | ||
WPEFRAMEWORK_NETFLIX_OPKG_MAINTAINER = "Metrological" | ||
WPEFRAMEWORK_NETFLIX_OPKG_DESCRIPTION = "WPEFramework Netflix plugin" | ||
|
||
WPEFRAMEWORK_NETFLIX_CONF_OPTS += -DBUILD_REFERENCE=${WPEFRAMEWORK_NETFLIX_VERSION} | ||
|
||
# TODO: Do not have WPEFRAMEWORK versioning yet | ||
|
@@ -57,5 +64,22 @@ WPEFRAMEWORK_NETFLIX_DEPENDENCIES += gst1-libav | |
endif | ||
endif | ||
|
||
ifeq ($(BR2_PACKAGE_WPEFRAMEWORK_CREATE_IPKG_TARGETS),y) | ||
|
||
WPEFRAMEWORK_NETFLIX_CONF_OPTS += -DWPEFRAMEWORK_CREATE_IPKG_TARGETS=ON | ||
|
||
$(call SIMPLE_OPKG_TOOLS_CREATE_CPACK_METADATA,WPEFRAMEWORK_NETFLIX) | ||
WPEFRAMEWORK_NETFLIX_CONF_OPTS += ${WPEFRAMEWORK_NETFLIX_OPKG_CPACK_METADATA} | ||
|
||
WPEFRAMEWORK_NETFLIX_POST_BUILD_HOOKS += SIMPLE_OPKG_TOOLS_MAKE_PACKAGE | ||
|
||
define WPEFRAMEWORK_NETFLIX_INSTALL_TARGET_CMDS | ||
@# install package | ||
$(call SIMPLE_OPKG_TOOLS_INSTALL_PACKAGE,\ | ||
${@D}/${WPEFRAMEWORK_NETFLIX_OPKG_NAME}_${WPEFRAMEWORK_NETFLIX_OPKG_VERSION}_${WPEFRAMEWORK_NETFLIX_OPKG_ARCHITECTURE}.deb) | ||
endef # WPEFRAMEWORK_NETFLIX_INSTALL_TARGET_CMDS | ||
|
||
endif # ($(BR2_PACKAGE_WPEFRAMEWORK_CREATE_IPKG_TARGETS),y) | ||
|
||
$(eval $(cmake-package)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# | ||
################################################################################ | ||
|
||
WPEFRAMEWORK_PACKAGER_VERSION = 8401322e9fa285373fef5e546fd4db00bed87cf4 | ||
WPEFRAMEWORK_PACKAGER_VERSION = 1eb4b913a6c106be71cba84fc0e6cd62dfc3bb25 | ||
WPEFRAMEWORK_PACKAGER_SITE_METHOD = git | ||
WPEFRAMEWORK_PACKAGER_SITE = [email protected]:WebPlatformForEmbedded/WPEPluginPackager.git | ||
WPEFRAMEWORK_PACKAGER_INSTALL_STAGING = YES | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters