-
Notifications
You must be signed in to change notification settings - Fork 32
/
build_deb.sh
executable file
·60 lines (54 loc) · 2.74 KB
/
build_deb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
PACKAGE_NAME=qsvencc
PACKAGE_BIN=qsvencc
PACKAGE_MAINTAINER=rigaya
PACKAGE_DESCRIPTION=
PACKAGE_ROOT=.debpkg
PACKAGE_VERSION=`git describe --tags | cut -f 1 --delim="-"`
PACKAGE_ARCH=`uname -m`
PACKAGE_ARCH=`echo ${PACKAGE_ARCH} | sed -e 's/x86_64/amd64/g'`
if [ -e /etc/lsb-release ]; then
PACKAGE_OS_ID=`cat /etc/lsb-release | grep DISTRIB_ID | cut -f 2 --delim="="`
PACKAGE_OS_VER=`cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -f 2 --delim="="`
PACKAGE_OS_CODENAME=`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -f 2 --delim="="`
PACKAGE_OS="_${PACKAGE_OS_ID}${PACKAGE_OS_VER}"
if [ "${PACKAGE_OS_CODENAME}" = "focal" ]; then
PACKAGE_DEPENDS="libc6(>=2.29),libstdc++6(>=6)"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},intel-media-va-driver-non-free,intel-opencl-icd,libmfx1,libmfxgen1"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libva-drm2,libva-x11-2,libigfxcmrt7"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libavcodec58,libavutil56,libavformat58,libswresample3,libavfilter7,libavdevice58,libass9"
elif [ "${PACKAGE_OS_CODENAME}" = "jammy" ]; then
PACKAGE_DEPENDS="libc6(>=2.29),libstdc++6(>=6)"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},intel-media-va-driver-non-free,intel-opencl-icd,libmfx1,libmfxgen1|libmfx-gen1.2"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libva-drm2,libva-x11-2,libigfxcmrt7"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libavcodec58,libavutil56,libavformat58,libswresample3,libavfilter7,libavdevice58,libass9"
elif [ "${PACKAGE_OS_CODENAME}" = "noble" ]; then
PACKAGE_DEPENDS="libc6(>=2.22),libstdc++6(>=6)"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},intel-media-va-driver-non-free,intel-opencl-icd,libmfx-gen1.2"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libva-drm2,libva-x11-2,libigfxcmrt7"
PACKAGE_DEPENDS="${PACKAGE_DEPENDS},libavcodec60,libavutil58,libavformat60,libswresample4,libavfilter9,libavdevice60,libass9"
else
echo "${PACKAGE_OS_ID}${PACKAGE_OS_VER} ${PACKAGE_OS_CODENAME} not supported in this script!"
exit 1
fi
fi
if [ ! -e ${PACKAGE_BIN} ]; then
echo "${PACKAGE_BIN} does not exist!"
exit 1
fi
mkdir -p ${PACKAGE_ROOT}/DEBIAN
build_pkg/replace.py \
-i build_pkg/template/DEBIAN/control \
-o ${PACKAGE_ROOT}/DEBIAN/control \
--pkg-name ${PACKAGE_NAME} \
--pkg-bin ${PACKAGE_BIN} \
--pkg-version ${PACKAGE_VERSION} \
--pkg-arch ${PACKAGE_ARCH} \
--pkg-maintainer ${PACKAGE_MAINTAINER} \
--pkg-depends ${PACKAGE_DEPENDS} \
--pkg-desc ${PACKAGE_DESCRIPTION}
mkdir -p ${PACKAGE_ROOT}/usr/bin
cp ${PACKAGE_BIN} ${PACKAGE_ROOT}/usr/bin
chmod +x ${PACKAGE_ROOT}/usr/bin/${PACKAGE_BIN}
DEB_FILE="${PACKAGE_NAME}_${PACKAGE_VERSION}${PACKAGE_OS}_${PACKAGE_ARCH}.deb"
dpkg-deb -b "${PACKAGE_ROOT}" "${DEB_FILE}"