Skip to content

Commit

Permalink
app-crypt/cprocsp: add 5.0.12900, drop 5.0.12000
Browse files Browse the repository at this point in the history
Signed-off-by: Vadim Misbakh-Soloviov <[email protected]>
  • Loading branch information
msva committed Jan 31, 2024
1 parent 4b2c992 commit 33bbc57
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 35 deletions.
8 changes: 4 additions & 4 deletions app-crypt/cprocsp/Manifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DIST cprocsp-5.0.12000_amd64.tgz 16134526 BLAKE2B a327b173554f4de17daaac56c7435eb7a7309e9b3fd4a79a72f385448f59881f07d3865b0ddeb1f2a98e53b87436ad3bd1c1df4455bfe11673953129cdef2322 SHA512 5ce29f12178e64983f194ef5792130185b3a0eb200532d2ca140c7f6867a2c92c1d1a8958dc8ca7e9e721f47d5a39772f6527abc06cb255080709252cd16c7e4
DIST cprocsp-5.0.12000_arm.tgz 15120827 BLAKE2B d6dc93bf167fe2ad0967fa3dd55df0e647471a0413680030f621df2130cd8b0a72b8076ee74f642da44ae220e07fcfdfa81b018397d4b788884de221e9e9240f SHA512 396b7ee57a0afe9e2399c7f53b4132da5b19f5294aa7a200cd18b72a62bed9b390462e886eccc0c0a15c5f165684902a09ae12613c86743968e6c723a87f51d9
DIST cprocsp-5.0.12000_arm64.tgz 17409050 BLAKE2B c62d9779298f56e60b05e3b642bc21584e18b5d62a47f2052c70843536f63424d363f3a5e441536377d5b5373af9a5be7b27e96dbb8c5d72669ae63bdf0a8772 SHA512 180d80dfc1769eacd28ed1a2670d35f4b78407d13c152630659de64839ff6351266100f620f64deea165436a392d3bfdc4a8fa294937812c3cc1eec202315b4a
DIST cprocsp-5.0.12000_x86.tgz 16587422 BLAKE2B f68571e9be35c90a1ac02fe7d1dd1c015318777320a35fadaf32e6deab5a5a0a32b75bbb9629a7e3f36b1e9986034b7bc20b849f5ccd30b347e45389d48b9d42 SHA512 1f67f5175b698a271980b6680a16a54746ada274f5df0b86de4ae1a48148c3c3d3955ae22cf0c4dd520398572ded8c35dbd8fe478f6affad23e5e83a04956c43
DIST cprocsp-5.0.12900_amd64.tgz 31500188 BLAKE2B 721673fc4058ad5fd80599a812a529196bc6354717bd1676acd3f1d43272761f099950e25ae03db53903bac6eb7f07b9240ae143f8fcf06aa32ed2b731c2975c SHA512 ea8e9e06002a851e2edfb0ba95eb37d2a25d76ec72c82e82a6927ccce6662422bf74dbe5fc96dcecfbe50af89cb7925d8602333612661defd87c5263548ad11a
DIST cprocsp-5.0.12900_arm.tgz 31846102 BLAKE2B ce0456222b373c121da272b24cbc39247d41b6c6dd8e8f4727db692a7b7874a9048e0540611642bfe62ab9d149ad93c014ee3f167617bd6859a10ec3eed3708e SHA512 14cf91f92ae2ccba08d39d4790bc54bde97238f4c09a02d6773d0398c299a99b215adf89fd47cddb0ad956a3aa61585a0ce8e84a2a05fe9799509009e20300eb
DIST cprocsp-5.0.12900_arm64.tgz 36753992 BLAKE2B 12833a2c89ca808d7241e872fa46f6eb315dcdb89f24ee9ef110316f3a430b7581d876e887ef7bd86d46ee09fbd82c418672bcb751d31edcd57caaa1bb509dcb SHA512 3c8d1e69b33a2a9c6b663e351b5ed0f261d7e09aaf3df4d27d0e33cf828d8968c8da037b8a6fc5e23de993b6e4d25aabc15c88a7f20ad0ad8abd6c9764740742
DIST cprocsp-5.0.12900_x86.tgz 33186085 BLAKE2B 26d3bd4adaa1c5125bf95c90bd101f58dfb32738144b40548bddd1736f617d509831f1cad9e098de05ca95455595242184e01c07fe74db9e83ce7bbe1d9484e2 SHA512 157dd3665b759afa9775215a4578b321aed0338a3581f1dd58b5f8c82b19ba86454ce8c7af668563196ca9b58b7f020038df8212d26b31f948f89b26df43a344
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

inherit rpm systemd
inherit rpm systemd xdg udev

DESCRIPTION="CryptoPro Crypto Provider"

