-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathmkpkg.sh
executable file
·86 lines (76 loc) · 2.75 KB
/
mkpkg.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
latest=$(git tag -l --merged master --sort='-*authordate' | head -n1)
semver_parts=(${latest//./ })
major=1
minor=${semver_parts[1]}
build=`git log -1 --format="%h"`
version=${major}.$((minor+1)).${build}
rm ./include/filletversion.h
cat > ./include/filletversion.h <<EOF
#if !defined(FILLET_VERSION_H)
#define FILLET_VERSION_H
#define FILLET_VERSION "$version"
#endif
EOF
echo "Current fillet version: ${version}"
echo "Building packager fillet"
make -f MakefileRepackage clean
make -f MakefileRepackage
if [ -f fillet_repackage ]
then
echo "fillet_repackage build completed successfully!"
else
echo "fillet_repackage did not build! please check that the development environment was properly setup!"
exit 1
fi
cp fillet_repackage ./docker_repackage
pushd docker_repackage
#sudo docker build -t dockerfillet_repackage .
#sudo docker save -o dockerfillet_repackage.tar dockerfillet_repackage
sudo docker buildx build . -t dockerfillet_repackage --output=type=tar,dest=dockerfillet_repackage.tar
sudo docker buildx build . -t dockerfillet_repackage
popd
sudo cp ./docker_repackage/dockerfillet_repackage.tar .
echo "Building transcoder fillet"
make -f MakefileTranscode clean
make -f MakefileTranscode
if [ -f fillet_transcode ]
then
echo "fillet_transcode build completed successfully!"
else
echo "fillet_transcode did not build! please check that the development environment was properly setup!"
exit 1
fi
cp fillet_transcode ./docker_transcode
pushd docker_transcode
#sudo docker build -t dockerfillet_transcode .
#sudo docker save -o dockerfillet_transcode.tar dockerfillet_transcode
sudo docker buildx build . -t dockerfillet_transcode --output=type=tar,dest=dockerfillet_transcode.tar
sudo docker buildx build . -t dockerfillet_transcode
popd
sudo cp ./docker_transcode/dockerfillet_transcode.tar .
rm -rf build
cp -a distribution build
mkdir -p ./build/var/app
mkdir -p ./build/usr/bin
mkdir -p ./build/dockerimages
cp -a ./webapp/* ./build/var/app
find build -type f -name ".gitignore" -exec rm -rf {} \;
cp fillet_repackage build/usr/bin
cp fillet_transcode build/usr/bin
sudo cp dockerfillet_repackage.tar build/dockerimages
sudo cp dockerfillet_transcode.tar build/dockerimages
sudo chmod 775 build/dockerimages/dockerfillet_repackage.tar
sudo chmod 775 build/dockerimages/dockerfillet_transcode.tar
cd build
echo "Package: fillet" > DEBIAN/control
echo "Version: $((minor+1))" >> DEBIAN/control
echo "Section: base" >> DEBIAN/control
echo "Priority: optional" >> DEBIAN/control
echo "Architecture: amd64" >> DEBIAN/control
echo "Depends:" >> DEBIAN/control
echo "Maintainer: [email protected]" >> DEBIAN/control
echo "Description: OTT-packager for DASH and HLS" >> DEBIAN/control
cd ..
deb_name=fillet-${version}.deb
dpkg-deb --build build $deb_name