From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-apps@cygwin.com
Subject: Re: [ITP] openh264 (2.3.1)
Date: Wed, 15 Feb 2023 06:21:52 +0900 [thread overview]
Message-ID: <20230215062152.474ad26d8c3b4a9bd0d2bb82@nifty.ne.jp> (raw)
In-Reply-To: <878rh0w66r.fsf@Otto.invalid>
[-- Attachment #1: Type: text/plain, Size: 669 bytes --]
On Tue, 14 Feb 2023 17:41:16 +0100
ASSI wrote:
> Takashi Yano via Cygwin-apps writes:
> > Thanks for the advice. I have revised the cygport file.
>
> You are getting the file and the hash from the same unprotected source.
> I was thinking you should put the hash into the cygport file and hence
> the postinstall script.
>
> Also note that the system doing the postinstall will not necessarily
> have internet access, so you'll need to cope with errors that will
> produce.
Thanks.
The new cygport file attached downloads md5hash during
the packaging process and embeds it into postinstall
script. Does this make sense?
--
Takashi Yano <takashi.yano@nifty.ne.jp>
[-- Attachment #2: openh264.cygport --]
[-- Type: text/plain, Size: 3164 bytes --]
NAME="openh264"
VERSION=2.3.1
RELEASE=1
CATEGORY="Video"
SUMMARY="H.264 codec library by Cisco"
DESCRIPTION="OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. The binary library (runtime) itself will be downloaded from http://ciscobinary.openh264.org/"
HOMEPAGE="https://www.openh264.org/"
LICENSE="BSD-2-Clause"
ARCH="noarch" # This is noarch because it's just header files and shell scrpits.
SRC_URI="${NAME}-headers-${VERSION}.tar.xz"
# Make dummy source file for prep if the cleaned one is not exist.
if [ ! -f ${SRC_URI} ]
then
mkdir ${NAME}-${VERSION}
touch ${NAME}-${VERSION}/dummy
tar acf ${SRC_URI} ${NAME}-${VERSION}
rm -rf ${NAME}-${VERSION}
fi
CYGPORT_USE_UNSTABLE_API=1
src_unpack_hook() {
if [ $(tar tvf ../../../${SRC_URI} | wc -l) -eq 2 ] # Source file is dummy
then
NV=${NAME}-${VERSION}
pushd ..
rm -rf ${NV} # Remove dummy source file.
# Download original source file.
wget https://github.com/cisco/openh264/archive/refs/tags/v${VERSION}.tar.gz
tar xf v${VERSION}.tar.gz
rm -f v${VERSION}.tar.gz
# Make source file which has only necessary header files.
tar acf ../../${NAME}-headers-${VERSION}.tar.xz ${NV}/codec/api/wels/*.h
# Update source directory.
rm -rf ${NV}
tar xf ../../${NAME}-headers-${VERSION}.tar.xz
popd
fi
}
PKG_NAMES="libopenh264 libopenh264-headers"
libopenh264_CATEGORY="Video Libs"
libopenh264_CONTENTS="etc/"
libopenh264_REQUIRES="wget bzip2"
libopenh264_SUMMARY="H.264 codec library runtime by Cisco"
libopenh264_headers_CATEGORY="Video Devel"
libopenh264_headers_CONTENTS="usr/include"
libopenh264_headers_SUMMARY="H.264 codec library headers"
src_compile() {
:
}
src_install() {
mkdir -p ${D}/usr/include
ln -fs ${S}/codec/api/wels ${D}/usr/include/.
mkdir -p ${D}/etc/postinstall
MD5HASH64=$(wget -q http://ciscobinary.openh264.org/${NAME}-${VERSION}-win64.dll.signed.md5.txt -O - | sed "s/dll$/tmp/")
MD5HASH32=$(wget -q http://ciscobinary.openh264.org/${NAME}-${VERSION}-win32.dll.signed.md5.txt -O - | sed "s/dll$/tmp/")
if [ ! "${MD5HASH64}" -o ! "${MD5HASH32}" ]
then
echo "Need internet access!!!"
exit 1
fi
cat << _EOF_ > ${D}/etc/postinstall/lib${NAME}.sh
#!/bin/sh
pushd /tmp
if [ \$(uname -m) = "x86_64" ]
then
POSTFIX="win64"
MD5HASH="${MD5HASH64}"
else
POSTFIX="win32"
MD5HASH="${MD5HASH32}"
fi
wget -q http://ciscobinary.openh264.org/${NAME}-${VERSION}-\${POSTFIX}.dll.bz2 -O - | bunzip2 > ${NAME}-${VERSION}-\${POSTFIX}.tmp
if echo "\${MD5HASH}" | md5sum --status -c
then
mv ${NAME}-${VERSION}-\${POSTFIX}.tmp /usr/bin/libopenh264.dll
else
# Hash mismatch (or failed to download)
rm ${NAME}-${VERSION}-\${POSTFIX}.tmp
exit 1
fi
popd
chmod a+x /usr/bin/libopenh264.dll
mkdir -p /usr/share/doc/lib${NAME}
wget -q http://www.openh264.org/BINARY_LICENSE.txt -O - > /usr/share/doc/lib${NAME}/BINARY_LICENSE.txt
_EOF_
chmod a+x ${D}/etc/postinstall/lib${NAME}.sh
mkdir -p ${D}/etc/preremove
cat << _EOF_ > ${D}/etc/preremove/lib${NAME}.sh
#!/bin/sh
rm -rf /usr/bin/libopenh264.dll /usr/share/doc/lib${NAME}
_EOF_
chmod a+x ${D}/etc/preremove/lib${NAME}.sh
}
next prev parent reply other threads:[~2023-02-14 21:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-05 8:37 Takashi Yano
2023-02-05 16:36 ` Jon Turney
2023-02-06 12:22 ` Takashi Yano
2023-02-06 2:44 ` Yaakov Selkowitz
2023-02-06 5:11 ` Brian Inglis
2023-02-06 5:16 ` Yaakov Selkowitz
2023-02-06 5:25 ` Takashi Yano
2023-02-09 12:02 ` Takashi Yano
2023-02-10 4:35 ` Yaakov Selkowitz
2023-02-10 5:05 ` Takashi Yano
2023-02-10 5:18 ` Takashi Yano
2023-02-10 5:25 ` Takashi Yano
2023-02-13 18:30 ` Jon Turney
2023-02-13 19:03 ` Brian Inglis
2023-02-14 9:11 ` Takashi Yano
2023-02-14 11:02 ` ASSI
2023-02-14 12:28 ` Takashi Yano
2023-02-14 16:41 ` ASSI
2023-02-14 21:21 ` Takashi Yano [this message]
2023-02-16 19:24 ` Jon Turney
2023-02-17 8:49 ` Takashi Yano
2023-02-19 15:37 ` Jon Turney
2023-02-20 8:55 ` Takashi Yano
2023-02-21 14:11 ` Jon Turney
2023-02-22 3:33 ` Takashi Yano
2023-02-23 12:54 ` Jon Turney
2023-02-24 9:16 ` Takashi Yano
2023-02-06 22:40 ` Lee
2023-02-07 5:19 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230215062152.474ad26d8c3b4a9bd0d2bb82@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).