Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hgy59/spksrc into redesig…
Browse files Browse the repository at this point in the history
…n_dependency_list
  • Loading branch information
hgy59 committed Dec 9, 2024
2 parents 93fd1d5 + a79cb60 commit 4313817
Show file tree
Hide file tree
Showing 414 changed files with 305,660 additions and 1,774 deletions.
1 change: 1 addition & 0 deletions .github/actions/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# - Build for arch defined by ${GH_ARCH} (e.g. x64-6.1, noarch, ...).
# - Successfully built packages are logged to $BUILD_SUCCESS_FILE.
# - Failed builds are logged to ${BUILD_ERROR_FILE} and annotated as error.
# - For failed builds, the make command and the latest 15 lines of the build output are written to ${BUILD_ERROR_LOGFILE}
# - The build output is structured into log groups by package.
# - As the disk space in the workflow environment is limitted, we clean the
# work folder of each package after build. At 2020.06 this limit is 14GB.
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/build_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# BUILD_SUCCESS_FILE defines the name of the file with built packages
# BUILD_UNSUPPORTED_FILE defines the name of the file with unsupported packages
# BUILD_ERROR_FILE defines the name of the file with build errors
# BUILD_ERROR_LOGFILE defines the name of the file with last 15 lines of build output for failed packages
#

