Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ebuild app-crypt/cprocsp is not installed v.2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
soustan
n00b
n00b


Joined: 12 Apr 2020
Posts: 35

PostPosted: Sat Apr 12, 2025 8:25 pm    Post subject: Ebuild app-crypt/cprocsp is not installed v.2 Reply with quote

Hello everyone!

After it turned out that the previous computer had an incorrectly working SSD. I decided to install the app-crypt/cprocsp package on another computer.
However, this package is also not installed on another machine.
That's what I got...

Code:

emerge --info
Portage 3.0.67 (python 3.12.10-final-0, default/linux/amd64/23.0/desktop, gcc-14, glibc-2.40-r8, 6.12.21-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.12.21-gentoo-dist-x86_64-Intel-R-_Core-TM-_i7-2670QM_CPU_@_2.20GHz-with-glibc2.40
KiB Mem:    16267940 total,   8120612 free
KiB Swap:   49151996 total,  49151996 free
Timestamp of repository gentoo: Sat, 12 Apr 2025 18:30:00 +0000
Head commit of repository gentoo: be7307aa5e81737ff37744037725b4ff71f17923
Head commit of repository EmilienMottet: f3403396cd6541e930193a36a3cf5f66cd4cf564

Head commit of repository gentoo-zh: ea3bec421ca9f613f36739eacc36831c3d82f905

Head commit of repository mva: a8b71dfaaba69d0c86367942bf4256f7dda70e0a

Head commit of repository yandex: 18de89beac22e5f8ad7a52bae961a8f5b71cb8e4

sh bash 5.2_p37
ld GNU ld (Gentoo 2.44 p1) 2.44.0
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.31.5::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.7.0::gentoo
dev-lang/perl:             5.40.0-r1::gentoo
dev-lang/python:           3.12.10::gentoo, 3.13.3::gentoo
dev-lang/rust-bin:         1.84.1-r2::gentoo
llvm-core/clang:           19.1.7::gentoo
llvm-core/lld:             19.1.7::gentoo
llvm-core/llvm:            19.1.7::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.56::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241221::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.12::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes

EmilienMottet
    location: /var/db/repos/EmilienMottet
    sync-type: git
    sync-uri: https://github.com/EmilienMottet/overlay.git
    masters: gentoo
    volatile: False

gentoo-zh
    location: /var/db/repos/gentoo-zh
    sync-type: git
    sync-uri: https://github.com/microcai/gentoo-zh.git
    masters: gentoo
    volatile: False

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    volatile: False

mva
    location: /var/db/repos/mva
    sync-type: git
    sync-uri: https://github.com/msva/mva-overlay.git
    masters: gentoo
    volatile: False

yandex
    location: /var/db/repos/yandex
    sync-type: git
    sync-uri: https://github.com/yandex-gentoo/overlay.git
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo-mirror.alexxy.name/ \     http://mirror.mephi.ru/gentoo-distfiles/ \     http://mirror.yandex.ru/gentoo-distfiles/"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet crypt cups dbus dri dts dvd dvdr elogind encode exif flac gdbm gif gpm gtk gui iconv icu jpeg kf6compat lcms libnotify libtirpc lock mad mng mp3 mp4 mpeg multilib ncurses nls ogg opengl openmp openrc pam pango pcre pdf png policykit ppds qml qt5 qt6 readline sdl seccomp session sound spell ssl startup-notification svg test-rust thunar tiff truetype udev udisks unicode upower usb vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_14" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


Code:

# ebuild /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild digest
/usr/lib/portage/python3.12/ebuild.sh: line 625: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild: Permission denied
 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 625:  Called die
 * The specific snippet of code:
 *            source "${EBUILD}" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * Working directory: '/usr/lib/python3.12/site-packages'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'


1.
Code:

cat /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=7
inherit rpm

DESCRIPTION="Cryptopro package"
HOMEPAGE="http://www.cryptopro.ru"
SRC_URI="amd64? ( linux-amd64.tgz )"

LICENSE="Cryptopro"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+kc1 +gui_gtk +readers +cptools stunnel +pkcs11 +import_ca +plugin +certprop +ifd-rutokens"

REQUIRED_USE="gui_gtk? ( kc1 )
    readers? ( kc1 )
    cptools? ( kc1 )
    pkcs11? ( kc1 )
    import_ca? ( kc1 )
    plugin? ( gui_gtk )
"

DEPEND=" sys-apps/pcsc-tools
    sys-apps/pcsc-lite
    sys-apps/lsb-release
    app-crypt/ccid
    app-arch/rpm2targz"

RDEPEND="${DEPEND}"

RESTRICT="mirror strip"

src_unpack () {
    unpack ${A}
    cd ${WORKDIR}
    mv linux-amd64/* ${DISTDIR}
    rm -rf *
    mkdir ${S}
    cd ${S}

    SUFF="${PV}-7"

if use kc1; then
rpm_unpack lsb-cprocsp-kc1-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-base-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-capilite-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-rdr-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-curl-64-${SUFF}.x86_64.rpm
fi

if use gui_gtk; then
rpm_unpack cprocsp-rdr-gui-gtk-64-${SUFF}.x86_64.rpm
fi

if use readers; then
rpm_unpack cprocsp-rdr-pcsc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-emv-64-${SUFF}.x86_64.rpm
#rpm_unpack cprocsp-rdr-inpaspot-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-kst-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-mskey-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-novacard-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-edoc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rutoken-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cloud-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cpfkc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-infocrypt-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rosan-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cryptoki-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-esmart-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-jacarta-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-relay-64-${SUFF}.x86_64.rpm
fi

if use cptools; then
rpm_unpack cprocsp-cptools-gtk-64-${SUFF}.x86_64.rpm
fi

if use pkcs11; then
rpm_unpack lsb-cprocsp-pkcs11-64-${SUFF}.x86_64.rpm
fi

if use import_ca; then
rpm_unpack lsb-cprocsp-ca-certs-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-import-ca-certs-${SUFF}.noarch.rpm
fi

if use plugin; then
for i in "${DISTDIR}"/cprocsp-pki-*-1.amd64.rpm; do
rpm_unpack "${i}"
done
fi

if use certprop; then
rpm_unpack cprocsp-certprop-64-${SUFF}.x86_64.rpm
fi

if use ifd-rutokens; then
rpm_unpack ifd-rutokens_1.0.4_1.x86_64.rpm
fi

rm ${S}/lib64/ld-lsb-x86-64.so.3
}

src_install() {
    cp -vR ${S}/* ${D}/
    rm -f ${D}/etc/init.d/cprocsp
    cp -f ${FILESDIR}/cprocsp ${D}/etc/init.d/cprocsp
}

pkg_postinst() {
    chmod -R 777 /var/opt/cprocsp
    touch /etc/debian_version
    echo "jessie/sid" > /etc/debian_version
    cp -f ${FILESDIR}/config64.ini /etc/opt/cprocsp/config64.ini
    cp -f ${FILESDIR}/license.ini /etc/opt/cprocsp/license.ini
    mkdir /var/opt/cprocsp && mkdir /var/opt/cprocsp/tmp
    if test -z "";then
   if ! grep -q '/opt/cprocsp/lib/amd64' /etc/ld.so.conf;then
   echo "/opt/cprocsp/lib/amd64" > /etc/ld.so.conf.d/cprocsp-lib-amd64.conf
        fi
        /sbin/ldconfig -f /etc/ld.so.conf
    fi
    /bin/bash ${FILESDIR}/addcerts.sh
    rc-update add cprocsp default
    /etc/init.d/cprocsp start
}

pkg_prerm ()  {
    /etc/init.d/cprocsp stop
    rc-update del cprocsp default
    rm -Rv /etc/init.d/cprocsp
    rm -Rv /etc/debian_version
#    rm -Rv /var/opt/cprocsp
    rm -Rv /etc/opt/cprocsp
}


2.
The same ebuild is in another overlay (repository) ---> mva * (https://github.com/msva/mva-overlay /)
However, when you try to install the package and this version of the same software. It turns out that this is also not possible.
Code:

cat /var/db/repos/mva/app-crypt/cprocsp/cprocsp-5.0.13000.ebuild
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit rpm systemd xdg udev

DESCRIPTION="CryptoPro Crypto Provider"
HOMEPAGE="https://cryptopro.ru/products/csp/downloads"

SRC_URI="
   x86? ( ${P}_x86.tgz )
   amd64? ( ${P}_amd64.tgz )
   arm? ( ${P}_arm.tgz )
   arm64? ( ${P}_arm64.tgz )
"

LICENSE="Crypto-Pro"
SLOT="0/${PV}"
# KEYWORDS="~amd64 ~arm ~arm64 ~x86"

CRYPTOPRO_PATCHED_SOFTWARE=(
   curl
   nginx
   apache-modssl
)
CRYPTOPRO_READERS_DEFAULT=( # cprocsp-rdr-
   # NOTE: check in install_gui.sh
   pcsc
   emv
   inpaspot
   kst
   mskey
   novacard
   edoc
   rutoken
   jacarta
   cloud
   cpfkc
   infocrypt
   rosan
   cryptoki
   rustoken
)
CRYPTOPRO_READERS_ADDITIONAL=(
   cloud
   esmart
   relay
   gui # TODO: move to searate use flag
)

IUSE="kc2"
for p in ${CRYPTOPRO_PATCHED_SOFTWARE[@]}; do
   IUSE+=(cryptopro_patched_${p})
done
for p in ${CRYPTOPRO_PATCHED_SOFTWARE[@]}; do
   IUSE+=(cryptopro_readers_${p})
done

RESTRICT="bindist fetch mirror strip"

DEPEND="
   app-accessibility/at-spi2-core
   dev-libs/glib
   dev-libs/libusb-compat
   media-libs/fontconfig
   media-libs/freetype
   sys-libs/pam
   sys-libs/zlib
   x11-libs/cairo
   x11-libs/gdk-pixbuf
   x11-libs/gtk+:2
   x11-libs/libSM
   x11-libs/libX11
   x11-libs/libXxf86vm
   x11-libs/pango
"
RDEPEND="
   app-crypt/ccid
   >=dev-libs/libp11-0.4.0
   dev-libs/libxml2
   x86? ( dev-libs/opensc )
   amd64? ( dev-libs/opensc )
   media-libs/libpng:0
   media-libs/fontconfig
   sys-apps/dbus
   sys-apps/lsb-release
   >=sys-apps/pcsc-lite-1.4.99
   sys-apps/pcsc-tools
   virtual/libcrypt:=
   virtual/libusb:0
   ${DEPEND}
"
BDEPEND="
   app-arch/rpm2targz
   app-alternatives/bzip2
"

QA_PREBUILT="opt/cprocsp/*"

_get_arch() {
   if [[ -n "${_got_arch}" ]]; then
      echo ${_got_arch};
      return
   fi
   local _got_arch
   case $(uname -m) in
      x86_64)
         _got_arch="amd64"
         ;;
      i*86)
         _got_arch="ia32"
         ;;
      armv7*)
         _got_arch="armhf"
         ;;
      aarch64)
         _got_arch="arm64"
         ;;
   esac
   export _got_arch
   echo "${_got_arch}"
}

pkg_pretend() {
   die "Not yet ready"
}

pkg_nofetch() {
   local BASE_URL="https://cryptopro.ru/sites/default/files/private/csp"
   local v=$(ver_cut 1-2)
   local arch=$(_get_arch)
   einfo "Please, open this link in the browser: ${BASE_URL}/${v//.}/$(ver_cut 3)/linux-${arch}.tgz"
   einfo "(registration/login needed)"
   einfo "Then download it, and place at ${PORTAGE_ACTUAL_DISTDIR}/${A}"
   ewarn "Please, post an issue on GitHub in case of checksums mismatch"
}

src_unpack() {
   local uname_m=$(uname -m)
   local arch=$(_get_arch);
   local libdir=$(get_libdir)

   default

   mkdir -p "${S}"
   cd "${S}"

   PKGS=( # Packages that usually installed by CryptoPro installer
      lsb-cprocsp-{base,ca-certs,capilite,kc1,pkcs11,rdr}
      cprocsp-{curl,rdr}
      apache-modssl
   )
   ADD_PKGS=( # Additional packages that should be useful (token drivers, patched stunnel, cert viewer)
      lsb-cprocsp-rcrypt
      cprocsp-{stunnel,xer2print,cptools}
      cprocsp-ipsec-{genpsk,ike}
      ifd-rutokens
      cprocsp-pki{,-{plugin,cades}} # ,phpcades}}
   )

   # TODO: USE-flags for readers, browser plugin, curl, stunnel and so on

   for f in ${PKGS[@]} ${ADD_PKGS[@]}; do
      find "../linux-${arch}" -name "${f}*.rpm" | while read r; do rpm_unpack "./${r}"; done
   done

   mkdir -p usr/lib || die
   mv etc/udev usr/lib/udev || die

   mkdir -p usr/${libdir}/readers/usb || die
   mv usr/${libdir}/pcsc/drivers/* usr/${libdir}/readers/usb/ || die

   cp -rl opt/cprocsp/share usr/share || die
   # ^  TODO: investigave about pottential collisions on certmgr (mono?) and stunnel mans

   mkdir -p usr/lib/mozilla/plugins || die
   cp -lL opt/cprocsp/lib/${arch}/libnpcades.so usr/lib/mozilla/plugins/ || die

   # cp etc/opt/cprocsp/config64.ini{,.backup} || die
   # ^  TODO: What about non-64bit installs? (need someone with 32bit setup)
   bzip2 -d -c < "${FILESDIR}"/cprocsp_postinstal_all_scripts.sh.bz2 > "${T}"/postinst.bash || die
}

src_install() {
   return
   local arch=$(_get_arch)

   insinto /
   doins -r opt etc usr var

   exeinto /opt/cprocsp/bin/"${arch}"
   doexe opt/cprocsp/bin/"${arch}"/*
   exeinto /opt/cprocsp/sbin/"${arch}"
   doexe opt/cprocsp/sbin/"${arch}"/*
   exeinto /opt/cprocsp/lib/"${arch}"
   doexe opt/cprocsp/lib/${arch}/*

   keepdir /var/opt/cprocsp/dsrf
   keepdir /var/opt/cprocsp/dsrf/db1
   keepdir /var/opt/cprocsp/dsrf/db2
   keepdir /var/opt/cprocsp/keys
   keepdir /var/opt/cprocsp/tmp
   keepdir /var/opt/cprocsp/users
   keepdir /var/opt/cprocsp/users/stores
   keepdir /var/opt/cprocsp/mnt

   # insinto /etc/opt/cprocsp

   # alt-compat
   # rm "${arch}"/ld-lsb-x86-64.so.3
   # rm etc/init.d/cprocsp
   mv etc/init.d/cprocsp opt/cprocsp/cprocsp.init || die # FIXME:

   newinitd "${FILESDIR}/${P}" cprocsp
   # TODO: ^ make it just script, and make normal openrc init-file
   systemd_dounit "${FILESDIR}/${PN}.service"

   newenvd - "99${PN}" <<-_EOF_
      PATH=/opt/cprocsp/bin/${arch}:/opt/cprocsp/sbin/${arch}
   _EOF_
   # TODO: ^^^ adding it to the end of PATH leads to shadowing
   # CryptoPro's `certmgr` by same-named utility from dev-lang/mono
   # And adding it to the beginning leads to shadowning `curl` from
   # net-misc/curl by proprietary-patched `curl` from this package.
   # TODO: maybe make symliks to bindir instead of adding to PATH?
   # Or wrapper(s)?
}

pkg_postinst() {
   return
   local arch=$(_get_arch)
   local pi_st

   /etc/init.d/cprocsp repair_var

   ebegin "Running postinstall script (pre-configuring)"
      bash "${T}"/postinst.bash &>"${T}/postinst.log"
      pi_st=$?
   eend "${pi_st}"
   if [[ "${pi_st}" -gt 0 ]]; then
      eerror "Something gone wrong during postinstall. It is not necessarily bad, but check the log just in case:"
      eerror "=================="
      cat "${T}/postinst.log"
      eerror "=================="
   fi

   xdg_desktop_database_update
   udev_reload

   einfo "You may want to run following command as user (not root):"
   einfo "    /opt/cprocsp/bin/"${arch}"/csptestf -absorb -certs -autoprov"
   einfo "to import cryptocontainers and certificates from USB-smartcard (aka token)"

   ewarn "!!!!!! WARNING !!!!!!"
   ewarn "In case of breakages (for example, it stopped to work with your smartcard)"
   ewarn "try to:"
   ewarn "1) uninstall this package"
   ewarn "2) remove (or move to another place) /etc/opt/cprocsp/config64.ini if it wasn't removed by portage"
   ewarn "3) install this package again"
   ewarn "4) if you did any modifications on config64.ini - repeat them now"
}


Code:

# emerge -a =app-crypt/cprocsp-5.0.13000::mva

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 9.44 s (backtrack: 0/20).

/usr/lib/portage/python3.12/ebuild.sh: line 625: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13000.ebuild: Permission denied
 * ERROR: app-crypt/cprocsp-5.0.13000::localrepo failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 625:  Called die
 * The specific snippet of code:
 *            source "${EBUILD}" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13000::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13000::localrepo'`.
/usr/lib/portage/python3.12/isolated-functions.sh: line 118: /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env: Permission denied
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/empty'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/work/cprocsp-5.0.13000'
/usr/lib/portage/python3.12/ebuild.sh: line 625: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild: Permission denied
 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 625:  Called die
 * The specific snippet of code:
 *            source "${EBUILD}" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * Working directory: '/usr/lib/python3.12/site-packages'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
[ebuild  N     ] dev-perl/Log-Agent-1.5.0  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/ExtUtils-Depends-0.800.100  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/ExtUtils-PkgConfig-1.160.0-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/glib-perl-1.329.400  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Glib-Object-Introspection-0.51.0-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Cairo-1.109.0-r1  USE="-examples -test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Cairo-GObject-1.5.0-r1  USE="-examples" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-libs/libusb-compat-0.1.8  USE="-debug -examples (-split-usr)" ABI_X86="(64) -32 (-x32)"
[ebuild  N     ] dev-libs/libp11-0.4.12-r7  USE="-doc -static-libs -test"
[ebuild  NS    ] virtual/libusb-0-r2 [1-r2]
[ebuild  N     ] app-crypt/ccid-1.5.5  USE="usb -twinserial"
[ebuild  N     ] dev-libs/opensc-0.26.0  USE="pcsc-lite readline ssl zlib -ctapi -doc -notify -openct -pace -secure-messaging -test"
[ebuild  N     ] dev-perl/pcsc-perl-1.4.14-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Gtk3-0.38.0  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] sys-apps/pcsc-tools-1.7.2  USE="gui nls -network-cron"
[ebuild  N f  *] app-crypt/cprocsp-5.0.13000  USE="-kc2"

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Running pre-merge checks for app-crypt/cprocsp-5.0.13000
 * ERROR: app-crypt/cprocsp-5.0.13000::mva failed (pretend phase):
 *   Not yet ready
 *
 * Call stack:
 *                  ebuild.sh, line 136:  Called pkg_pretend
 *   cprocsp-5.0.13000.ebuild, line 126:  Called die
 * The specific snippet of code:
 *      die "Not yet ready"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13000::mva'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13000::mva'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/empty'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/work/cprocsp-5.0.13000'

>>> Failed to emerge app-crypt/cprocsp-5.0.13000, Log file:

>>>  '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'

 * Messages for package app-crypt/cprocsp-5.0.13000:

 * ERROR: app-crypt/cprocsp-5.0.13000::mva failed (pretend phase):
 *   Not yet ready
 *
 * Call stack:
 *                  ebuild.sh, line 136:  Called pkg_pretend
 *   cprocsp-5.0.13000.ebuild, line 126:  Called die
 * The specific snippet of code:
 *      die "Not yet ready"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13000::mva'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13000::mva'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/empty'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/work/cprocsp-5.0.13000'
[ERROR] Task was destroyed but it is pending!
task: <Task pending name='Task-223' coro=<PipeLogger._io_loop() done, defined at /usr/lib/python3.12/site-packages/portage/util/_async/PipeLogger.py:83> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[PipeLogger._io_loop_done()]>
[ERROR] Task was destroyed but it is pending!
task: <Task pending name='Task-224' coro=<BuildLogger._main() done, defined at /usr/lib/python3.12/site-packages/portage/util/_async/BuildLogger.py:131> wait_for=<Future pending cb=[AsynchronousTask.async_wait.<locals>.<lambda>() at /usr/lib/python3.12/site-packages/_emerge/AsynchronousTask.py:49, Task.task_wakeup()]> cb=[BuildLogger._main_exit()]>
[ERROR] Task was destroyed but it is pending!
task: <Task pending name='Task-225' coro=<PipeLogger._io_loop() done, defined at /usr/lib/python3.12/site-packages/portage/util/_async/PipeLogger.py:83> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[PipeLogger._io_loop_done()]>
[ERROR] Task was destroyed but it is pending!
task: <Task pending name='Task-226' coro=<ForkProcess._main() done, defined at /usr/lib/python3.12/site-packages/portage/util/_async/ForkProcess.py:179> wait_for=<Future pending cb=[AsynchronousTask.async_wait.<locals>.<lambda>() at /usr/lib/python3.12/site-packages/_emerge/AsynchronousTask.py:49, Task.task_wakeup()]> cb=[SpawnProcess._main_exit()]>


3. I understand that the result of building the package is the same program!

However, as can be seen from the installation result, the errors reported by the console are different!!

If necessary, I will provide any additional output from the console upon request.

Please help me build the first or second version of the program.

Thank you ALL in advance for participating in the help!
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 2116

PostPosted: Sat Apr 12, 2025 8:50 pm    Post subject: Reply with quote

Please show the output of: namei -lx /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild

Edit also ensure there is not noexec in the mounts of either of these paths.
Back to top
View user's profile Send private message
soustan
n00b
n00b


Joined: 12 Apr 2020
Posts: 35

PostPosted: Sun Apr 13, 2025 9:37 am    Post subject: Reply with quote

grknight wrote:
Please show the output of: namei -lx /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild

Edit also ensure there is not noexec in the mounts of either of these paths.


Good day, grknight,

1. Please show the output of:

Code:
 namei -lx /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild


Code:

#namei -lx /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
f: /var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp
Drwxr-xr-x root    root    /
drwxr-xr-x root    root    var
drwxrwxrwt root    root    tmp
drwxrwxr-x portage portage portage
drwxrwxr-x portage portage app-crypt
drwx------ portage portage cprocsp-5.0.13000
drwxr-xr-x portage portage temp
f: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
Drwxr-xr-x root    root    /
drwxr-xr-x root    root    var
drwxr-xr-x root    root    db
drwxr-xr-x portage portage repos
drwxr-xr-x root    root    localrepo
drwx------ sgd     sgd     app-crypt
drwx------ sgd     sgd     cprocsp
-rw-r--r-- sgd     sgd     cprocsp-5.0.13300.ebuild


2. Edit also ensure there is not noexec in the mounts of either of these paths.

Apparently, I did not fully understand your question regarding noexec.
Do you mean mounting partitions in /etc/fstab?
Code:
 cat /etc/fstab
# <fs>                                    <mountpoint>          <type>      <opts>      <dump> <pass>
UUID=6bccfcd4-792f-4719-a347-c7a248da2733   /boot               ext2       noatime            1 2
UUID=e9b01fa9-c9ab-4079-92ab-c869cccbc1e3   none                swap       sw                 0 0
UUID=6e4ed846-6627-470b-a9d5-aefd487bf148   /                   btrfs      defaults,noatime   0 1
UUID=aedabc62-2ba8-4546-9ecd-e096b564199c   /home               btrfs      defaults           0 1

Or something else related to this mount option?
I'm probably not that advanced a Gentoo user.
Therefore, I ask you not to judge my counter-questions to you strictly.
But, I really need this app-crypt/cprocsp package installed in the system.
And I'm looking for any way to install it in the system!!
That's why I'm asking for help from the entire Gentoo Community...

3. Next, I deleted one of the two .ebuild options on my system. And he left only one. Now the system gives me the following:
Code:
# eix app-crypt/cprocsp
* app-crypt/cprocsp [1]
     Доступные версии:      (~)5.0.12000(0/5.0.12000)^fmsd (~)5.0.12900(0/5.0.12900)^fmsd (**)5.0.13000(0/5.0.13000)^fmsd {kc2}
     Домашняя страница:     https://cryptopro.ru/products/csp/downloads
     Описание:              CryptoPro Crypto Provider

[1] "mva" /var/db/repos/mva


Created a manifest:
Code:
# ebuild /var/db/repos/mva/app-crypt/cprocsp/cprocsp-5.0.13000.ebuild digest
>>> Creating Manifest for /var/db/repos/mva/app-crypt/cprocsp


Installation Attempt:
Code:
# emerge -a =app-crypt/cprocsp-5.0.13000::mva

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 9.20 s (backtrack: 0/20).

[ebuild  N     ] dev-perl/Log-Agent-1.5.0  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/ExtUtils-Depends-0.800.100  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/ExtUtils-PkgConfig-1.160.0-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/glib-perl-1.329.400  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Glib-Object-Introspection-0.51.0-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Cairo-1.109.0-r1  USE="-examples -test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Cairo-GObject-1.5.0-r1  USE="-examples" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-libs/libusb-compat-0.1.8  USE="-debug -examples (-split-usr)" ABI_X86="(64) -32 (-x32)"
[ebuild  N     ] dev-libs/libp11-0.4.12-r7  USE="-doc -static-libs -test"
[ebuild  NS    ] virtual/libusb-0-r2 [1-r2]
[ebuild  N     ] app-crypt/ccid-1.5.5  USE="usb -twinserial"
[ebuild  N     ] dev-libs/opensc-0.26.0  USE="pcsc-lite readline ssl zlib -ctapi -doc -notify -openct -pace -secure-messaging -test"
[ebuild  N     ] dev-perl/pcsc-perl-1.4.14-r1  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] dev-perl/Gtk3-0.38.0  USE="-test" PERL_FEATURES="(-debug) -ithreads -quadmath"
[ebuild  N     ] sys-apps/pcsc-tools-1.7.2  USE="gui nls -network-cron"
[ebuild  N f  *] app-crypt/cprocsp-5.0.13000  USE="-kc2"

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Running pre-merge checks for app-crypt/cprocsp-5.0.13000
 * ERROR: app-crypt/cprocsp-5.0.13000::mva failed (pretend phase):
 *   Not yet ready
 *
 * Call stack:
 *                  ebuild.sh, line 136:  Called pkg_pretend
 *   cprocsp-5.0.13000.ebuild, line 126:  Called die
 * The specific snippet of code:
 *      die "Not yet ready"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13000::mva'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13000::mva'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/empty'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/work/cprocsp-5.0.13000'

>>> Failed to emerge app-crypt/cprocsp-5.0.13000, Log file:

>>>  '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'

 * Messages for package app-crypt/cprocsp-5.0.13000:

 * ERROR: app-crypt/cprocsp-5.0.13000::mva failed (pretend phase):
 *   Not yet ready
 *
 * Call stack:
 *                  ebuild.sh, line 136:  Called pkg_pretend
 *   cprocsp-5.0.13000.ebuild, line 126:  Called die
 * The specific snippet of code:
 *      die "Not yet ready"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13000::mva'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13000::mva'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/temp/die.env'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/empty'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13000/work/cprocsp-5.0.13000'


The source code archive is located in the directory:
Code:

# ls -l /var/cache/distfiles/cprocsp-5.0.13000_amd64.tgz
-rw-r--r-- 1 sgd sgd 31389396 апр 11 20:54 /var/cache/distfiles/cprocsp-5.0.13000_amd64.tgz
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 2116

PostPosted: Sun Apr 13, 2025 1:49 pm    Post subject: Reply with quote

soustan wrote:
Code:

f: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
Drwxr-xr-x root    root    /
drwxr-xr-x root    root    var
drwxr-xr-x root    root    db
drwxr-xr-x portage portage repos
drwxr-xr-x root    root    localrepo
drwx------ sgd     sgd     app-crypt
drwx------ sgd     sgd     cprocsp
-rw-r--r-- sgd     sgd     cprocsp-5.0.13300.ebuild

So the directories, app-crypt and cprocsp, containing the ebuild are not accessible to the portage user. This will not work properly. Make the directories at least a+rx (or 755 octal).
Back to top
View user's profile Send private message
soustan
n00b
n00b


Joined: 12 Apr 2020
Posts: 35

PostPosted: Sun Apr 13, 2025 3:51 pm    Post subject: Reply with quote

grknight wrote:
soustan wrote:
Code:

f: /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
Drwxr-xr-x root    root    /
drwxr-xr-x root    root    var
drwxr-xr-x root    root    db
drwxr-xr-x portage portage repos
drwxr-xr-x root    root    localrepo
drwx------ sgd     sgd     app-crypt
drwx------ sgd     sgd     cprocsp
-rw-r--r-- sgd     sgd     cprocsp-5.0.13300.ebuild

So the directories, app-crypt and cprocsp, containing the ebuild are not accessible to the portage user. This will not work properly. Make the directories at least a+rx (or 755 octal).


Ok!
I changed

Code:

>>> Emerging (12 of 12) app-crypt/cprocsp-5.0.13300::localrepo
 * linux-amd64.tgz BLAKE2B SHA512 size ;-) ...                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking linux-amd64.tgz to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work
mv: cannot move 'linux-amd64/accord_random-1-0.src.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/accord_random-1-0.src.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-apache-modssl-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-apache-modssl-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-certprop-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-certprop-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-compat-altlinux-64-1.0.0-1.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-compat-altlinux-64-1.0.0-1.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-compat-suse-1.0.0-1.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-compat-suse-1.0.0-1.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-cptools-gtk-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-cptools-gtk-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-curl-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-curl-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-drv-64-5.0.13300-7.src.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-drv-64-5.0.13300-7.src.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-drv-devel-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-drv-devel-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-ipsec-devel-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-ipsec-devel-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-ipsec-esp-64-5.0.13300-7.src.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-ipsec-esp-64-5.0.13300-7.src.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-ipsec-genpsk-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-ipsec-genpsk-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-ipsec-ike-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-ipsec-ike-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-legacy-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-legacy-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-nginx-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-nginx-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-pki-cades-64-2.0.15260-1.amd64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-pki-cades-64-2.0.15260-1.amd64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-pki-phpcades-2.0.15260-1.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-pki-phpcades-2.0.15260-1.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-pki-plugin-64-2.0.15260-1.amd64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-pki-plugin-64-2.0.15260-1.amd64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-cloud-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-cloud-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-cpfkc-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-cpfkc-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-cryptoki-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-cryptoki-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-edoc-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-edoc-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-emv-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-emv-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-esmart-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-esmart-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-gui-gtk-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-gui-gtk-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-infocrypt-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-infocrypt-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-inpaspot-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-inpaspot-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-jacarta-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-jacarta-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-kst-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-kst-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-mskey-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-mskey-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-novacard-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-novacard-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-pcsc-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-pcsc-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-relay-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-relay-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-rosan-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-rosan-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-rustoken-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-rustoken-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-rdr-rutoken-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-rdr-rutoken-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-stunnel-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-stunnel-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-stunnel-msspi-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-stunnel-msspi-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/cprocsp-xer2print-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cprocsp-xer2print-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/cpverify' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/cpverify': Permission denied
mv: cannot move 'linux-amd64/ifd-rutokens_1.0.4_1.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/ifd-rutokens_1.0.4_1.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/install.desktop' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/install.desktop': Permission denied
mv: cannot move 'linux-amd64/install.sh' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/install.sh': Permission denied
mv: cannot move 'linux-amd64/install_gui.sh' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/install_gui.sh': Permission denied
mv: cannot move 'linux-amd64/integrity.sh' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/integrity.sh': Permission denied
mv: cannot move 'linux-amd64/linux-amd64.ini' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/linux-amd64.ini': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-base-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-base-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-ca-certs-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-ca-certs-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-capilite-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-capilite-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-devel-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-devel-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-import-ca-certs-5.0.13300-7.noarch.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-import-ca-certs-5.0.13300-7.noarch.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-kc2-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc2-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-pkcs11-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-pkcs11-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rcrypt-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rcrypt-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-accord-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-accord-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-accord-ccid-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-accord-ccid-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-ancud-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-ancud-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-crypton-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-crypton-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-maxim-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-maxim-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-sobol-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-sobol-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/lsb-cprocsp-rdr-vityaz-64-5.0.13300-7.x86_64.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-rdr-vityaz-64-5.0.13300-7.x86_64.rpm': Permission denied
mv: cannot move 'linux-amd64/readme.txt' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/readme.txt': Permission denied
mv: cannot move 'linux-amd64/sobol-1-8.src.rpm' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/sobol-1-8.src.rpm': Permission denied
mv: cannot move 'linux-amd64/uninstall.sh' to '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/uninstall.sh': Permission denied
>>> Unpacking lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300
/usr/bin/rpm2tar: line 157: /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm: No such file or directory
rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 364:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'

>>> Failed to emerge app-crypt/cprocsp-5.0.13300, Log file:

>>>  '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'

 * Messages for package app-crypt/cprocsp-5.0.13300:

 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 364:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'

 * GNU info directory index is up-to-date.


I have changed the rights to the specified directories. The installation process of 11 of the 12 packages was successful.
However, as can be seen from the console output, on the main package, when unpacking the source code archive.
Distribute the archiving, and just in case, from the archives, the same archiving:
Code:
">>> Unpacking linux-amd64.tgz to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work
mv: cannot move "linux" to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work mv: cannot move "linux". -amd64/accord_random-1-0.src.rpm' for '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/accord_random-1-0.src.rpm': Permission denied"


and later

Code:

rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors


What could be wrong now?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23355

PostPosted: Sun Apr 13, 2025 4:00 pm    Post subject: Reply with quote

It appears to be the same thing that was wrong in your prior thread, where I told you not to write to DISTDIR, then pingtoo also told you not to write to DISTDIR.
Back to top
View user's profile Send private message
soustan
n00b
n00b


Joined: 12 Apr 2020
Posts: 35

PostPosted: Sun Apr 13, 2025 4:24 pm    Post subject: Reply with quote

Hu wrote:
It appears to be the same thing that was wrong in your prior thread, where I told you not to write to DISTDIR, then pingtoo also told you not to write to DISTDIR.


Good Day, Hu !
Do you mean this is your message?
"Perhaps you should address the first problem first. Your output shows that mv is failing badly, but you ignore that and move on to try to consume files that are only available if the mv succeeded. It looks like $DISTDIR is not writable here, so you should not be writing to it. From a cursory read of rpm_unpack, I think you cannot use rpm_unpack when the rpm to be unpacked is not placed in DISTDIR by Portage.
Remove that mv, and use rpm2tar on the files you would have moved."

Did I understand you correctly that I need to make changes to the .ebuild itself ?

Ok,

I adjusted the .ebuild like this:

Code:

# cat /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=7
inherit rpm

DESCRIPTION="Cryptopro package"
HOMEPAGE="http://www.cryptopro.ru"
SRC_URI="amd64? ( linux-amd64.tgz )"

LICENSE="Cryptopro"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+kc1 +gui_gtk +readers +cptools stunnel +pkcs11 +import_ca +plugin +certprop +ifd-rutokens"

REQUIRED_USE="gui_gtk? ( kc1 )
    readers? ( kc1 )
    cptools? ( kc1 )
    pkcs11? ( kc1 )
    import_ca? ( kc1 )
    plugin? ( gui_gtk )
"

DEPEND=" sys-apps/pcsc-tools
    sys-apps/pcsc-lite
    sys-apps/lsb-release
    app-crypt/ccid
    app-arch/rpm"

RDEPEND="${DEPEND}"

RESTRICT="mirror strip"

src_unpack () {
    unpack ${A}
    cd ${WORKDIR}
    rm -rf *
    mkdir ${S}
    cd ${S}

    SUFF="${PV}-7"

if use kc1; then
rpm_unpack lsb-cprocsp-kc1-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-base-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-capilite-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-rdr-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-curl-64-${SUFF}.x86_64.rpm
fi

if use gui_gtk; then
rpm_unpack cprocsp-rdr-gui-gtk-64-${SUFF}.x86_64.rpm
fi

if use readers; then
rpm_unpack cprocsp-rdr-pcsc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-emv-64-${SUFF}.x86_64.rpm
#rpm_unpack cprocsp-rdr-inpaspot-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-kst-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-mskey-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-novacard-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-edoc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rutoken-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cloud-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cpfkc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-infocrypt-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rosan-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cryptoki-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-esmart-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-jacarta-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-relay-64-${SUFF}.x86_64.rpm
fi

if use cptools; then
rpm_unpack cprocsp-cptools-gtk-64-${SUFF}.x86_64.rpm
fi

if use pkcs11; then
rpm_unpack lsb-cprocsp-pkcs11-64-${SUFF}.x86_64.rpm
fi

if use import_ca; then
rpm_unpack lsb-cprocsp-ca-certs-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-import-ca-certs-${SUFF}.noarch.rpm
fi

if use plugin; then
for i in "${DISTDIR}"/cprocsp-pki-*-1.amd64.rpm; do
rpm_unpack "${i}"
done
fi

if use certprop; then
rpm_unpack cprocsp-certprop-64-${SUFF}.x86_64.rpm
fi

if use ifd-rutokens; then
rpm_unpack ifd-rutokens_1.0.4_1.x86_64.rpm
fi

rm ${S}/lib64/ld-lsb-x86-64.so.3
}

src_install() {
    cp -vR ${S}/* ${D}/
    rm -f ${D}/etc/init.d/cprocsp
    cp -f ${FILESDIR}/cprocsp ${D}/etc/init.d/cprocsp
}

pkg_postinst() {
    chmod -R 777 /var/opt/cprocsp
    touch /etc/debian_version
    echo "jessie/sid" > /etc/debian_version
    cp -f ${FILESDIR}/config64.ini /etc/opt/cprocsp/config64.ini
    cp -f ${FILESDIR}/license.ini /etc/opt/cprocsp/license.ini
    mkdir /var/opt/cprocsp && mkdir /var/opt/cprocsp/tmp
    if test -z "";then
   if ! grep -q '/opt/cprocsp/lib/amd64' /etc/ld.so.conf;then
   echo "/opt/cprocsp/lib/amd64" > /etc/ld.so.conf.d/cprocsp-lib-amd64.conf
        fi
        /sbin/ldconfig -f /etc/ld.so.conf
    fi
    /bin/bash ${FILESDIR}/addcerts.sh
    rc-update add cprocsp default
    /etc/init.d/cprocsp start
}

pkg_prerm ()  {
    /etc/init.d/cprocsp stop
    rc-update del cprocsp default
    rm -Rv /etc/init.d/cprocsp
    rm -Rv /etc/debian_version
#    rm -Rv /var/opt/cprocsp
    rm -Rv /etc/opt/cprocsp
}


lines
Code:

DEPEND="... app-arch/rpm"
delete ---> mv linux-amd64/* ${DISTDIR}


Code:

# emerge -a =app-crypt/cprocsp-5.0.13300::localrepo

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 3.67 s (backtrack: 0/20).

[ebuild  N    ~] app-crypt/cprocsp-5.0.13300  USE="certprop cptools gui_gtk ifd-rutokens import_ca kc1 pkcs11 plugin readers -stunnel"

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-crypt/cprocsp-5.0.13300::localrepo
 * linux-amd64.tgz BLAKE2B SHA512 size ;-) ...                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking linux-amd64.tgz to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work
>>> Unpacking lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300
/usr/bin/rpm2tar: line 157: /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm: No such file or directory
rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 363:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'

>>> Failed to emerge app-crypt/cprocsp-5.0.13300, Log file:

>>>  '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'

 * Messages for package app-crypt/cprocsp-5.0.13300:

 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 363:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'


However, the package has not been installed.
Write "rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)"
I don't understand, why ??
Can you tell me what I'm doing wrong?
Back to top
View user's profile Send private message
soustan
n00b
n00b


Joined: 12 Apr 2020
Posts: 35

PostPosted: Mon Apr 14, 2025 6:00 am    Post subject: Reply with quote

[quote="soustan"]
Hu wrote:
It appears to be the same thing that was wrong in your prior thread, where I told you not to write to DISTDIR, then pingtoo also told you not to write to DISTDIR.


Good Day, Hu !
Do you mean this is your message?
"Perhaps you should address the first problem first. Your output shows that mv is failing badly, but you ignore that and move on to try to consume files that are only available if the mv succeeded. It looks like $DISTDIR is not writable here, so you should not be writing to it. From a cursory read of rpm_unpack, I think you cannot use rpm_unpack when the rpm to be unpacked is not placed in DISTDIR by Portage.
Remove that mv, and use rpm2tar on the files you would have moved."

Did I understand you correctly that I need to make changes to the .ebuild itself ?

Ok,

I adjusted the .ebuild like this:

Code:

# cat /var/db/repos/localrepo/app-crypt/cprocsp/cprocsp-5.0.13300.ebuild
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=7
inherit rpm

DESCRIPTION="Cryptopro package"
HOMEPAGE="http://www.cryptopro.ru"
SRC_URI="amd64? ( linux-amd64.tgz )"

LICENSE="Cryptopro"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+kc1 +gui_gtk +readers +cptools stunnel +pkcs11 +import_ca +plugin +certprop +ifd-rutokens"

REQUIRED_USE="gui_gtk? ( kc1 )
    readers? ( kc1 )
    cptools? ( kc1 )
    pkcs11? ( kc1 )
    import_ca? ( kc1 )
    plugin? ( gui_gtk )
"

DEPEND=" sys-apps/pcsc-tools
    sys-apps/pcsc-lite
    sys-apps/lsb-release
    app-crypt/ccid
    app-arch/rpm"

RDEPEND="${DEPEND}"

RESTRICT="mirror strip"

src_unpack () {
    unpack ${A}
    cd ${WORKDIR}
    rm -rf *
    mkdir ${S}
    cd ${S}

    SUFF="${PV}-7"

if use kc1; then
rpm_unpack lsb-cprocsp-kc1-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-base-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-capilite-64-${SUFF}.x86_64.rpm
rpm_unpack lsb-cprocsp-rdr-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-curl-64-${SUFF}.x86_64.rpm
fi

if use gui_gtk; then
rpm_unpack cprocsp-rdr-gui-gtk-64-${SUFF}.x86_64.rpm
fi

if use readers; then
rpm_unpack cprocsp-rdr-pcsc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-emv-64-${SUFF}.x86_64.rpm
#rpm_unpack cprocsp-rdr-inpaspot-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-kst-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-mskey-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-novacard-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-edoc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rutoken-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cloud-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cpfkc-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-infocrypt-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-rosan-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-cryptoki-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-esmart-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-jacarta-64-${SUFF}.x86_64.rpm
rpm_unpack cprocsp-rdr-relay-64-${SUFF}.x86_64.rpm
fi

if use cptools; then
rpm_unpack cprocsp-cptools-gtk-64-${SUFF}.x86_64.rpm
fi

if use pkcs11; then
rpm_unpack lsb-cprocsp-pkcs11-64-${SUFF}.x86_64.rpm
fi

if use import_ca; then
rpm_unpack lsb-cprocsp-ca-certs-${SUFF}.noarch.rpm
rpm_unpack lsb-cprocsp-import-ca-certs-${SUFF}.noarch.rpm
fi

if use plugin; then
for i in "${DISTDIR}"/cprocsp-pki-*-1.amd64.rpm; do
rpm_unpack "${i}"
done
fi

if use certprop; then
rpm_unpack cprocsp-certprop-64-${SUFF}.x86_64.rpm
fi

if use ifd-rutokens; then
rpm_unpack ifd-rutokens_1.0.4_1.x86_64.rpm
fi

rm ${S}/lib64/ld-lsb-x86-64.so.3
}

src_install() {
    cp -vR ${S}/* ${D}/
    rm -f ${D}/etc/init.d/cprocsp
    cp -f ${FILESDIR}/cprocsp ${D}/etc/init.d/cprocsp
}

pkg_postinst() {
    chmod -R 777 /var/opt/cprocsp
    touch /etc/debian_version
    echo "jessie/sid" > /etc/debian_version
    cp -f ${FILESDIR}/config64.ini /etc/opt/cprocsp/config64.ini
    cp -f ${FILESDIR}/license.ini /etc/opt/cprocsp/license.ini
    mkdir /var/opt/cprocsp && mkdir /var/opt/cprocsp/tmp
    if test -z "";then
   if ! grep -q '/opt/cprocsp/lib/amd64' /etc/ld.so.conf;then
   echo "/opt/cprocsp/lib/amd64" > /etc/ld.so.conf.d/cprocsp-lib-amd64.conf
        fi
        /sbin/ldconfig -f /etc/ld.so.conf
    fi
    /bin/bash ${FILESDIR}/addcerts.sh
    rc-update add cprocsp default
    /etc/init.d/cprocsp start
}

pkg_prerm ()  {
    /etc/init.d/cprocsp stop
    rc-update del cprocsp default
    rm -Rv /etc/init.d/cprocsp
    rm -Rv /etc/debian_version
#    rm -Rv /var/opt/cprocsp
    rm -Rv /etc/opt/cprocsp
}


lines
Code:

DEPEND="... app-arch/rpm"
delete ---> mv linux-amd64/* ${DISTDIR}


Code:

# emerge -a =app-crypt/cprocsp-5.0.13300::localrepo

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 3.67 s (backtrack: 0/20).

[ebuild  N    ~] app-crypt/cprocsp-5.0.13300  USE="certprop cptools gui_gtk ifd-rutokens import_ca kc1 pkcs11 plugin readers -stunnel"

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-crypt/cprocsp-5.0.13300::localrepo
 * linux-amd64.tgz BLAKE2B SHA512 size ;-) ...                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking linux-amd64.tgz to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work
>>> Unpacking lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm to /var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300
/usr/bin/rpm2tar: line 157: /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm: No such file or directory
rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 363:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'

>>> Failed to emerge app-crypt/cprocsp-5.0.13300, Log file:

>>>  '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'

 * Messages for package app-crypt/cprocsp-5.0.13300:

 * ERROR: app-crypt/cprocsp-5.0.13300::localrepo failed (unpack phase):
 *   failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm
 *
 * Call stack:
 *               ebuild.sh, line 136:  Called src_unpack
 *             environment, line 363:  Called rpm_unpack 'lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *             environment, line 329:  Called assert 'failure unpacking /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm'
 *   isolated-functions.sh, line  18:  Called die
 * The specific snippet of code:
 *         [[ ${x} -eq 0 ]] || die "$@"
 *
 * If you need support, post the output of `emerge --info '=app-crypt/cprocsp-5.0.13300::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=app-crypt/cprocsp-5.0.13300::localrepo'`.
 * The complete build log is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/temp/environment'.
 * Working directory: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'
 * S: '/var/tmp/portage/app-crypt/cprocsp-5.0.13300/work/cprocsp-5.0.13300'


However, the package has not been installed.
Write "rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)"
I don't understand, why ??

Code:

Adjustment
DEPEND="... app-arch/rpm2targz
app-alternatives/bzip2

It also doesn't change anything in the console. The error is the same.

Code:

/usr/bin/rpm2tar: line 157: /var/tmp/portage/app-crypt/cprocsp-5.0.13300/distdir/lsb-cprocsp-kc1-64-5.0.13300-7.x86_64.rpm: No such file or directory
rpm2tar: error: unable to locate cpio offset (broken/unknown compression?)


Can you tell me what I'm doing wrong?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum