-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathffmpeg_build_from_upstream_on_slackware
executable file
·49 lines (38 loc) · 1.62 KB
/
ffmpeg_build_from_upstream_on_slackware
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
#!/usr/bin/env bash
#===============================================================================
#
# FILE: ffmpeg_buid_from_upstream_on_slackware.sh
#
# USAGE: ./ffmpeg_buid_from_upstream_on_slackware.sh
#
# DESCRIPTION: This script will build ffmpeg from upstream source
#
# OPTIONS: ---
# REQUIREMENTS: rsync x264(this has to be installed beforehand)
# BUGS: ---
# NOTES: Shipped package with Slackware might not have all
# AUTHOR: Bhaskar Chowdhury (https://about.me/unixbhaskar), unixbhaskar@gmail.com
# ORGANIZATION: Independent
# CREATED: 08/28/2022 04:17
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
set -vx
# Get the latest version from upstream
rsync -avz rsync://mirrors.kernel.org/slackware/slackware-current/source/l/ffmpeg .
ffmpegdir="/root/ffmpeg"
cd "$ffmpegdir" || echo "Nope,not get into it ...aborting"
# Extract out the version numeric from the package name
version=$(find . -name "*.xz" -type f -print | sed -e 's#ffmpeg# #' | sed -e 's#tar.xz# #' | sed -e 's#.$# #' | sed -e 's#^./-# #')
# Change the permission of the package build script,give exec bit
chmod +x ffmpeg.SlackBuild
echo Building it ....
# This directing the build script to use x264 video codecs
sh -c "X264=yes ./ffmpeg.SlackBuild"
# Checking if the build went alright or not and take decision based on it
if [[ $? -eq 0 ]];then
echo installing the package.
sh -c "installpkg /tmp/ffmpeg-$version-x86_64-1.txz"
else
echo Build is not ok.cross check it...
fi