Expand All @@ -13,8 +13,6 @@ SRC_URI="
arm? ( ${P}_arm.tgz )
arm64? ( ${P}_arm64.tgz )
"
# ${P}_${ARCH}.tgz
# pkgdev doesn't support ${ARCH} ATM and throws an error

HOMEPAGE="https://cryptopro.ru/products/csp/downloads"
LICENSE="Crypto-Pro"
Expand All @@ -41,6 +39,7 @@ DEPEND="
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
Expand Down Expand Up @@ -97,15 +96,19 @@ pkg_nofetch() {
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 "Post an issue on GH in case of checksums mismatch"
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,rdr,kc1,capilite,ca-certs,pkcs11}
cprocsp-{curl,rdr}
Expand All @@ -116,30 +119,26 @@ src_unpack() {
cprocsp-{stunnel,xer2print,cptools}
cprocsp-ipsec-{genpsk,ike}
ifd-rutokens
cprocsp-pki{,-{plugin,cades}} # ,phpcades}}
)
for f in ${PKGS[@]} ${ADD_PKGS[@]}; do
find "../linux-${arch}" -name "${f}*.rpm" | while read r; do rpm_unpack "./${r}"; done
done

mv tmp opt/cprocsp
mkdir -p usr/lib
mv etc/udev usr/lib/udev

# alt-compat
# rm "${arch}"/ld-lsb-x86-64.so.3
rm etc/init.d/cprocsp
mkdir -p usr/lib || die
mv etc/udev usr/lib/udev || die

# !!! Brakes CMake !!!
# touch etc/debian_version
# echo "jessie/sid" > etc/debian_version

# cp etc/opt/cprocsp/config64.ini{,.backup} || die # What about non-64bit installs?
mkdir -p usr/${libdir}/readers/usb || die
mv usr/${libdir}/pcsc/drivers/* usr/${libdir}/readers/usb/ || die

ln -s librdrjacarta.so.5.0.0 opt/cprocsp/lib/"${arch}"/librdrjacarta.so.1.0 || die
mv opt/cprocsp/share/* usr/share/ || die
rmdir opt/cprocsp/share || die

rm opt/cprocsp/sbin/"${arch}"/oauth_gtk2 || die # linked against long outdated webkitgtk1
mkdir -p usr/lib/mozilla/plugins || die
cp -lL opt/cprocsp/lib/${arch}/libnpcades.so usr/lib/mozilla/plugins/ || die

bzip2 -d -c < "${FILESDIR}"/cprocsp_postinstal_all_scripts.sh.bz2 > "${T}"/postinst.bash
# cp etc/opt/cprocsp/config64.ini{,.backup} || die # What about non-64bit installs?
bzip2 -d -c < "${FILESDIR}"/cprocsp_postinstal_all_scripts.sh.bz2 > "${T}"/postinst.bash || die
}

src_install() {
Expand All @@ -155,9 +154,6 @@ src_install() {
exeinto /opt/cprocsp/lib/"${arch}"
doexe opt/cprocsp/lib/${arch}/*

# exeinto /etc/opt/cprocsp
# doexe ${FILESDIR}/cprocsp_postinstal_all_scripts.sh

keepdir /var/opt/cprocsp/dsrf
keepdir /var/opt/cprocsp/dsrf/db1
keepdir /var/opt/cprocsp/dsrf/db2
Expand All @@ -167,7 +163,12 @@ src_install() {
keepdir /var/opt/cprocsp/users/stores
keepdir /var/opt/cprocsp/mnt

insinto /etc/opt/cprocsp
# 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
Expand All @@ -176,20 +177,13 @@ src_install() {
newenvd - "99${PN}" <<-_EOF_
PATH=/opt/cprocsp/bin/${arch}:/opt/cprocsp/sbin/${arch}
_EOF_

insinto /usr/share
doins -r opt/cprocsp/share/*
}

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

# TODO: think about better permissions
chmod 1777 /var/opt/cprocsp/keys
chmod 1777 /var/opt/cprocsp/users
chmod 1777 /var/opt/cprocsp/tmp
chmod 775 /var/opt/cprocsp/mnt
/etc/init.d/cprocsp repair_var

ebegin "Running postinstall script (pre-configuring)"
bash "${T}"/postinst.bash &>"${T}/postinst.log"
Expand All @@ -202,6 +196,9 @@ pkg_postinst() {
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)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ case "$1" in
cpcsp_stop $2
RET=$?; test $RETVAL -eq 0 && RETVAL=$RET
;;
repair_var)
cpcsp_hsmstop $2
RET=$?; test $RETVAL -eq 0 && RETVAL=$RET
;;
hsmstop)
cpcsp_hsmstop $2
RET=$?; test $RETVAL -eq 0 && RETVAL=$RET
Expand Down
Binary file modified app-crypt/cprocsp/files/cprocsp_postinstal_all_scripts.sh.bz2
Binary file not shown.

0 comments on commit 33bbc57

Please sign in to comment.