You are not logged in.

#1 2008-11-27 12:58:09

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

building mplayerd

I am trying to do build mplayerd in preparation for making a PKGBUILD. The isntallation instructions are standard make && make install. However, make soon encounters an error, that googling hasn't been able to help me out with (the results are too technical):

$ make
gcc -Iinc -g -DDEBUG -Wall   -c -o client.o client.c
In file included from client.c:31:
inc/client.h:53: error: 'PATH_MAX' undeclared here (not in a function)
make: *** [client.o] Error 1

Is PATH_MAX just a variable? What am I missing?

Any help appreciated.

Offline

#2 2008-12-02 09:27:20

kumyco
Member
From: somewhere
Registered: 2008-06-23
Posts: 153
Website

Re: building mplayerd

mplayerd.patch

--- Makefile    2004-04-29 17:48:31.000000000 +0100
+++ Makefile.ky    2008-12-02 09:22:27.025165240 +0000
@@ -1,10 +1,13 @@
+DESTDIR = .
+prefix = $(DESTDIR)/usr
+
 CC=gcc
 BINARY=mplayerd
 
 CFLAGS=-Iinc -g -DDEBUG -Wall
 
 MPLAYERD_OBJS=client_request.o ll.o mplayer_command.o mplayer_slave.o fileops.o client.o parse_config.o history.o xmemory.o debug.o tab_comp.o instance.o
-MPLAYERD_CFLAGS=
+MPLAYERD_CFLAGS=$(CFLAGS)
 MPLAYERD_LIBS=-lpthread
 
 all: mplayerd
@@ -17,8 +20,11 @@
     >valgrind.log
 
 install: all install_complete_message
-    install -m 0555 ${BINARY} /usr/local/bin/
-    install -m 0555 ../mplayerd.1 /usr/local/man/man1/mplayerd.1
+    install -d $(DESTDIR)/etc
+    install -d $(prefix)/{etc,bin/,man/man1/}
+    install -m0755 ${BINARY} $(prefix)/bin/${BINARY}
+    install -m0755 ../mplayerd.1 $(prefix)/man/man1/mplayerd.1
+    install -m0644 ../mplayerd.conf $(DESTDIR)/etc/mplayerd.conf
 
 build: clean all
 
@@ -26,8 +32,6 @@
     @echo -e "!!\r\n!!\r\n!!\tPlease report bugs to mplayerd-bugs@signuts.net"
     @echo -e "!!\r\n!!\tLinking mplayerd..."
     @echo -e "!!\r\n"
-    @echo -e "!!Do a 'make install_config' or just copy the config file"
-    @echo -e "!!\r\n"
 
 install_complete_message:
     @echo -e "!!\r\n!!\tBe sure to edit /etc/mplayerd.conf, consult the README"
@@ -35,7 +39,4 @@
     @echo -e "!!\r\n"
 
 uninstall:
-    rm -f /usr/local/bin/mplayerd
-
-install_config:
-    install -m 0555 ../mplayerd.conf /etc/mplayerd.conf
+    rm -f $(prefix)/bin/mplayerd
--- inc/config.h    2004-04-29 17:48:31.000000000 +0100
+++ inc/config.h.ky    2008-12-02 09:13:13.406045640 +0000
@@ -30,6 +30,8 @@
 #ifndef HAVE_CONFIG_H
 #define HAVE_CONFIG_H
 
+#include <linux/limits.h>
+
 #include "mplayerd-version.h"
 
 /* tab completion */

assuming mplayer.patch is int he $srcdir
and you've already `cd` to $srcdir/mplayerd-0.1.16/src

patch with

patch -p0 -i $srcdir/mplayer.patch || return 1

build with

make && make DESTDIR=$pkgdir install || return 1

EDIT:
PATH_MAX is #defined in <linux/limits.h>

Last edited by kumyco (2008-12-02 09:28:53)

Offline

#3 2008-12-02 10:50:10

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: building mplayerd

Excellent - thank you so very much, kumyco smile I think I understand the alterations to the makefile whereas I'm a bit at a loss to understand the config file changes. limits.h is a file specific to Arch?

At any rate it has built nicely now, so I'll go ahead and post it to the AUR - seeing how it is a daemon I suppose it really should have a /etc/rc.d/ script to accompany it but that'll be a job for later.

Thanks again.

Offline

#4 2008-12-02 22:08:18

chochem
Member
From: Denmark
Registered: 2008-03-02
Posts: 176
Website

Re: building mplayerd

The PKGBUILD is up but I have to admit to I have to admit to being a tad disappointed in the program. You can telnet into it alright but none of the usual telnet scripting tricks work with it and I can't get it to work with streaming media which was kinda the reason I became interested (using it as a radio that could switch station with a simple command)

If anybody installs it and finds a way to do either of these things, please let me know.

Offline

Board footer

Powered by FluxBB