diff options
Diffstat (limited to 'vars')
-rw-r--r-- | vars/build.vars | 10 | ||||
-rw-r--r-- | vars/dist_minipix_dist.vars | 39 | ||||
-rw-r--r-- | vars/invariants_digest.vars | 27 | ||||
-rw-r--r-- | vars/invariants_minipix.vars | 67 | ||||
-rw-r--r-- | vars/invariants_tarballs.vars | 107 | ||||
-rw-r--r-- | vars/invariants_zipdist.vars | 4 | ||||
-rw-r--r-- | vars/midipix.vars | 2 |
7 files changed, 130 insertions, 126 deletions
diff --git a/vars/build.vars b/vars/build.vars index 6b0dcb8e..8f7ee306 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -1630,16 +1630,10 @@ MINIPIX_RPM_DISABLE=1; : ${PKG_PTYCON_MINIPIX_ENV_VARS_EXTRA:="CFLAGS_PATH=-I${PREFIX_NATIVE}/include:LDFLAGS_PATH=-L${PREFIX_NATIVE}/lib"}; # -# Build target dist -# -DIST_NO_LOG_VARS=1; -DIST_PACKAGES="dist_minipix_dist"; - -# # Build target invariants # INVARIANTS_NO_LOG_VARS=1; -INVARIANTS_PACKAGES="invariants_digest invariants_gitref invariants_tarballs invariants_zipdist"; +INVARIANTS_PACKAGES="invariants_digest invariants_gitref invariants_minipix invariants_tarballs invariants_zipdist"; # # Build targets @@ -1649,6 +1643,6 @@ host_tools host_tools_deps host_tools_rpm host_toolchain_deps host_toolchain hos native_tools native_toolchain_deps native_toolchain native_toolchain_mingw32 native_runtime host_packages_deps native_packages_deps native_packages_deps_x11 native_packages -minipix dist"; +minipix"; # vim:filetype=sh textwidth=0 diff --git a/vars/dist_minipix_dist.vars b/vars/dist_minipix_dist.vars deleted file mode 100644 index 1e043117..00000000 --- a/vars/dist_minipix_dist.vars +++ /dev/null @@ -1,39 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -pkg_dist_minipix_dist_all() { - local _dist_pfx="${PREFIX_MINIPIX}" _bin_pname="" _lib_name="" \ - _term="" _term_letter=""; - ex_rtl_fileop rm "${_dist_pfx}"; - ex_rtl_fileop mkdir "${_dist_pfx}" "${_dist_pfx}/bin" "${_dist_pfx}/share"; - for _bin_name in clear reset tset; do - ex_rtl_fileop cp_follow "${PREFIX_NATIVE}/bin/${_bin_name}" "${_dist_pfx}/bin"; - done; - for _bin_pname in $(find "${PREFIX}/minipix_dist/bin" \ - -maxdepth 1 -perm /a=x -type f -and \( -not -name "lib*" \)); do - ex_rtl_fileop cp_follow "${_bin_pname}" "${_dist_pfx}/bin"; - done; - for _lib_name in libc.so libcrypto.so.43 liblzma.so.5 libmagic.so.1 \ - libncursesw.so.6 libpcre.so.1 libpsxscl.so libreadline.so.7 \ - libu16ports.so.0 libssl.so.45 libtinfo.so.6 libtinfow.so.6 \ - libunistring.so.2 libuuid.so.1 libz.so.1; do - ex_rtl_fileop cp_follow \ - "${PREFIX_NATIVE}/lib/${_lib_name}" "${_dist_pfx}/bin"; - done; - for _shared_pname in nano vim; do - ex_rtl_fileop cp_follow \ - "${PREFIX}/minipix_dist/share/${_shared_pname}" "${_dist_pfx}/share"; - done; - ex_rtl_fileop ln_symbolic "nano/nanorc.nanorc" "${_dist_pfx}/share/nanorc"; - ex_rtl_fileop ln_symbolic "vim/vim74/vimrc_example.vim" "${_dist_pfx}/share/vimrc"; - for _term in putty putty-256color screen screen-256color xterm xterm-256color; do - _term_letter="${_term%${_term#[a-zA-Z]}}"; - ex_rtl_fileop mkdir "${_dist_pfx}/share/terminfo/${_term_letter}"; - ex_rtl_fileop cp_follow \ - "${PREFIX_NATIVE}/share/terminfo/${_term_letter}/${_term}" \ - "${_dist_pfx}/share/terminfo/${_term_letter}"; - done; -}; - -# vim:filetype=sh diff --git a/vars/invariants_digest.vars b/vars/invariants_digest.vars index 51bc212b..38efb49f 100644 --- a/vars/invariants_digest.vars +++ b/vars/invariants_digest.vars @@ -3,21 +3,22 @@ # pkg_invariants_digest_all() { - local __=""; - if [ -z "${ARG_TARBALL}" ]; then - exit 0; - else + local _fname=""; + if ex_rtl_lmatch "${ARG_DIST}" , tbz2 \ + || ex_rtl_lmatch "${ARG_DIST}" , tgz \ + || ex_rtl_lmatch "${ARG_DIST}" , txz \ + || ex_rtl_lmatch "${ARG_DIST}" , zipdist; then ex_rtl_log_msg info "Compiling SHA256 sums..."; + if [ -e "${PREFIX}/SHA256SUMS" ]; then + ex_rtl_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last"; + fi; + (cd "${PREFIX}"; + for _fname in $(find "${PREFIX_NATIVE#${PREFIX}/}" -type f -perm /a=x \ + \( -path "${PREFIX_NATIVE#${PREFIX}/}/bin/*" -or \ + -path "${PREFIX_NATIVE#${PREFIX}/}/lib/*" \)); do + sha256sum "${_fname}"; + done > "${PREFIX}/SHA256SUMS"); fi; - if [ -e "${PREFIX}/SHA256SUMS" ]; then - ex_rtl_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last"; - fi; - (cd "${PREFIX}"; - for __ in $(find "${PREFIX_NATIVE#${PREFIX}/}" -type f -perm /a=x \ - \( -path "${PREFIX_NATIVE#${PREFIX}/}/bin/*" -or \ - -path "${PREFIX_NATIVE#${PREFIX}/}/lib/*" \)); do - sha256sum "${__}"; - done > "${PREFIX}/SHA256SUMS"); }; # vim:filetype=sh diff --git a/vars/invariants_minipix.vars b/vars/invariants_minipix.vars new file mode 100644 index 00000000..29c75f5c --- /dev/null +++ b/vars/invariants_minipix.vars @@ -0,0 +1,67 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkgp_invariants_minipix_is_newer() { + local _new_fname="${1}" _new_ts="" _old_dname="${2}" _old_ts=""; + _old_ts="$(stat -c %Y "${_old_dname%%/}/${_new_fname##*/}")"; + _new_ts="$(stat -c %Y "${_new_fname}")"; + if [ "${_new_ts}" > "${_old_ts}" ]; then + return 0; + else + return 1; + fi; +}; + +pkg_invariants_minipix_all() { + local _dname="" _fname="" _pname=""; + if ex_rtl_lmatch "${ARG_DIST}" , minipix; then + for _dname in "${PREFIX_MINIPIX}/bin" "${PREFIX_MINIPIX}/share"; do + if [ ! -e "${_dname}" ]; then + ex_rtl_fileop mkdir "${_dname}"; + fi; + done; + for _fname in clear reset tset; do + if pkgp_invariants_minipix_is_newer "${PREFIX_NATIVE}/bin/${_fname}" "${PREFIX_MINIPIX}/bin"; then + ex_rtl_fileop cp_follow "${PREFIX_NATIVE}/bin/${_fname}" "${PREFIX_MINIPIX}/bin"; + fi; + done; + for _pname in $(find "${PREFIX_MINIPIX}/bin" \ + -maxdepth 1 -perm /a=x -type f -and \( -not -name "lib*" \)); do + if pkgp_invariants_minipix_is_newer "${_pname}" "${PREFIX_MINIPIX}/bin"; then + ex_rtl_fileop cp_follow "${_pname}" "${PREFIX_MINIPIX}/bin"; + fi; + done; + for _fname in libc.so libcrypto.so.43 liblzma.so.5 libmagic.so.1 \ + libncursesw.so.6 libpcre.so.1 libpsxscl.so libreadline.so.7 \ + libu16ports.so.0 libssl.so.45 libtinfo.so.6 libtinfow.so.6 \ + libunistring.so.2 libuuid.so.1 libz.so.1; do + if pkgp_invariants_minipix_is_newer "${PREFIX_NATIVE}/lib/${_fname}" "${PREFIX_MINIPIX}/bin"; then + ex_rtl_fileop cp_follow \ + "${PREFIX_NATIVE}/lib/${_fname}" "${PREFIX_MINIPIX}/bin"; + fi; + done; + for _fname in nano vim; do + if pkgp_invariants_minipix_is_newer "${PREFIX}/minipix_dist/share/${_fname}" "${PREFIX_MINIPIX}/share"; then + ex_rtl_fileop cp_follow "${PREFIX}/minipix_dist/share/${_fname}" "${PREFIX_MINIPIX}/share"; + fi; + done; + if [ ! -L "${PREFIX_MINIPIX}/share/nanorc" ]; then + ex_rtl_fileop ln_symbolic "nano/nanorc.nanorc" "${PREFIX_MINIPIX}/share/nanorc"; + fi; + if [ ! -L "${PREFIX_MINIPIX}/share/vimrc" ]; then + ex_rtl_fileop ln_symbolic "vim/vim74/vimrc_example.vim" "${PREFIX_MINIPIX}/share/vimrc"; + fi; + for _fname in putty putty-256color screen screen-256color xterm xterm-256color; do + _dname="${PREFIX_MINIPIX}/share/terminfo/${_fname%${_fname#[a-zA-Z]}}"; + if [ ! -e "${_dname}" ]; then + ex_rtl_fileop mkdir "${_dname}"; + fi; + if pkgp_invariants_minipix_is_newer "${PREFIX_NATIVE}/share/terminfo/${_term_letter}/${_fname}" "${_dname}"; then + ex_rtl_fileop cp_follow "${PREFIX_NATIVE}/share/terminfo/${_term_letter}/${_fname}" "${_dname}"; + fi; + done; + fi; +}; + +# vim:filetype=sh diff --git a/vars/invariants_tarballs.vars b/vars/invariants_tarballs.vars index 1b89aeb0..998a1b54 100644 --- a/vars/invariants_tarballs.vars +++ b/vars/invariants_tarballs.vars @@ -2,103 +2,88 @@ # set -o errexit -o noglob are assumed. # -pkgp_dist_tarball_dist() { - TARBALL_FNAME="${DEFAULT_TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; +pkgp_invariants_tarball_dist() { + local _tarball_compress_cmd="${1}" _tarball_compress_args="${2}" _tarball_suffix="${3}"; + local _tarball_fname="${DEFAULT_TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${_tarball_suffix}"; tar -cpf - $(find . -maxdepth 1 -mindepth 1 -type d \ -not -path ./minipix \ -not -path ./minipix_dist \ -not -path ./rpm \ -not -path ./tmp | sort) \ midipix_shortcut.vbs midipix.sh README SHA256SUMS |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_FNAME}"; + "${_tarball_compress_cmd}" ${_tarball_compress_args} -c > "${_tarball_fname}"; ex_rtl_log_msg info "Finished building binary distribution tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ gpg --list-keys "${DEFAULT_TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then gpg --armor --passphrase-file /dev/null \ - --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_FNAME}"; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${_tarball_fname}"; ex_rtl_log_msg info "Signed binary distribution tarball."; fi; }; -pkgp_dist_tarball_toolchain() { - TARBALL_CROSS_FNAME="${DEFAULT_TARBALL_CROSS_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; +pkgp_invariants_tarball_toolchain() { + local _tarball_compress_cmd="${1}" _tarball_compress_args="${2}" _tarball_suffix="${3}"; + local _tarball_cross_fname="${DEFAULT_TARBALL_CROSS_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${_tarball_suffix}"; tar -cpf - bin include lib lib64 libexec share "${PKG_TARGET}" |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_CROSS_FNAME}"; + "${_tarball_compress_cmd}" ${_tarball_compress_args} -c > "${_tarball_cross_fname}"; ex_rtl_log_msg info "Finished building toolchain tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ gpg --list-keys "${DEFAULT_TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then gpg --armor --passphrase-file /dev/null \ - --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_CROSS_FNAME}"; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${_tarball_cross_fname}"; ex_rtl_log_msg info "Signed toolchain tarball."; fi; }; -pkgp_dist_tarball_minipix() { - TARBALL_MINIPIX_FNAME="${DEFAULT_TARBALL_MINIPIX_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; +pkgp_invariants_tarball_minipix() { + local _tarball_compress_cmd="${1}" _tarball_compress_args="${2}" _tarball_suffix="${3}"; + local _tarball_minipix_fname="${DEFAULT_TARBALL_MINIPIX_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${_tarball_suffix}"; tar -cpf - minipix \ midipix_shortcut.vbs midipix.sh README |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_MINIPIX_FNAME}"; + "${_tarball_compress_cmd}" ${_tarball_compress_args} -c > "${_tarball_minipix_fname}"; ex_rtl_log_msg info "Finished building binary Minipix distribution tarball."; if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ gpg --list-keys "${DEFAULT_TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then gpg --armor --passphrase-file /dev/null \ - --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_MINIPIX_FNAME}"; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${_tarball_minipix_fname}"; ex_rtl_log_msg info "Signed binary Minipix distribution tarball."; fi; }; -pkgp_dist_tarball_src() { - local _build_tgt_lc="" _build_tgt_uc="" _find_filters="" _pkg_name_lc="" _pkg_name_uc=""; - TARBALL_SRC_FNAME="${DEFAULT_TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; - ex_rtl_log_msg info "Building source tarball..."; - for _build_tgt_lc in ${BUILD_TARGETS:-${TARGETS_DEFAULT}}; do - _build_tgt_uc="$(ex_rtl_toupper "${_build_tgt_lc}")"; - for _pkg_name_lc in $(ex_rtl_get_var_unsafe ${_build_tgt_uc}_PACKAGES); do - _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name_lc}")"; - if [ "$(ex_rtl_get_var_unsafe ${_pkg_name_uc}_SRC_TARBALL_DISABLE)" = "1" ]; then - _find_filters="${_find_filters:+${_find_filters} }( -not -name ${_pkg_name}-\*-\* )"; - fi; - done; - done; - tar -C "${BUILD_WORKDIR}" -cpf - $(cd "${BUILD_WORKDIR}" && find \ - -maxdepth 1 -mindepth 1 -name \*-\*-\* \ - ${_find_filters}) |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_SRC_FNAME}"; - ex_rtl_log_msg info "Finished building source tarball."; - if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ - gpg --list-keys "${DEFAULT_TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then - gpg --armor --passphrase-file /dev/null \ - --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_SRC_FNAME}"; - ex_rtl_log_msg info "Signed source tarball."; - fi; -}; - pkg_invariants_tarballs_all() { - if [ -z "${ARG_TARBALL}" ]; then - exit 0; - else - ex_rtl_log_msg info "Building distribution tarballs..."; + local _tarball_compress_args="" _tarball_compress_cmd="" _tarball_suffix="" _tarball_suffixes="" _tarball_type="" _tarball_types=""; + if ex_rtl_lmatch "${ARG_DIST}" , tbz2; then + _tarball_suffixes="${_tarball_suffixes:+${_tarball_suffixes} }bz2"; + fi; + if ex_rtl_lmatch "${ARG_DIST}" , tgz; then + _tarball_suffixes="${_tarball_suffixes:+${_tarball_suffixes} }gz"; fi; - case "${DEFAULT_TARBALL_SUFFIX}" in - bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then - TARBALL_COMPRESS_CMD="pbzip2"; - else - TARBALL_COMPRESS_CMD="bzip2"; - fi; ;; - gz) if [ -n "$(which pigz 2>/dev/null)" ]; then - TARBALL_COMPRESS_CMD="pigz"; - else - TARBALL_COMPRESS_CMD="gzip"; - fi; ;; - xz) TARBALL_COMPRESS_CMD="xz"; - TARBALL_COMPRESS_ARGS="-T0"; ;; - *) ex_rtl_log_msg failexit "Unknown tarball suffix \`.${DEFAULT_TARBALL_SUFFIX}'."; - esac; - ex_rtl_fileop cd "${PREFIX}"; PREFIX_BASENAME="${PREFIX_NATIVE##*/}"; - pkgp_dist_tarball_dist; pkgp_dist_tarball_toolchain; pkgp_dist_tarball_minipix; - if [ "${BUILD}" = "debug" ]; then - pkgp_dist_tarball_src; + if ex_rtl_lmatch "${ARG_DIST}" , txz; then + _tarball_suffixes="${_tarball_suffixes:+${_tarball_suffixes} }xz"; fi; + for _tarball_suffix in ${_tarball_suffixes}; do + ex_rtl_log_msg info "Building ${_tarball_suffix}-compressed distribution tarballs..."; + case "${_tarball_suffix}" in + bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then + _tarball_compress_cmd="pbzip2"; + else + _tarball_compress_cmd="bzip2"; + fi; ;; + gz) if [ -n "$(which pigz 2>/dev/null)" ]; then + _tarball_compress_cmd="pigz"; + else + _tarball_compress_cmd="gzip"; + fi; ;; + xz) _tarball_compress_cmd="xz"; + _tarball_compress_args="-T0"; ;; + *) ex_rtl_log_msg failexit "Unknown tarball suffix \`${_tarball_suffix}'."; + esac; + ex_rtl_fileop cd "${PREFIX}"; PREFIX_BASENAME="${PREFIX_NATIVE##*/}"; + _tarball_types="dist toolchain minipix"; + for _tarball_type in ${_tarball_types}; do + pkgp_invariants_tarball_${_tarball_type} "${_tarball_compress_cmd}" "${_tarball_compress_args}" "${_tarball_suffix}"; + done; + done; }; # vim:filetype=sh diff --git a/vars/invariants_zipdist.vars b/vars/invariants_zipdist.vars index 246e5562..9a90b1a5 100644 --- a/vars/invariants_zipdist.vars +++ b/vars/invariants_zipdist.vars @@ -4,9 +4,7 @@ pkg_invariants_zipdist_all() { local _dist_fname="" _pkg_name="" _pkglist_fname="${PREFIX}/pkglist.native"; - if [ -z "${ARG_ZIPDIST}" ]; then - exit 0; - else + if ex_rtl_lmatch "${ARG_DIST}" , zipdist; then ex_rtl_log_msg info "Building deployable distribution ZIP archive..."; for _pkg_name in $(cat "${_pkglist_fname}"); do if ! stat "${BUILD_WORKDIR}/${_pkg_name}-native-${DEFAULT_TARGET}" >/dev/null 2>&1; then diff --git a/vars/midipix.vars b/vars/midipix.vars index 596e9782..55df1d79 100644 --- a/vars/midipix.vars +++ b/vars/midipix.vars @@ -83,8 +83,6 @@ : ${DEFAULT_TARBALL_CROSS_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_cross.}; : ${DEFAULT_TARBALL_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}.}; : ${DEFAULT_TARBALL_MINIPIX_FNAME_PREFIX:=minipix-${ARCH}-${BUILD}.}; -: ${DEFAULT_TARBALL_SRC_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_src.}; -: ${DEFAULT_TARBALL_SUFFIX:=xz}; : ${DEFAULT_ZIPDIST_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}.}; # Check & clear predicates |