echo ""
Expand All @@ -38,7 +39,7 @@ fi
echo ""
echo "UNSUPPORTED (skipped):"
if [ -f "${BUILD_UNSUPPORTED_FILE}" ]; then
cat "${BUILD_UNSUPPORTED_FILE}"
cat "${BUILD_UNSUPPORTED_FILE}" | awk '!seen[$0]++'
if [ -f "${BUILD_ERROR_FILE}" ]; then
# remove unsupported packages from errors:
unsupported_packages=$(cat "${BUILD_UNSUPPORTED_FILE}" | grep -Po "\- \K.*:" | sort -u | tr '\n' '|' | sed -e 's/|$//')
Expand Down
214 changes: 116 additions & 98 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,51 @@ on:
publish:
description: 'Publish to repository'
required: false
default: 'false'
default: false
type: boolean
# Add a separator as a non-input description
build_settings_description:
description: 'Build Settings (archs to include):'
required: false
default: ''
type: choice
options:
- 'true'
- 'false'
- '---'
add_noarch_builds:
description: 'Include noarch packages'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
default: true
type: boolean
add_noarch_dsm72_builds:
description: 'Include noarch DSM 7.2 packages'
required: false
default: false
type: boolean
add_dsm72_builds:
description: 'Include DSM 7.2 archs'
required: false
default: 'false'
type: choice
options:
- 'true'
- 'false'
default: false
type: boolean
add_dsm71_builds:
description: 'Include DSM 7.1 archs'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
default: true
type: boolean
add_dsm62_builds:
description: 'Include DSM 6.2 archs'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
default: true
type: boolean
add_dsm52_builds:
description: 'Include DSM 5.2 archs'
required: false
default: 'false'
type: choice
options:
- 'true'
- 'false'
default: false
type: boolean
add_srm12_builds:
description: 'Include SRM 1.2 archs'
required: false
default: 'false'
type: choice
options:
- 'true'
- 'false'
default: false
type: boolean
pull_request:
paths:
- 'spk/**'
Expand All @@ -84,12 +76,7 @@ jobs:
outputs:
arch_packages: ${{ steps.dependencies.outputs.arch_packages }}
noarch_packages: ${{ steps.dependencies.outputs.noarch_packages }}
add_noarch_builds: ${{ steps.set-defaults.outputs.add_noarch_builds }}
add_dsm72_builds: ${{ steps.set-defaults.outputs.add_dsm72_builds }}
add_dsm71_builds: ${{ steps.set-defaults.outputs.add_dsm71_builds }}
add_dsm62_builds: ${{ steps.set-defaults.outputs.add_dsm62_builds }}
add_dsm52_builds: ${{ steps.set-defaults.outputs.add_dsm52_builds }}
add_srm12_builds: ${{ steps.set-defaults.outputs.add_srm12_builds }}
has_min_dsm72_packages: ${{ steps.dependencies.outputs.has_min_dsm72_packages }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -118,17 +105,6 @@ jobs:
GH_FILES: ${{ steps.getfile.outputs.files }} ${{ steps.getfile_pr.outputs.files }}
SPK_TO_BUILD: ${{ github.event.inputs.package }}

# Set default values for all builds (manual or automated)
- name: Set default values for generate matrix
id: set-defaults
run: |
echo "add_noarch_builds=${{ github.event.inputs.add_noarch_builds || steps.dependencies.outputs.has_noarch_packages }}" >> $GITHUB_OUTPUT
echo "add_dsm72_builds=${{ github.event.inputs.add_dsm72_builds || steps.dependencies.outputs.has_min_dsm72_packages }}" >> $GITHUB_OUTPUT
echo "add_dsm71_builds=${{ github.event.inputs.add_dsm71_builds || steps.dependencies.outputs.has_arch_packages }}" >> $GITHUB_OUTPUT
echo "add_dsm62_builds=${{ github.event.inputs.add_dsm62_builds || steps.dependencies.outputs.has_arch_packages }}" >> $GITHUB_OUTPUT
echo "add_dsm52_builds=${{ github.event.inputs.add_dsm52_builds || 'false' }}" >> $GITHUB_OUTPUT
echo "add_srm12_builds=${{ github.event.inputs.add_srm12_builds || 'false' }}" >> $GITHUB_OUTPUT
- name: Cache downloaded files
uses: actions/cache@v4
with:
Expand All @@ -143,73 +119,115 @@ jobs:
ARCH_PACKAGES: ${{ needs.prepare.outputs.arch_packages }}
NOARCH_PACKAGES: ${{ needs.prepare.outputs.noarch_packages }}

generate_matrix:
name: Generate Matrix
needs: prepare
set-defaults:
name: Set Defaults
runs-on: ubuntu-latest
needs: prepare
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
matrix: ${{ steps.defaults.outputs.matrix }}
steps:
- id: set-matrix
- id: defaults
run: |
# Use the default values passed from the prepare step
add_noarch_builds=${{ needs.prepare.outputs.add_noarch_builds }}
add_dsm72_builds=${{ needs.prepare.outputs.add_dsm72_builds }}
add_dsm71_builds=${{ needs.prepare.outputs.add_dsm71_builds }}
add_dsm62_builds=${{ needs.prepare.outputs.add_dsm62_builds }}
add_dsm52_builds=${{ needs.prepare.outputs.add_dsm52_builds }}
add_srm12_builds=${{ needs.prepare.outputs.add_srm12_builds }}
# Retrieve inputs and package availability
add_noarch_builds=${{ github.event.inputs.add_noarch_builds || 'false' }}
add_noarch_dsm72_builds=${{ github.event.inputs.add_noarch_dsm72_builds || 'false' }}
add_dsm72_builds=${{ github.event.inputs.add_dsm72_builds || 'false' }}
add_dsm71_builds=${{ github.event.inputs.add_dsm71_builds || 'false' }}
add_dsm62_builds=${{ github.event.inputs.add_dsm62_builds || 'false' }}
add_dsm52_builds=${{ github.event.inputs.add_dsm52_builds || 'false' }}
add_srm12_builds=${{ github.event.inputs.add_srm12_builds || 'false' }}
has_noarch_packages=$([ -n "${{ needs.prepare.outputs.noarch_packages }}" ] && echo "true" || echo "false")
has_arch_packages=$([ -n "${{ needs.prepare.outputs.arch_packages }}" ] && echo "true" || echo "false")
has_min_dsm72_packages=${{ needs.prepare.outputs.has_min_dsm72_packages || 'false' }}
# Dynamic logic for automatic builds
if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then
# Enable noarch builds if noarch packages exist
add_noarch_builds=$([ "$has_noarch_packages" == "true" ] && echo "true" || echo "false")
# Enable noarch DSM 7.2 builds if noarch packages exist and minimum DSM 7.2 requirements are met
add_noarch_dsm72_builds=$([ "$has_noarch_packages" == "true" ] && [ "$has_min_dsm72_packages" == "true" ] && echo "true" || echo "false")
# Enable DSM 7.2 builds if arch packages exist and minimum DSM 7.2 requirements are met
add_dsm72_builds=$([ "$has_arch_packages" == "true" ] && [ "$has_min_dsm72_packages" == "true" ] && echo "true" || echo "false")
# Enable DSM 7.1 builds if arch packages exist
add_dsm71_builds=$([ "$has_arch_packages" == "true" ] && echo "true" || echo "false")
# Enable DSM 6.2 builds if arch packages exist
add_dsm62_builds=$([ "$has_arch_packages" == "true" ] && echo "true" || echo "false")
fi
# Build matrix
matrix=$(jq -n '{"include": []}')
# Create matrix as a JSON object
matrix='{"include": ['
if [ "$add_noarch_builds" == "true" ]; then
matrix+='{"arch": "noarch-1.1"},'
matrix+='{"arch": "noarch-3.1"},'
matrix+='{"arch": "noarch-6.1"},'
matrix+='{"arch": "noarch-7.0"},'
# Helper function to add entries to the matrix
add_to_matrix() {
matrix=$(echo "$matrix" | jq --arg arch "$1" '.include += [{"arch": $arch}]')
}
# Add noarch builds
if [ "$add_noarch_builds" == "true" ] && [ "$has_noarch_packages" == "true" ]; then
add_to_matrix "noarch-1.1"
add_to_matrix "noarch-3.1"
add_to_matrix "noarch-6.1"
add_to_matrix "noarch-7.0"
fi
# Add noarch DSM 7.2 builds
if [ "$add_noarch_dsm72_builds" == "true" ] && [ "$has_noarch_packages" == "true" ]; then
add_to_matrix "noarch-7.2"
fi
if [ "$add_dsm72_builds" == "true" ]; then
matrix+='{"arch": "x64-7.2"},'
matrix+='{"arch": "aarch64-7.2"},'
# Add DSM 7.2 builds
if [ "$add_dsm72_builds" == "true" ] && [ "$has_arch_packages" == "true" ]; then
add_to_matrix "x64-7.2"
add_to_matrix "aarch64-7.2"
add_to_matrix "armv7-7.2"
fi
if [ "$add_dsm71_builds" == "true" ]; then
matrix+='{"arch": "x64-7.1"},'
matrix+='{"arch": "aarch64-7.1"},'
matrix+='{"arch": "evansport-7.1"},'
matrix+='{"arch": "armv7-7.1"},'
matrix+='{"arch": "comcerto2k-7.1"},'
# Add DSM 7.1 builds
if [ "$add_dsm71_builds" == "true" ] && [ "$has_arch_packages" == "true" ]; then
add_to_matrix "x64-7.1"
add_to_matrix "aarch64-7.1"
add_to_matrix "evansport-7.1"
add_to_matrix "armv7-7.1"
add_to_matrix "comcerto2k-7.1"
fi
if [ "$add_dsm62_builds" == "true" ]; then
matrix+='{"arch": "x64-6.2.4"},'
matrix+='{"arch": "aarch64-6.2.4"},'
matrix+='{"arch": "evansport-6.2.4"},'
matrix+='{"arch": "armv7-6.2.4"},'
matrix+='{"arch": "hi3535-6.2.4"},'
matrix+='{"arch": "88f6281-6.2.4"},'
matrix+='{"arch": "qoriq-6.2.4"},'
# Add DSM 6.2 builds
if [ "$add_dsm62_builds" == "true" ] && [ "$has_arch_packages" == "true" ]; then
add_to_matrix "x64-6.2.4"
add_to_matrix "aarch64-6.2.4"
add_to_matrix "evansport-6.2.4"
add_to_matrix "armv7-6.2.4"
add_to_matrix "hi3535-6.2.4"
add_to_matrix "88f6281-6.2.4"
add_to_matrix "qoriq-6.2.4"
fi
if [ "$add_dsm52_builds" == "true" ]; then
matrix+='{"arch": "x86-5.2"},'
matrix+='{"arch": "88f6281-5.2"},'
matrix+='{"arch": "ppc853x-5.2"},'
# Add DSM 5.2 builds
if [ "$add_dsm52_builds" == "true" ] && [ "$has_arch_packages" == "true" ]; then
add_to_matrix "x86-5.2"
add_to_matrix "88f6281-5.2"
add_to_matrix "ppc853x-5.2"
fi
# Add SRM 1.2 builds
if [ "$add_srm12_builds" == "true" ]; then
matrix+='{"arch": "armv7-1.2"},'
add_to_matrix "armv7-1.2"
fi
# Remove trailing comma and close the matrix
matrix=$(echo $matrix | sed 's/,$//')
matrix+=']}'
echo "matrix=$matrix" >> $GITHUB_OUTPUT
# Output the final matrix
echo "matrix=$(echo $matrix | jq -c)" >> $GITHUB_OUTPUT
build:
name: Build
needs: [prepare, generate_matrix]
needs: [prepare, set-defaults]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate_matrix.outputs.matrix) }}
matrix: ${{ fromJSON(needs.set-defaults.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ local.mk:
@echo "DISTRIBUTOR_URL =" >> $@
@echo "REPORT_URL =" >> $@
@echo "DEFAULT_TC =" >> $@
@echo "# Option to disable the use of github API to get the real name and url of the maintainer" >> $@
@echo "# define it for local builds when you reach the API rate limit" >> $@
@echo "DISABLE_GITHUB_MAINTAINER =" >> $@
@echo "#PSTAT = on" >> $@
@echo "#PARALLEL_MAKE = max" >> $@

Expand Down
9 changes: 1 addition & 8 deletions cross/arp-scan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKG_DIST_SITE = https://github.com/royhills/arp-scan/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

OPTIONAL_DEPENDS = cross/libpcap cross/libpcap_1.9
DEPENDS = cross/libpcap

HOMEPAGE = https://www.royhills.co.uk/wiki/index.php/Arp-scan_User_Guide
COMMENT = Command-line tool for system discovery and fingerprinting. It constructs and sends ARP requests to the specified IP addresses, and displays any responses that are received.
Expand All @@ -22,13 +22,6 @@ ADDITIONAL_CPPFLAGS = -O3

include ../../mk/spksrc.cross-cc.mk

ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS)),$(ARCH))
DEPENDS = cross/libpcap_1.9
else
DEPENDS = cross/libpcap
endif


.PHONY: arp-scan_pre_configure
arp-scan_pre_configure:
$(RUN) autoreconf --install
3 changes: 1 addition & 2 deletions cross/arp-scan/PLIST
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
rsc:bin/arp-fingerprint
bin:bin/arp-scan
rsc:bin/get-iab
rsc:bin/get-oui
rsc:etc/arp-scan/mac-vendor.txt
rsc:share/arp-scan
Loading

0 comments on commit 4313817

Please sign in to comment.