/
Leprekon
/
packwrap
Обзор
Документация
Войти
/
Leprekon
/
packwrap
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
types/ebuild/build
56 строк
2 KB
Sergei Chernov
Initial Import
14 июл 2026, 23:07
14 июл 2026, 23:07
b9ecd64
Код
Авторство
О чём код?
#!/usr/bin/env bash # type: ebuild — build script # Packages source tarball + ebuild for installation into a Gentoo repo. TYPE="ebuild" TYPE_DESC="Gentoo ebuild + tarball" build() { local project="$1" version="$2" src_dir="$3" type_dir="$4" local output_dir="$5" arch="$6" work_dir="$7" # Copy ebuild local ebuild_count=0 local f for f in "$type_dir"/*.ebuild; do [ -f "$f" ] || continue cp "$f" "$output_dir/" echo " ebuild: prepared $(basename "$f")" ebuild_count=$((ebuild_count + 1)) done if [ "$ebuild_count" -eq 0 ]; then echo " *** No ebuild files in $type_dir, generating stub" >&2 cat > "$output_dir/${project}-${version}.ebuild" <<-END # Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DESCRIPTION="" HOMEPAGE="" SRC_URI="" LICENSE="" SLOT="0" KEYWORDS="~${arch}" END echo " ebuild: generated stub ${project}-${version}.ebuild" fi # Create source tarball local src_real src_real="$(readlink -f "$src_dir" 2>/dev/null || echo "$src_dir")" if [ -d "$src_real" ]; then local parent parent="$(dirname "$src_real")" local base base="$(basename "$src_real")" local tarball="${project}-${version}.tar.gz" tar --exclude=.git -czf "$output_dir/$tarball" -C "$parent" "$base" 2>/dev/null echo " distfile: created $tarball" else echo " *** Source directory $src_real not found" >&2 fi }