Wednesday, October 24, 2007

Building MIMMS on Fedora Core 6 / blag Linux - Download mms:// streams !

PROBLEM: You want to download a mms:// video stream to your Hard Disk
You find about MiMMS but found no up to date RPM for your system, and soon find that compiling it is a total nightmare.

SOLUTION:
I'm posting this in the interest of helping folks running blag Linux or Fedora Core 6 to build the MIMMS client on their systems. MiMMS is a Free Software program that downloads MMS:// video streaming URLs to your hard disk.

EXPLANATION:
The original program is provided over here at GNU.org. The problem is that the build process (just running "make") will complain about AN AWFUL LOT of missing pieces and libraries, with no further help in finding what's missing.

Well, since I'm shaved bald, I've saved you from all the HAIR PULLING.

Here's an example of all the errors you might encounter (I'm pasting here so Google searches can find this entry).

Error #1: Missing QT4-make
===========================================================
# make
qmake-qt4 -o Makefile.qmake
make: qmake-qt4: Command not found
make: *** [Makefile.qmake] Error 127
[root@m6810 mimms-2.0.1]#
===========================================================

Error #2: Missing C++ compiler
===========================================================
# make
qmake-qt4 -o Makefile.qmake
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
make[1]: g++: Command not found
make[1]: *** [mimms.o] Error 127
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]#
===========================================================


Error #3: Missing libmms development libs
===========================================================
# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
mimms.cpp:28:17: error: mms.h: No such file or directory
mimms.cpp:29:18: error: mmsh.h: No such file or directory
mimms.cpp: In function ‘int main(int, char**)’:
mimms.cpp:238: error: ‘mms_t’ was not declared in this scope
mimms.cpp:238: error: ‘mms’ was not declared in this scope
mimms.cpp:239: error: ‘mmsh_t’ was not declared in this scope
mimms.cpp:239: error: ‘mmsh’ was not declared in this scope
mimms.cpp:321: error: ‘mms_connect’ was not declared in this scope
mimms.cpp:330: error: ‘mmsh_connect’ was not declared in this scope
mimms.cpp:341: error: ‘mms_get_length’ was not declared in this scope
mimms.cpp:341: error: ‘mmsh_get_length’ was not declared in this scope
mimms.cpp:386: error: ‘mms_read’ was not declared in this scope
mimms.cpp:387: error: ‘mmsh_read’ was not declared in this scope
mimms.cpp:400: error: ‘mms_get_current_pos’ was not declared in this scope
mimms.cpp:400: error: ‘mmsh_get_current_pos’ was not declared in this scope
make[1]: *** [mimms.o] Error 1
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]#
===========================================================


Error #4: Missing glib.h
===========================================================
# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
In file included from /usr/include/libmms/mms.h:41,
from mimms.cpp:28:
/usr/include/libmms/bswap.h:25:18: error: glib.h: No such file or directory
make[1]: *** [mimms.o] Error 1
make[1]: Leaving directory `/incoming/mimms-2.0.1'
make: *** [build] Error 2
[root@m6810 mimms-2.0.1]# locate glib.h
/mnt/Windows/Qt/4.0.1/src/3rdparty/libjpeg/jpeglib.h
/usr/include/jpeglib.h
[root@m6810 mimms-2.0.1]#
===========================================================

SOLUTION: Use apt-get to install all the required libs BEFORE running make:

apt-get install gnu-c++ qt4-devel glib-devel glib2-devel libmms libmms-devel

That's it!. Now we type make and everything's fine:

WE COMPILE IT!:

# make
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include -I. -Ilibmms -I/usr/include/libmms -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I. -o mimms.o mimms.cpp
g++ -o mimms mimms.o -lmms -lQtCore -lpthread
make[1]: Leaving directory `/incoming/mimms-2.0.1'
[root@m6810 mimms-2.0.1]#

AND WE INSTALL IT!

# make install
make -f Makefile.qmake
make[1]: Entering directory `/incoming/mimms-2.0.1'
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `/incoming/mimms-2.0.1'
install -m755 -D mimms //usr/local/bin/mimms
install -m644 -D mimms.1 //usr/local/share/man/man1/mimms.1

DOES IT WORK? YES!

# mimms -h
MiMMS 2.0.1 - MiMMS isn't an MMS Message Sender.
It's an MMS (e.g. mms://) stream downloader.
Usage: mimms [options] [output]
Options:
-c, --clobber Allow overwriting an existing file;
by default, this is not allowed.
-t, --time Record for the given number of minutes;
by default, record until the end.
-v, --verbose Print verbose debug messages on stderr.
-q, --quiet Don't print status messages on stdout.
-h, --help Show this help message on stdout.
URL Argument:
mms (MMS) i.e. mms://[:port]/
will try all supported methods.
mmst (MMS TCP) i.e. mmst://[:port]/
will only try TCP method.
mmsu (MMS UDP) Not currently supported; (poorly suited
for streaming downloads anyway).
mmsh (MMS HTTP) i.e. mmsh://[:port]/
will only try HTTP method.
http (ASX HTTP) i.e. http://[:port]/[.asx]
only the first supported URL is used.
- (stdin) i.e. look for an MMS URL on stdin;
only the first supported URL is used.
Output Argument:
none Streams to file named based on the URL.
filename Streams to the given file.
- Streams to stdout. (Implies --quiet.)
[root@m6810 mimms-2.0.1]#

FINAL STEP: WE TEST IT...


No comments: