Building CinelerraCV for Fedora 22 under Docker

The Dockerfile

#FROM 195a4b79eb1c
#Version 0.4

FROM Fedora-Docker-Base-22-20150521.x86_64
MAINTAINER [email protected]

RUN dnf update -y && dnf install -y mock rpmdevtools tmux htop && dnf clean all
RUN ["dnf", "install", "-y", "http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm", "http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-22.noarch.rpm"]
RUN ["/usr/sbin/useradd", "-m", "builder"]

#ENTRYPOINT ["/usr/bin/su", "-", "builder"]

VOLUME ["/home/builder"]

This Dockerfile will use Fedora Docker image (which you can download from any Fedora mirror server, and then use docker import to import the image) as the base for our builder image, then we update all packages to be up 2 date, and install all the packages needed for a basic building machine.

I also added VOLUME directive to allow me to mount a local folder from my host into the container.

The RPM .spec file

Name:       CinelerraCV
Version:    2.3
Release:    1%{?dist}
Summary:    CinelerraCV

Group:      Productivity/Multimedia/Video/Editors and Convertors
License:    GPL
URL:        http://cvs.cinelerra.org
Source0:    %{name}-58ef118e63bf2fac8c99add372c584e93b008bae.tar.gz

BuildRequires: gcc-c++ pkgconfig fltk-devel libjpeg-devel opencv-devel libtiff-devel esound-devel make libXv-devel
BuildRequires: alsa-lib-devel freetype-devel mesa-libGL-devel xorg-x11-server-devel
BuildRequires: libavc1394-devel libdv-devel OpenEXR-devel libraw1394-devel libiec61883-devel libsndfile-devel fftw3-devel
BuildRequires: libpng-devel libogg-devel  libvorbis-devel libtheora-devel libsndfile libuuid-devel nasm yasm-devel ilmbase-devel
# 
BuildRequires: ffmpeg-devel libmpeg3-devel x264-devel lame-devel faac-devel faad2-devel mjpegtools-devel a52dec-devel
###################################################################################################################
Requires:      mjpegtools

%description
An advanced content creation system for Linux. Cinelerra takes what normally is a boring server - studied in computer science classrooms, hidden in back offices - and turns it into a 50,000 watt flamethrower of multimedia editing.  That's right kids. Unlike most of the Linux solutions out there, Cinelerra requires no emulation of proprietary operating systems, no commercial add-ons, no banner advertizements, no corporate dependencies, no terrorists, just a boring old Linux box.  Cinelerra does primarily 3 main things: capturing, compositing, and editing audio and video with sample level accuracy. It's a seamless integration of audio, video, and still photos rarely experienced on a web server. If you want to make movies, you just want to defy the establishment, you want the same kind of compositing and editing suite that the big boys use, on the world's most efficient UNIX operating system, it's time for Cinelerra. 
The version you'll find in this package is the cinelerra.org community version.

%prep
%setup -q -n CinelerraCV

%build
./autogen.sh
%configure --disable-nls
make %{?_smp_mflags}

%install
%make_install


%files
%{_prefix}/bin/cinelerra
%{_prefix}/bin/mpeg3cat
%{_prefix}/bin/mpeg3dump
%{_prefix}/bin/mpeg3toc
%{_prefix}/bin/mplexlo
%{_prefix}/include/mpeg3/libmpeg3.h
%{_prefix}/include/mpeg3/mpeg3private.h
%{_prefix}/include/quicktime/qtprivate.h
%{_prefix}/include/quicktime/quicktime.h
%{_prefix}/lib/cinelerra/
%{_prefix}/%{_lib}/libavcodec-cinelerra.so
%{_prefix}/%{_lib}/libavcodec-cinelerra.so.51
%{_prefix}/%{_lib}/libavcodec-cinelerra.so.51.57.0
%{_prefix}/%{_lib}/libavdevice-cinelerra.so
%{_prefix}/%{_lib}/libavdevice-cinelerra.so.52
%{_prefix}/%{_lib}/libavdevice-cinelerra.so.52.0.0
%{_prefix}/%{_lib}/libavformat-cinelerra.so
%{_prefix}/%{_lib}/libavformat-cinelerra.so.52
%{_prefix}/%{_lib}/libavformat-cinelerra.so.52.14.0
%{_prefix}/%{_lib}/libavutil-cinelerra.so
%{_prefix}/%{_lib}/libavutil-cinelerra.so.49
%{_prefix}/%{_lib}/libavutil-cinelerra.so.49.6.0
%{_prefix}/%{_lib}/libguicast.la
%{_prefix}/%{_lib}/libguicast.so
%{_prefix}/%{_lib}/libguicast.so.1
%{_prefix}/%{_lib}/libguicast.so.1.0.0
%{_prefix}/%{_lib}/libmpeg3hv-1.5.0.so.1
%{_prefix}/%{_lib}/libmpeg3hv-1.5.0.so.1.0.0
%{_prefix}/%{_lib}/libmpeg3hv.la
%{_prefix}/%{_lib}/libmpeg3hv.so
%{_prefix}/%{_lib}/libquicktimehv-1.6.0.so.1
%{_prefix}/%{_lib}/libquicktimehv-1.6.0.so.1.0.0
%{_prefix}/%{_lib}/libquicktimehv.la
%{_prefix}/%{_lib}/libquicktimehv.so
%{_prefix}/%{_lib}/vhook/drawtext.so
%{_prefix}/%{_lib}/vhook/fish.so
%{_prefix}/%{_lib}/vhook/null.so
%{_prefix}/%{_lib}/vhook/ppm.so
%{_prefix}/%{_lib}/vhook/watermark.so
%{_datadir}/applications/cinelerra-cv.desktop
%{_datadir}/pixmaps/cinelerra-cv.xpm


%changelog
* Tue Aug 25 2015 Rabin .Y <[email protected]> - 2.3
- new release CV 2.3

Run & Build

Into the the container with

docker run -it --rm -v /opt/rpmbuilder:/home/builder rabin/builder02 /usr/bin/tmux
# one time set up
# to set the working dir for rpmdev-setuptree
echo '%_topdir /home/builder/rpmbuild' > ~/.rpmmacros

rpmdev-setuptree

# and this will give you this folder structure 
rpmbuild/
├── BUILD/
├── BUILDROOT/
├── RPMS/
├── SOURCES/
├── SPECS/
└── SRPMS/

And now put the .spec file in the SPECS/ folder, and the downloaded tar.gz file into SOURCES/.

If you need to download the source file you can runs this command, which will got and fetch the source# files into the SOURCES folder.

cd ~/rpmbuild/SOURCES/ && spectool -g ../SPECS/file.spec

rpmbuild

You can use -bX options to run only specific builds, e.g

-bp -- build through %prep (unpack sources and apply patches) from <specfile>
-bc -- build through %build (%prep, then compile) from <specfile>
-bi -- build through %install (%prep, %build, then install) from <specfile>
-bl -- verify %files section from <specfile>

So let start with prep section prep

cd ~/rpmbuild && rpmbuild -bp SPECS/CinelerraCV.spec

next build,

rpmbuild [--short-circuit] -bc SPECS/CinelerraCV.spec

note that you can use the –short-circuit flag to run only the specific build and not running all the stages up to the build you want.

more flags,

-ba -- build source and binary packages from <specfile>
-bb -- build binary package only from <specfile>
-bs -- build source package only from <specfile>

… Next is to learn how to use mock …

Side notes

Import a Docker image

docker import --help

Usage: docker import [OPTIONS] URL|- [REPOSITORY[:TAG]]

Create an empty filesystem image and import the contents of the
tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then
optionally tag it.

  -c, --change=[]    Apply Dockerfile instruction to the created image
  --help=false       Print usage
# docker images
REPOSITORY                              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
Fedora-Docker-Base-22-20150521.x86_64   latest              195a4b79eb1c        3 months ago        186.5 MB

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *