1.1 --- a/gmyth-stream/client/src/gmyth-stream-client.c Thu Apr 12 15:12:12 2007 +0100
1.2 +++ b/gmyth-stream/client/src/gmyth-stream-client.c Thu Apr 12 20:35:08 2007 +0100
1.3 @@ -4,65 +4,130 @@
1.4
1.5 #include <sys/types.h>
1.6 #include <sys/socket.h>
1.7 +#include <arpa/inet.h>
1.8 #include <netdb.h>
1.9 #include <netinet/in.h>
1.10 #include <unistd.h>
1.11 #include <glib.h>
1.12 #include <glib/gprintf.h>
1.13 #include <string.h>
1.14 -
1.15 +#include <stdlib.h>
1.16
1.17 #include "gmyth-stream-client.h"
1.18
1.19 +#define BUFFER_SIZE 1024
1.20
1.21 #define GMYTH_STREAM_CLIENT_GET_PRIVATE(obj) \
1.22 - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClientPrivate))
1.23 + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GMYTH_TYPE_STREAM_CLIENT,\
1.24 + GMythStreamClientPrivate))
1.25 +
1.26 +
1.27 +typedef struct _sock _socket;
1.28 +struct _sock
1.29 +{
1.30 + gint fd;
1.31 + struct sockaddr_in addr;
1.32 +};
1.33
1.34
1.35 typedef struct _GMythStreamClientPrivate GMythStreamClientPrivate;
1.36 -
1.37 struct _GMythStreamClientPrivate
1.38 {
1.39 - GList *streams;
1.40 - struct hostent *host;
1.41 - gint sock;
1.42 - gboolean connected;
1.43 - struct sockaddr_in addr;
1.44 + const gchar *host;
1.45 + _socket* sock;
1.46 + _socket* sock_stream;
1.47 + gboolean connected;
1.48 };
1.49
1.50 -typedef struct _StreamData StreamData;
1.51
1.52 -struct _StreamData
1.53 -{
1.54 - guint id;
1.55 - guint port;
1.56 - gint s;
1.57 -};
1.58 -
1.59 -static void gmyth_stream_client_class_init (GMythStreamClientClass *klass);
1.60 -static void gmyth_stream_client_init (GMythStreamClient *object);
1.61 -static void gmyth_stream_client_dispose (GObject *object);
1.62 -static void gmyth_stream_client_finalize (GObject *object);
1.63 -static StreamData* gmtyh_stream_client_get_streamdata (GMythStreamClient *self,
1.64 - guint stream_id);
1.65 +static void gmyth_stream_client_class_init (GMythStreamClientClass *klass);
1.66 +static void gmyth_stream_client_init (GMythStreamClient *object);
1.67 +static void gmyth_stream_client_dispose (GObject *object);
1.68 +static void gmyth_stream_client_finalize (GObject *object);
1.69
1.70
1.71 G_DEFINE_TYPE(GMythStreamClient, gmyth_stream_client, G_TYPE_OBJECT)
1.72
1.73 +
1.74 +static _socket*
1.75 +create_socket (const gchar* hostname, gint port)
1.76 +{
1.77 + _socket* sock = (_socket*)g_malloc(sizeof(_socket));
1.78 +
1.79 + sock->fd = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
1.80 + if (sock->fd == -1) {
1.81 + g_debug ("Fail to create sock");
1.82 + g_free(sock);
1.83 + return NULL;
1.84 + }
1.85 +
1.86 + sock->addr.sin_family = AF_INET;
1.87 + sock->addr.sin_addr.s_addr = inet_addr(hostname);
1.88 + sock->addr.sin_port = htons(port);
1.89 +
1.90 + if (connect (sock->fd, (struct sockaddr *) &(sock->addr), \
1.91 + sizeof (sock->addr)) == -1) {
1.92 + g_debug ("Fail to connect with server");
1.93 + g_free(sock);
1.94 + return NULL;
1.95 + }
1.96 +
1.97 + return sock;
1.98 +}
1.99 +
1.100 +static gint
1.101 +read_message (int socket)
1.102 +{
1.103 + gint64 total_read = 0;
1.104 + gint result = -1;
1.105 + gchar buffer[BUFFER_SIZE];
1.106 + gchar** response;
1.107 +
1.108 + total_read = recv(socket, buffer, BUFFER_SIZE, 0);
1.109 +
1.110 + if (total_read > 0) {
1.111 + response = g_strsplit_set(buffer, " +\n", 8);
1.112 +
1.113 + if ( g_ascii_strcasecmp(response[0], "OK") == 0 ) {
1.114 +
1.115 + int payload = atoi(response[1]);
1.116 +
1.117 + if (payload == 0)
1.118 + result = 0;
1.119 +
1.120 + else if (payload == 1) {
1.121 + total_read = recv(socket, buffer, BUFFER_SIZE, 0);
1.122 +
1.123 + response = g_strsplit_set(buffer, "+\n", 8);
1.124 + result = atoi(response[1]);
1.125 + }
1.126 +
1.127 + }
1.128 +
1.129 + g_strfreev(response);
1.130 + }
1.131 +
1.132 + return result;
1.133 +}
1.134 +
1.135 +
1.136 static void
1.137 gmyth_stream_client_class_init (GMythStreamClientClass *klass)
1.138 {
1.139 - GObjectClass *gobject_class;
1.140 - gobject_class = (GObjectClass *) klass;
1.141 + GObjectClass *gobject_class;
1.142 + gobject_class = (GObjectClass *) klass;
1.143
1.144 - g_type_class_add_private (klass, sizeof (GMythStreamClientPrivate));
1.145 - gobject_class->dispose = gmyth_stream_client_dispose;
1.146 - gobject_class->finalize = gmyth_stream_client_finalize;
1.147 + g_type_class_add_private (klass, sizeof (GMythStreamClientPrivate));
1.148 + gobject_class->dispose = gmyth_stream_client_dispose;
1.149 + gobject_class->finalize = gmyth_stream_client_finalize;
1.150 }
1.151
1.152 static void
1.153 gmyth_stream_client_init (GMythStreamClient *self)
1.154 {
1.155 + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.156 + priv->sock = NULL;
1.157 + priv->sock_stream = NULL;
1.158 }
1.159
1.160 static void
1.161 @@ -80,33 +145,18 @@
1.162 GMythStreamClient*
1.163 gmyth_stream_client_new ()
1.164 {
1.165 - return GMYTH_STREAM_CLIENT (g_object_new (GMYTH_TYPE_STREAM_CLIENT, NULL));
1.166 + return GMYTH_STREAM_CLIENT (g_object_new (GMYTH_TYPE_STREAM_CLIENT, NULL));
1.167 }
1.168
1.169 gboolean
1.170 gmyth_stream_client_connect (GMythStreamClient *self, const gchar *server, guint port)
1.171 {
1.172 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.173 - g_return_val_if_fail (priv->connected == FALSE, TRUE);
1.174 + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.175 + g_return_val_if_fail (priv->connected == FALSE, TRUE);
1.176
1.177 - priv->sock = socket (PF_INET, SOCK_STREAM, 0);
1.178 - if (priv->sock == -1) {
1.179 - g_debug ("Fail to create sock");
1.180 - return FALSE;
1.181 - }
1.182 -
1.183 - memset(&(priv->addr), 0, sizeof(priv->addr));
1.184 - priv->host = gethostbyname(server);
1.185 - memcpy(&(priv->addr), *(priv->host->h_addr_list), sizeof(struct in_addr));
1.186 - priv->addr.sin_family = AF_INET;
1.187 - priv->addr.sin_port = htons (port);
1.188 -
1.189 - if (connect (priv->sock, (struct sockaddr *) &(priv->addr), sizeof (priv->addr)) == -1) {
1.190 - g_debug ("Fail to connect with server");
1.191 - shutdown (priv->sock, SHUT_RDWR);
1.192 - priv->sock = -1;
1.193 - return FALSE;
1.194 - }
1.195 + priv->host = server;
1.196 + priv->sock = create_socket (server, port);
1.197 + if (priv->sock == NULL) return FALSE;
1.198
1.199 priv->connected = TRUE;
1.200 return TRUE;
1.201 @@ -117,146 +167,85 @@
1.202 {
1.203 GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.204
1.205 - g_return_if_fail (priv->connected == FALSE);
1.206 + g_return_if_fail (priv->connected == TRUE);
1.207
1.208 - GList *lst = priv->streams;
1.209 -
1.210 - for (; lst != NULL; lst = lst->next) {
1.211 - StreamData *data = (StreamData *) lst->data;
1.212 - gmyth_stream_client_close_stream (self, data->id);
1.213 - }
1.214 -
1.215 - close (priv->sock);
1.216 - shutdown (priv->sock, SHUT_RDWR);
1.217 - priv->sock = -1;
1.218 + close (priv->sock->fd);
1.219 + //shutdown (priv->sock->fd, SHUT_RDWR);
1.220 + priv->sock->fd = -1;
1.221 priv->connected = FALSE;
1.222 }
1.223
1.224 -guint
1.225 +gint
1.226 gmyth_stream_client_open_stream (GMythStreamClient *self,
1.227 - const gchar* file_name,
1.228 - const gchar* mux,
1.229 - const gchar* vcodec,
1.230 - guint vbitrate,
1.231 - gdouble fps,
1.232 - const gchar* acodec,
1.233 - guint abitrate,
1.234 - guint width, guint height,
1.235 - guint port,
1.236 - const gchar* opt)
1.237 + const gchar* file_name,
1.238 + const gchar* mux,
1.239 + const gchar* vcodec,
1.240 + guint vbitrate,
1.241 + gdouble fps,
1.242 + const gchar* acodec,
1.243 + guint abitrate,
1.244 + guint width, guint height,
1.245 + const gchar* opt)
1.246 {
1.247 - gchar *cmd;
1.248 - StreamData *data = NULL;
1.249 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.250 + gchar *cmd;
1.251 + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.252
1.253 - g_return_val_if_fail (priv->connected == TRUE, FALSE);
1.254 - g_return_val_if_fail (file_name != NULL, FALSE);
1.255 + g_return_val_if_fail (priv->connected == TRUE, FALSE);
1.256 + g_return_val_if_fail (file_name != NULL, FALSE);
1.257
1.258 - cmd = g_strdup_printf ("SETUP %s %s %s %d %f %s %d %d %d %d %s\n",
1.259 - file_name,
1.260 - (mux == NULL? "X" : mux),
1.261 - (vcodec == NULL ? "X" : vcodec),
1.262 - vbitrate,
1.263 - fps,
1.264 - (acodec == NULL ? "X" : acodec),
1.265 - abitrate,
1.266 - width, height, port,
1.267 - (opt == NULL ? "X" : opt));
1.268 + cmd = g_strdup_printf ("SETUP %s %s %s %d %f %s %d %d %d %s\n",
1.269 + file_name,
1.270 + (mux == NULL ? "X" : mux),
1.271 + (vcodec == NULL ? "X" : vcodec),
1.272 + vbitrate,
1.273 + fps,
1.274 + (acodec == NULL ? "X" : acodec),
1.275 + abitrate,
1.276 + width, height,
1.277 + (opt == NULL ? "X" : opt) );
1.278
1.279 - if (send (priv->sock, cmd, strlen (cmd), MSG_CONFIRM) == -1) {
1.280 - g_free (cmd);
1.281 - return -1;
1.282 - }
1.283 - g_free (cmd);
1.284 + if (send (priv->sock->fd, cmd, strlen (cmd), MSG_CONFIRM) == -1) {
1.285 + g_free (cmd);
1.286 + return -1;
1.287 + }
1.288 + g_free (cmd);
1.289
1.290 + read_message(priv->sock->fd);
1.291
1.292 - data = g_new0 (StreamData, 1);
1.293 - data->port = port;
1.294 - data->id = data->s = socket (PF_INET, SOCK_STREAM, 0);
1.295 -
1.296 -
1.297 - priv->streams = g_list_append (priv->streams, data);
1.298 - return data->id;
1.299 + return 0;
1.300 }
1.301
1.302 -static gchar**
1.303 -_parse_return (int fd)
1.304 +
1.305 +gint
1.306 +gmyth_stream_client_play_stream (GMythStreamClient *self)
1.307 {
1.308 + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.309
1.310 -}
1.311 + g_return_val_if_fail (priv->connected == TRUE, FALSE);
1.312
1.313 -gboolean
1.314 -gmyth_stream_client_play_stream (GMythStreamClient *self,
1.315 - guint stream_id)
1.316 -{
1.317 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.318 - StreamData *data;
1.319 - struct sockaddr_in addr;
1.320 - gchar **retval;
1.321 + if (send (priv->sock->fd, "PLAY\n", 5, 0) == -1) {
1.322 + return -1;
1.323 + }
1.324
1.325 - g_return_val_if_fail (priv->connected == TRUE, FALSE);
1.326 + gint port = read_message(priv->sock->fd);
1.327 + priv->sock_stream = create_socket(priv->host, port);
1.328
1.329 - data = gmtyh_stream_client_get_streamdata (self, stream_id);
1.330 - g_return_val_if_fail (data != NULL, FALSE);
1.331 -
1.332 - if (send (priv->sock, "PLAY\n", 5, MSG_MORE) == -1) {
1.333 - return FALSE;
1.334 - }
1.335 -
1.336 - retval = _read_message (priv->sock);
1.337 -
1.338 - g_usleep (10 * G_USEC_PER_SEC);
1.339 -
1.340 - memset(&addr, 0, sizeof(addr));
1.341 - memcpy(&addr, *(priv->host->h_addr_list), sizeof(struct in_addr));
1.342 - addr.sin_family = AF_INET;
1.343 - addr.sin_port = htons (data->port);
1.344 - g_debug ("request connection on port %d", data->port);
1.345 - if (connect(data->s,(struct sockaddr*) &addr, sizeof(addr)) == -1)
1.346 - g_warning ("Fail to connect to server");
1.347 -
1.348 - return TRUE;
1.349 + return priv->sock_stream->fd;
1.350 }
1.351
1.352 void
1.353 -gmyth_stream_client_pause_stream (GMythStreamClient *self,
1.354 - guint stream_id)
1.355 +gmyth_stream_client_close_stream (GMythStreamClient *self)
1.356 {
1.357 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.358 + GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.359 + g_return_if_fail (priv->connected == TRUE);
1.360
1.361 - g_return_if_fail (priv->connected == TRUE);
1.362 + if (send (priv->sock->fd, "STOP\n", 5, 0) == -1) {
1.363 + return;
1.364 + }
1.365
1.366 - if (send (priv->sock, "PAUSE\n", 6, MSG_MORE) == -1) {
1.367 - return;
1.368 - }
1.369 + read_message(priv->sock->fd);
1.370 +
1.371 + close(priv->sock_stream->fd);
1.372 + g_free(priv->sock_stream);
1.373 + priv->sock_stream = NULL;
1.374 }
1.375 -
1.376 -void
1.377 -gmyth_stream_client_close_stream (GMythStreamClient *self,
1.378 - guint stream_id)
1.379 -{
1.380 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.381 -
1.382 - g_return_if_fail (priv->connected == TRUE);
1.383 - if (send (priv->sock, "STOP\n", 5, MSG_MORE) == -1) {
1.384 - return;
1.385 - }
1.386 - //TODO: remove from streams list
1.387 -}
1.388 -
1.389 -static StreamData*
1.390 -gmtyh_stream_client_get_streamdata (GMythStreamClient *self,
1.391 - guint stream_id)
1.392 -{
1.393 - GMythStreamClientPrivate *priv = GMYTH_STREAM_CLIENT_GET_PRIVATE (self);
1.394 - GList *lst;
1.395 -
1.396 - lst = priv->streams;
1.397 - for (; lst != NULL; lst = lst->next) {
1.398 - StreamData *data = (StreamData *) lst->data;
1.399 - if (data->id == stream_id) {
1.400 - return data;
1.401 - }
1.402 - }
1.403 - return NULL;
1.404 -}
2.1 --- a/gmyth-stream/client/src/gmyth-stream-client.h Thu Apr 12 15:12:12 2007 +0100
2.2 +++ b/gmyth-stream/client/src/gmyth-stream-client.h Thu Apr 12 20:35:08 2007 +0100
2.3 @@ -9,11 +9,11 @@
2.4 typedef struct _GMythStreamClientClass GMythStreamClientClass;
2.5
2.6 struct _GMythStreamClientClass {
2.7 - GObjectClass parent_class;
2.8 + GObjectClass parent_class;
2.9 };
2.10
2.11 struct _GMythStreamClient {
2.12 - GObject parent;
2.13 + GObject parent;
2.14 };
2.15
2.16 /* TYPE MACROS */
2.17 @@ -31,29 +31,29 @@
2.18 (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TYPE_STREAM_CLIENT, GMythStreamClientClass))
2.19
2.20
2.21 -GType gmyth_stream_client_get_type (void);
2.22 -GMythStreamClient* gmyth_stream_client_new (void);
2.23 -gboolean gmyth_stream_client_connect (GMythStreamClient *self,
2.24 - const gchar *server, guint port);
2.25 -void gmyth_stream_client_disconnect (GMythStreamClient *self);
2.26 -guint gmyth_stream_client_open_stream (GMythStreamClient *self,
2.27 - const gchar* file_name,
2.28 - const gchar* mux,
2.29 - const gchar* vcodec,
2.30 - guint vbitrate,
2.31 - gdouble fps,
2.32 - const gchar* acodec,
2.33 - guint abitrate,
2.34 - guint width, guint height,
2.35 - guint port,
2.36 - const gchar* opt);
2.37 -gboolean gmyth_stream_client_play_stream (GMythStreamClient *self,
2.38 - guint stream_id);
2.39 -void gmyth_stream_client_pause_stream(GMythStreamClient *self,
2.40 - guint stream_id);
2.41 -void gmyth_stream_client_close_stream (GMythStreamClient *self,
2.42 - guint stream_id);
2.43 -
2.44 +GType gmyth_stream_client_get_type(void);
2.45 +
2.46 +GMythStreamClient* gmyth_stream_client_new(void);
2.47 +
2.48 +gboolean gmyth_stream_client_connect (GMythStreamClient *self,
2.49 + const gchar *server, guint port);
2.50 +
2.51 +void gmyth_stream_client_disconnect (GMythStreamClient *self);
2.52 +gint gmyth_stream_client_open_stream (GMythStreamClient *self,
2.53 + const gchar* file_name,
2.54 + const gchar* mux,
2.55 + const gchar* vcodec,
2.56 + guint vbitrate,
2.57 + gdouble fps,
2.58 + const gchar* acodec,
2.59 + guint abitrate,
2.60 + guint width, guint height,
2.61 + const gchar* opt);
2.62 +
2.63 +gint gmyth_stream_client_play_stream (GMythStreamClient *self);
2.64 +
2.65 +void gmyth_stream_client_close_stream (GMythStreamClient *self);
2.66 +
2.67
2.68 G_END_DECLS
2.69
3.1 --- a/gmyth-stream/client/test/main.c Thu Apr 12 15:12:12 2007 +0100
3.2 +++ b/gmyth-stream/client/test/main.c Thu Apr 12 20:35:08 2007 +0100
3.3 @@ -3,37 +3,44 @@
3.4
3.5 int main (int argc, char** argv)
3.6 {
3.7 - GMainLoop *mainloop = NULL;
3.8 - GMythStreamClient *cli = NULL;
3.9 - gint id = -1;
3.10 + GMythStreamClient *cli = NULL;
3.11 + gint ret = -1;
3.12
3.13 - g_type_init ();
3.14 + g_type_init ();
3.15
3.16 - mainloop = g_main_loop_new (NULL, FALSE);
3.17 + cli = gmyth_stream_client_new ();
3.18 + if (!gmyth_stream_client_connect (cli, "127.0.0.1", 50000)) {
3.19 + g_warning ("Fail to connect");
3.20 + return -1;
3.21 + }
3.22
3.23 - cli = gmyth_stream_client_new ();
3.24 - if (!gmyth_stream_client_connect (cli, "localhost", 12345)) {
3.25 - g_warning ("Fail to connect");
3.26 - return -1;
3.27 - }
3.28 + ret = gmyth_stream_client_open_stream (cli, "file:///tmp/dvb.mpg",
3.29 + "mpeg", "mpeg1video", 400, 25,
3.30 + "mp2", 192, 320, 240, "format=mpeg1");
3.31
3.32 - id = gmyth_stream_client_open_stream (cli, "/home/rfilho/Media/The.Pursuit.Of.Happyness[2006]DvDrip[Eng]-aXXo/The.Pursuit.Of.Happyness[2006]DvDrip[Eng]-aXXo.avi",
3.33 - "X", "X", 0, 0, "X", 0, 800, 600, 5000, "X");
3.34 - if (id < 0) {
3.35 - g_printerr ("Fail to open stream");
3.36 - return -1;
3.37 - }
3.38 + //myth:///tmp/mpg/bad_day.mpg mpeg mpeg1video 400 25 mp2 192 320 240 format=mpeg1
3.39
3.40 - g_debug ("Strem created [%d]", id);
3.41 + if (ret < 0) {
3.42 + g_printerr ("Fail to open stream");
3.43 + return -1;
3.44 + }
3.45
3.46 - if (!gmyth_stream_client_play_stream (cli, id)) {
3.47 - g_printerr ("Fail to play stream");
3.48 - return -1;
3.49 - }
3.50 + g_debug ("Stream created");
3.51 + g_debug ("Going to PLAY now...");
3.52
3.53 - g_debug ("started");
3.54 - g_main_loop_run (mainloop);
3.55 - g_debug ("finished");
3.56 -
3.57 - return 0;
3.58 + gint fd = gmyth_stream_client_play_stream (cli);
3.59 +
3.60 + if (fd == -1) {
3.61 + g_printerr ("Fail to play stream");
3.62 + return -1;
3.63 + }
3.64 +
3.65 + g_debug ("started");
3.66 +
3.67 + gmyth_stream_client_close_stream(cli);
3.68 + gmyth_stream_client_disconnect(cli);
3.69 +
3.70 + g_debug ("finished");
3.71 +
3.72 + return 0;
3.73 }
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/gmyth-stream/libgnomevfs2/AUTHORS Thu Apr 12 20:35:08 2007 +0100
4.3 @@ -0,0 +1,2 @@
4.4 +Artur Duque de Souza <artur.souza@indt.org.br>
4.5 +Renato Filho <>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/gmyth-stream/libgnomevfs2/COPYING Thu Apr 12 20:35:08 2007 +0100
5.3 @@ -0,0 +1,504 @@
5.4 + GNU LESSER GENERAL PUBLIC LICENSE
5.5 + Version 2.1, February 1999
5.6 +
5.7 + Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5.8 + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
5.9 + Everyone is permitted to copy and distribute verbatim copies
5.10 + of this license document, but changing it is not allowed.
5.11 +
5.12 +[This is the first released version of the Lesser GPL. It also counts
5.13 + as the successor of the GNU Library Public License, version 2, hence
5.14 + the version number 2.1.]
5.15 +
5.16 + Preamble
5.17 +
5.18 + The licenses for most software are designed to take away your
5.19 +freedom to share and change it. By contrast, the GNU General Public
5.20 +Licenses are intended to guarantee your freedom to share and change
5.21 +free software--to make sure the software is free for all its users.
5.22 +
5.23 + This license, the Lesser General Public License, applies to some
5.24 +specially designated software packages--typically libraries--of the
5.25 +Free Software Foundation and other authors who decide to use it. You
5.26 +can use it too, but we suggest you first think carefully about whether
5.27 +this license or the ordinary General Public License is the better
5.28 +strategy to use in any particular case, based on the explanations below.
5.29 +
5.30 + When we speak of free software, we are referring to freedom of use,
5.31 +not price. Our General Public Licenses are designed to make sure that
5.32 +you have the freedom to distribute copies of free software (and charge
5.33 +for this service if you wish); that you receive source code or can get
5.34 +it if you want it; that you can change the software and use pieces of
5.35 +it in new free programs; and that you are informed that you can do
5.36 +these things.
5.37 +
5.38 + To protect your rights, we need to make restrictions that forbid
5.39 +distributors to deny you these rights or to ask you to surrender these
5.40 +rights. These restrictions translate to certain responsibilities for
5.41 +you if you distribute copies of the library or if you modify it.
5.42 +
5.43 + For example, if you distribute copies of the library, whether gratis
5.44 +or for a fee, you must give the recipients all the rights that we gave
5.45 +you. You must make sure that they, too, receive or can get the source
5.46 +code. If you link other code with the library, you must provide
5.47 +complete object files to the recipients, so that they can relink them
5.48 +with the library after making changes to the library and recompiling
5.49 +it. And you must show them these terms so they know their rights.
5.50 +
5.51 + We protect your rights with a two-step method: (1) we copyright the
5.52 +library, and (2) we offer you this license, which gives you legal
5.53 +permission to copy, distribute and/or modify the library.
5.54 +
5.55 + To protect each distributor, we want to make it very clear that
5.56 +there is no warranty for the free library. Also, if the library is
5.57 +modified by someone else and passed on, the recipients should know
5.58 +that what they have is not the original version, so that the original
5.59 +author's reputation will not be affected by problems that might be
5.60 +introduced by others.
5.61 +
5.62 + Finally, software patents pose a constant threat to the existence of
5.63 +any free program. We wish to make sure that a company cannot
5.64 +effectively restrict the users of a free program by obtaining a
5.65 +restrictive license from a patent holder. Therefore, we insist that
5.66 +any patent license obtained for a version of the library must be
5.67 +consistent with the full freedom of use specified in this license.
5.68 +
5.69 + Most GNU software, including some libraries, is covered by the
5.70 +ordinary GNU General Public License. This license, the GNU Lesser
5.71 +General Public License, applies to certain designated libraries, and
5.72 +is quite different from the ordinary General Public License. We use
5.73 +this license for certain libraries in order to permit linking those
5.74 +libraries into non-free programs.
5.75 +
5.76 + When a program is linked with a library, whether statically or using
5.77 +a shared library, the combination of the two is legally speaking a
5.78 +combined work, a derivative of the original library. The ordinary
5.79 +General Public License therefore permits such linking only if the
5.80 +entire combination fits its criteria of freedom. The Lesser General
5.81 +Public License permits more lax criteria for linking other code with
5.82 +the library.
5.83 +
5.84 + We call this license the "Lesser" General Public License because it
5.85 +does Less to protect the user's freedom than the ordinary General
5.86 +Public License. It also provides other free software developers Less
5.87 +of an advantage over competing non-free programs. These disadvantages
5.88 +are the reason we use the ordinary General Public License for many
5.89 +libraries. However, the Lesser license provides advantages in certain
5.90 +special circumstances.
5.91 +
5.92 + For example, on rare occasions, there may be a special need to
5.93 +encourage the widest possible use of a certain library, so that it becomes
5.94 +a de-facto standard. To achieve this, non-free programs must be
5.95 +allowed to use the library. A more frequent case is that a free
5.96 +library does the same job as widely used non-free libraries. In this
5.97 +case, there is little to gain by limiting the free library to free
5.98 +software only, so we use the Lesser General Public License.
5.99 +
5.100 + In other cases, permission to use a particular library in non-free
5.101 +programs enables a greater number of people to use a large body of
5.102 +free software. For example, permission to use the GNU C Library in
5.103 +non-free programs enables many more people to use the whole GNU
5.104 +operating system, as well as its variant, the GNU/Linux operating
5.105 +system.
5.106 +
5.107 + Although the Lesser General Public License is Less protective of the
5.108 +users' freedom, it does ensure that the user of a program that is
5.109 +linked with the Library has the freedom and the wherewithal to run
5.110 +that program using a modified version of the Library.
5.111 +
5.112 + The precise terms and conditions for copying, distribution and
5.113 +modification follow. Pay close attention to the difference between a
5.114 +"work based on the library" and a "work that uses the library". The
5.115 +former contains code derived from the library, whereas the latter must
5.116 +be combined with the library in order to run.
5.117 +
5.118 + GNU LESSER GENERAL PUBLIC LICENSE
5.119 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
5.120 +
5.121 + 0. This License Agreement applies to any software library or other
5.122 +program which contains a notice placed by the copyright holder or
5.123 +other authorized party saying it may be distributed under the terms of
5.124 +this Lesser General Public License (also called "this License").
5.125 +Each licensee is addressed as "you".
5.126 +
5.127 + A "library" means a collection of software functions and/or data
5.128 +prepared so as to be conveniently linked with application programs
5.129 +(which use some of those functions and data) to form executables.
5.130 +
5.131 + The "Library", below, refers to any such software library or work
5.132 +which has been distributed under these terms. A "work based on the
5.133 +Library" means either the Library or any derivative work under
5.134 +copyright law: that is to say, a work containing the Library or a
5.135 +portion of it, either verbatim or with modifications and/or translated
5.136 +straightforwardly into another language. (Hereinafter, translation is
5.137 +included without limitation in the term "modification".)
5.138 +
5.139 + "Source code" for a work means the preferred form of the work for
5.140 +making modifications to it. For a library, complete source code means
5.141 +all the source code for all modules it contains, plus any associated
5.142 +interface definition files, plus the scripts used to control compilation
5.143 +and installation of the library.
5.144 +
5.145 + Activities other than copying, distribution and modification are not
5.146 +covered by this License; they are outside its scope. The act of
5.147 +running a program using the Library is not restricted, and output from
5.148 +such a program is covered only if its contents constitute a work based
5.149 +on the Library (independent of the use of the Library in a tool for
5.150 +writing it). Whether that is true depends on what the Library does
5.151 +and what the program that uses the Library does.
5.152 +
5.153 + 1. You may copy and distribute verbatim copies of the Library's
5.154 +complete source code as you receive it, in any medium, provided that
5.155 +you conspicuously and appropriately publish on each copy an
5.156 +appropriate copyright notice and disclaimer of warranty; keep intact
5.157 +all the notices that refer to this License and to the absence of any
5.158 +warranty; and distribute a copy of this License along with the
5.159 +Library.
5.160 +
5.161 + You may charge a fee for the physical act of transferring a copy,
5.162 +and you may at your option offer warranty protection in exchange for a
5.163 +fee.
5.164 +
5.165 + 2. You may modify your copy or copies of the Library or any portion
5.166 +of it, thus forming a work based on the Library, and copy and
5.167 +distribute such modifications or work under the terms of Section 1
5.168 +above, provided that you also meet all of these conditions:
5.169 +
5.170 + a) The modified work must itself be a software library.
5.171 +
5.172 + b) You must cause the files modified to carry prominent notices
5.173 + stating that you changed the files and the date of any change.
5.174 +
5.175 + c) You must cause the whole of the work to be licensed at no
5.176 + charge to all third parties under the terms of this License.
5.177 +
5.178 + d) If a facility in the modified Library refers to a function or a
5.179 + table of data to be supplied by an application program that uses
5.180 + the facility, other than as an argument passed when the facility
5.181 + is invoked, then you must make a good faith effort to ensure that,
5.182 + in the event an application does not supply such function or
5.183 + table, the facility still operates, and performs whatever part of
5.184 + its purpose remains meaningful.
5.185 +
5.186 + (For example, a function in a library to compute square roots has
5.187 + a purpose that is entirely well-defined independent of the
5.188 + application. Therefore, Subsection 2d requires that any
5.189 + application-supplied function or table used by this function must
5.190 + be optional: if the application does not supply it, the square
5.191 + root function must still compute square roots.)
5.192 +
5.193 +These requirements apply to the modified work as a whole. If
5.194 +identifiable sections of that work are not derived from the Library,
5.195 +and can be reasonably considered independent and separate works in
5.196 +themselves, then this License, and its terms, do not apply to those
5.197 +sections when you distribute them as separate works. But when you
5.198 +distribute the same sections as part of a whole which is a work based
5.199 +on the Library, the distribution of the whole must be on the terms of
5.200 +this License, whose permissions for other licensees extend to the
5.201 +entire whole, and thus to each and every part regardless of who wrote
5.202 +it.
5.203 +
5.204 +Thus, it is not the intent of this section to claim rights or contest
5.205 +your rights to work written entirely by you; rather, the intent is to
5.206 +exercise the right to control the distribution of derivative or
5.207 +collective works based on the Library.
5.208 +
5.209 +In addition, mere aggregation of another work not based on the Library
5.210 +with the Library (or with a work based on the Library) on a volume of
5.211 +a storage or distribution medium does not bring the other work under
5.212 +the scope of this License.
5.213 +
5.214 + 3. You may opt to apply the terms of the ordinary GNU General Public
5.215 +License instead of this License to a given copy of the Library. To do
5.216 +this, you must alter all the notices that refer to this License, so
5.217 +that they refer to the ordinary GNU General Public License, version 2,
5.218 +instead of to this License. (If a newer version than version 2 of the
5.219 +ordinary GNU General Public License has appeared, then you can specify
5.220 +that version instead if you wish.) Do not make any other change in
5.221 +these notices.
5.222 +
5.223 + Once this change is made in a given copy, it is irreversible for
5.224 +that copy, so the ordinary GNU General Public License applies to all
5.225 +subsequent copies and derivative works made from that copy.
5.226 +
5.227 + This option is useful when you wish to copy part of the code of
5.228 +the Library into a program that is not a library.
5.229 +
5.230 + 4. You may copy and distribute the Library (or a portion or
5.231 +derivative of it, under Section 2) in object code or executable form
5.232 +under the terms of Sections 1 and 2 above provided that you accompany
5.233 +it with the complete corresponding machine-readable source code, which
5.234 +must be distributed under the terms of Sections 1 and 2 above on a
5.235 +medium customarily used for software interchange.
5.236 +
5.237 + If distribution of object code is made by offering access to copy
5.238 +from a designated place, then offering equivalent access to copy the
5.239 +source code from the same place satisfies the requirement to
5.240 +distribute the source code, even though third parties are not
5.241 +compelled to copy the source along with the object code.
5.242 +
5.243 + 5. A program that contains no derivative of any portion of the
5.244 +Library, but is designed to work with the Library by being compiled or
5.245 +linked with it, is called a "work that uses the Library". Such a
5.246 +work, in isolation, is not a derivative work of the Library, and
5.247 +therefore falls outside the scope of this License.
5.248 +
5.249 + However, linking a "work that uses the Library" with the Library
5.250 +creates an executable that is a derivative of the Library (because it
5.251 +contains portions of the Library), rather than a "work that uses the
5.252 +library". The executable is therefore covered by this License.
5.253 +Section 6 states terms for distribution of such executables.
5.254 +
5.255 + When a "work that uses the Library" uses material from a header file
5.256 +that is part of the Library, the object code for the work may be a
5.257 +derivative work of the Library even though the source code is not.
5.258 +Whether this is true is especially significant if the work can be
5.259 +linked without the Library, or if the work is itself a library. The
5.260 +threshold for this to be true is not precisely defined by law.
5.261 +
5.262 + If such an object file uses only numerical parameters, data
5.263 +structure layouts and accessors, and small macros and small inline
5.264 +functions (ten lines or less in length), then the use of the object
5.265 +file is unrestricted, regardless of whether it is legally a derivative
5.266 +work. (Executables containing this object code plus portions of the
5.267 +Library will still fall under Section 6.)
5.268 +
5.269 + Otherwise, if the work is a derivative of the Library, you may
5.270 +distribute the object code for the work under the terms of Section 6.
5.271 +Any executables containing that work also fall under Section 6,
5.272 +whether or not they are linked directly with the Library itself.
5.273 +
5.274 + 6. As an exception to the Sections above, you may also combine or
5.275 +link a "work that uses the Library" with the Library to produce a
5.276 +work containing portions of the Library, and distribute that work
5.277 +under terms of your choice, provided that the terms permit
5.278 +modification of the work for the customer's own use and reverse
5.279 +engineering for debugging such modifications.
5.280 +
5.281 + You must give prominent notice with each copy of the work that the
5.282 +Library is used in it and that the Library and its use are covered by
5.283 +this License. You must supply a copy of this License. If the work
5.284 +during execution displays copyright notices, you must include the
5.285 +copyright notice for the Library among them, as well as a reference
5.286 +directing the user to the copy of this License. Also, you must do one
5.287 +of these things:
5.288 +
5.289 + a) Accompany the work with the complete corresponding
5.290 + machine-readable source code for the Library including whatever
5.291 + changes were used in the work (which must be distributed under
5.292 + Sections 1 and 2 above); and, if the work is an executable linked
5.293 + with the Library, with the complete machine-readable "work that
5.294 + uses the Library", as object code and/or source code, so that the
5.295 + user can modify the Library and then relink to produce a modified
5.296 + executable containing the modified Library. (It is understood
5.297 + that the user who changes the contents of definitions files in the
5.298 + Library will not necessarily be able to recompile the application
5.299 + to use the modified definitions.)
5.300 +
5.301 + b) Use a suitable shared library mechanism for linking with the
5.302 + Library. A suitable mechanism is one that (1) uses at run time a
5.303 + copy of the library already present on the user's computer system,
5.304 + rather than copying library functions into the executable, and (2)
5.305 + will operate properly with a modified version of the library, if
5.306 + the user installs one, as long as the modified version is
5.307 + interface-compatible with the version that the work was made with.
5.308 +
5.309 + c) Accompany the work with a written offer, valid for at
5.310 + least three years, to give the same user the materials
5.311 + specified in Subsection 6a, above, for a charge no more
5.312 + than the cost of performing this distribution.
5.313 +
5.314 + d) If distribution of the work is made by offering access to copy
5.315 + from a designated place, offer equivalent access to copy the above
5.316 + specified materials from the same place.
5.317 +
5.318 + e) Verify that the user has already received a copy of these
5.319 + materials or that you have already sent this user a copy.
5.320 +
5.321 + For an executable, the required form of the "work that uses the
5.322 +Library" must include any data and utility programs needed for
5.323 +reproducing the executable from it. However, as a special exception,
5.324 +the materials to be distributed need not include anything that is
5.325 +normally distributed (in either source or binary form) with the major
5.326 +components (compiler, kernel, and so on) of the operating system on
5.327 +which the executable runs, unless that component itself accompanies
5.328 +the executable.
5.329 +
5.330 + It may happen that this requirement contradicts the license
5.331 +restrictions of other proprietary libraries that do not normally
5.332 +accompany the operating system. Such a contradiction means you cannot
5.333 +use both them and the Library together in an executable that you
5.334 +distribute.
5.335 +
5.336 + 7. You may place library facilities that are a work based on the
5.337 +Library side-by-side in a single library together with other library
5.338 +facilities not covered by this License, and distribute such a combined
5.339 +library, provided that the separate distribution of the work based on
5.340 +the Library and of the other library facilities is otherwise
5.341 +permitted, and provided that you do these two things:
5.342 +
5.343 + a) Accompany the combined library with a copy of the same work
5.344 + based on the Library, uncombined with any other library
5.345 + facilities. This must be distributed under the terms of the
5.346 + Sections above.
5.347 +
5.348 + b) Give prominent notice with the combined library of the fact
5.349 + that part of it is a work based on the Library, and explaining
5.350 + where to find the accompanying uncombined form of the same work.
5.351 +
5.352 + 8. You may not copy, modify, sublicense, link with, or distribute
5.353 +the Library except as expressly provided under this License. Any
5.354 +attempt otherwise to copy, modify, sublicense, link with, or
5.355 +distribute the Library is void, and will automatically terminate your
5.356 +rights under this License. However, parties who have received copies,
5.357 +or rights, from you under this License will not have their licenses
5.358 +terminated so long as such parties remain in full compliance.
5.359 +
5.360 + 9. You are not required to accept this License, since you have not
5.361 +signed it. However, nothing else grants you permission to modify or
5.362 +distribute the Library or its derivative works. These actions are
5.363 +prohibited by law if you do not accept this License. Therefore, by
5.364 +modifying or distributing the Library (or any work based on the
5.365 +Library), you indicate your acceptance of this License to do so, and
5.366 +all its terms and conditions for copying, distributing or modifying
5.367 +the Library or works based on it.
5.368 +
5.369 + 10. Each time you redistribute the Library (or any work based on the
5.370 +Library), the recipient automatically receives a license from the
5.371 +original licensor to copy, distribute, link with or modify the Library
5.372 +subject to these terms and conditions. You may not impose any further
5.373 +restrictions on the recipients' exercise of the rights granted herein.
5.374 +You are not responsible for enforcing compliance by third parties with
5.375 +this License.
5.376 +
5.377 + 11. If, as a consequence of a court judgment or allegation of patent
5.378 +infringement or for any other reason (not limited to patent issues),
5.379 +conditions are imposed on you (whether by court order, agreement or
5.380 +otherwise) that contradict the conditions of this License, they do not
5.381 +excuse you from the conditions of this License. If you cannot
5.382 +distribute so as to satisfy simultaneously your obligations under this
5.383 +License and any other pertinent obligations, then as a consequence you
5.384 +may not distribute the Library at all. For example, if a patent
5.385 +license would not permit royalty-free redistribution of the Library by
5.386 +all those who receive copies directly or indirectly through you, then
5.387 +the only way you could satisfy both it and this License would be to
5.388 +refrain entirely from distribution of the Library.
5.389 +
5.390 +If any portion of this section is held invalid or unenforceable under any
5.391 +particular circumstance, the balance of the section is intended to apply,
5.392 +and the section as a whole is intended to apply in other circumstances.
5.393 +
5.394 +It is not the purpose of this section to induce you to infringe any
5.395 +patents or other property right claims or to contest validity of any
5.396 +such claims; this section has the sole purpose of protecting the
5.397 +integrity of the free software distribution system which is
5.398 +implemented by public license practices. Many people have made
5.399 +generous contributions to the wide range of software distributed
5.400 +through that system in reliance on consistent application of that
5.401 +system; it is up to the author/donor to decide if he or she is willing
5.402 +to distribute software through any other system and a licensee cannot
5.403 +impose that choice.
5.404 +
5.405 +This section is intended to make thoroughly clear what is believed to
5.406 +be a consequence of the rest of this License.
5.407 +
5.408 + 12. If the distribution and/or use of the Library is restricted in
5.409 +certain countries either by patents or by copyrighted interfaces, the
5.410 +original copyright holder who places the Library under this License may add
5.411 +an explicit geographical distribution limitation excluding those countries,
5.412 +so that distribution is permitted only in or among countries not thus
5.413 +excluded. In such case, this License incorporates the limitation as if
5.414 +written in the body of this License.
5.415 +
5.416 + 13. The Free Software Foundation may publish revised and/or new
5.417 +versions of the Lesser General Public License from time to time.
5.418 +Such new versions will be similar in spirit to the present version,
5.419 +but may differ in detail to address new problems or concerns.
5.420 +
5.421 +Each version is given a distinguishing version number. If the Library
5.422 +specifies a version number of this License which applies to it and
5.423 +"any later version", you have the option of following the terms and
5.424 +conditions either of that version or of any later version published by
5.425 +the Free Software Foundation. If the Library does not specify a
5.426 +license version number, you may choose any version ever published by
5.427 +the Free Software Foundation.
5.428 +
5.429 + 14. If you wish to incorporate parts of the Library into other free
5.430 +programs whose distribution conditions are incompatible with these,
5.431 +write to the author to ask for permission. For software which is
5.432 +copyrighted by the Free Software Foundation, write to the Free
5.433 +Software Foundation; we sometimes make exceptions for this. Our
5.434 +decision will be guided by the two goals of preserving the free status
5.435 +of all derivatives of our free software and of promoting the sharing
5.436 +and reuse of software generally.
5.437 +
5.438 + NO WARRANTY
5.439 +
5.440 + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
5.441 +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
5.442 +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
5.443 +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
5.444 +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
5.445 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
5.446 +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
5.447 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
5.448 +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
5.449 +
5.450 + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
5.451 +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
5.452 +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
5.453 +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
5.454 +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
5.455 +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
5.456 +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
5.457 +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
5.458 +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
5.459 +DAMAGES.
5.460 +
5.461 + END OF TERMS AND CONDITIONS
5.462 +
5.463 + How to Apply These Terms to Your New Libraries
5.464 +
5.465 + If you develop a new library, and you want it to be of the greatest
5.466 +possible use to the public, we recommend making it free software that
5.467 +everyone can redistribute and change. You can do so by permitting
5.468 +redistribution under these terms (or, alternatively, under the terms of the
5.469 +ordinary General Public License).
5.470 +
5.471 + To apply these terms, attach the following notices to the library. It is
5.472 +safest to attach them to the start of each source file to most effectively
5.473 +convey the exclusion of warranty; and each file should have at least the
5.474 +"copyright" line and a pointer to where the full notice is found.
5.475 +
5.476 + <one line to give the library's name and a brief idea of what it does.>
5.477 + Copyright (C) <year> <name of author>
5.478 +
5.479 + This library is free software; you can redistribute it and/or
5.480 + modify it under the terms of the GNU Lesser General Public
5.481 + License as published by the Free Software Foundation; either
5.482 + version 2.1 of the License, or (at your option) any later version.
5.483 +
5.484 + This library is distributed in the hope that it will be useful,
5.485 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5.486 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5.487 + Lesser General Public License for more details.
5.488 +
5.489 + You should have received a copy of the GNU Lesser General Public
5.490 + License along with this library; if not, write to the Free Software
5.491 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
5.492 +
5.493 +Also add information on how to contact you by electronic and paper mail.
5.494 +
5.495 +You should also get your employer (if you work as a programmer) or your
5.496 +school, if any, to sign a "copyright disclaimer" for the library, if
5.497 +necessary. Here is a sample; alter the names:
5.498 +
5.499 + Yoyodyne, Inc., hereby disclaims all copyright interest in the
5.500 + library `Frob' (a library for tweaking knobs) written by James Random Hacker.
5.501 +
5.502 + <signature of Ty Coon>, 1 April 1990
5.503 + Ty Coon, President of Vice
5.504 +
5.505 +That's all there is to it!
5.506 +
5.507 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/gmyth-stream/libgnomevfs2/INSTALL Thu Apr 12 20:35:08 2007 +0100
6.3 @@ -0,0 +1,236 @@
6.4 +Installation Instructions
6.5 +*************************
6.6 +
6.7 +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
6.8 +Software Foundation, Inc.
6.9 +
6.10 +This file is free documentation; the Free Software Foundation gives
6.11 +unlimited permission to copy, distribute and modify it.
6.12 +
6.13 +Basic Installation
6.14 +==================
6.15 +
6.16 +These are generic installation instructions.
6.17 +
6.18 + The `configure' shell script attempts to guess correct values for
6.19 +various system-dependent variables used during compilation. It uses
6.20 +those values to create a `Makefile' in each directory of the package.
6.21 +It may also create one or more `.h' files containing system-dependent
6.22 +definitions. Finally, it creates a shell script `config.status' that
6.23 +you can run in the future to recreate the current configuration, and a
6.24 +file `config.log' containing compiler output (useful mainly for
6.25 +debugging `configure').
6.26 +
6.27 + It can also use an optional file (typically called `config.cache'
6.28 +and enabled with `--cache-file=config.cache' or simply `-C') that saves
6.29 +the results of its tests to speed up reconfiguring. (Caching is
6.30 +disabled by default to prevent problems with accidental use of stale
6.31 +cache files.)
6.32 +
6.33 + If you need to do unusual things to compile the package, please try
6.34 +to figure out how `configure' could check whether to do them, and mail
6.35 +diffs or instructions to the address given in the `README' so they can
6.36 +be considered for the next release. If you are using the cache, and at
6.37 +some point `config.cache' contains results you don't want to keep, you
6.38 +may remove or edit it.
6.39 +
6.40 + The file `configure.ac' (or `configure.in') is used to create
6.41 +`configure' by a program called `autoconf'. You only need
6.42 +`configure.ac' if you want to change it or regenerate `configure' using
6.43 +a newer version of `autoconf'.
6.44 +
6.45 +The simplest way to compile this package is:
6.46 +
6.47 + 1. `cd' to the directory containing the package's source code and type
6.48 + `./configure' to configure the package for your system. If you're
6.49 + using `csh' on an old version of System V, you might need to type
6.50 + `sh ./configure' instead to prevent `csh' from trying to execute
6.51 + `configure' itself.
6.52 +
6.53 + Running `configure' takes awhile. While running, it prints some
6.54 + messages telling which features it is checking for.
6.55 +
6.56 + 2. Type `make' to compile the package.
6.57 +
6.58 + 3. Optionally, type `make check' to run any self-tests that come with
6.59 + the package.
6.60 +
6.61 + 4. Type `make install' to install the programs and any data files and
6.62 + documentation.
6.63 +
6.64 + 5. You can remove the program binaries and object files from the
6.65 + source code directory by typing `make clean'. To also remove the
6.66 + files that `configure' created (so you can compile the package for
6.67 + a different kind of computer), type `make distclean'. There is
6.68 + also a `make maintainer-clean' target, but that is intended mainly
6.69 + for the package's developers. If you use it, you may have to get
6.70 + all sorts of other programs in order to regenerate files that came
6.71 + with the distribution.
6.72 +
6.73 +Compilers and Options
6.74 +=====================
6.75 +
6.76 +Some systems require unusual options for compilation or linking that the
6.77 +`configure' script does not know about. Run `./configure --help' for
6.78 +details on some of the pertinent environment variables.
6.79 +
6.80 + You can give `configure' initial values for configuration parameters
6.81 +by setting variables in the command line or in the environment. Here
6.82 +is an example:
6.83 +
6.84 + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
6.85 +
6.86 + *Note Defining Variables::, for more details.
6.87 +
6.88 +Compiling For Multiple Architectures
6.89 +====================================
6.90 +
6.91 +You can compile the package for more than one kind of computer at the
6.92 +same time, by placing the object files for each architecture in their
6.93 +own directory. To do this, you must use a version of `make' that
6.94 +supports the `VPATH' variable, such as GNU `make'. `cd' to the
6.95 +directory where you want the object files and executables to go and run
6.96 +the `configure' script. `configure' automatically checks for the
6.97 +source code in the directory that `configure' is in and in `..'.
6.98 +
6.99 + If you have to use a `make' that does not support the `VPATH'
6.100 +variable, you have to compile the package for one architecture at a
6.101 +time in the source code directory. After you have installed the
6.102 +package for one architecture, use `make distclean' before reconfiguring
6.103 +for another architecture.
6.104 +
6.105 +Installation Names
6.106 +==================
6.107 +
6.108 +By default, `make install' installs the package's commands under
6.109 +`/usr/local/bin', include files under `/usr/local/include', etc. You
6.110 +can specify an installation prefix other than `/usr/local' by giving
6.111 +`configure' the option `--prefix=PREFIX'.
6.112 +
6.113 + You can specify separate installation prefixes for
6.114 +architecture-specific files and architecture-independent files. If you
6.115 +pass the option `--exec-prefix=PREFIX' to `configure', the package uses
6.116 +PREFIX as the prefix for installing programs and libraries.
6.117 +Documentation and other data files still use the regular prefix.
6.118 +
6.119 + In addition, if you use an unusual directory layout you can give
6.120 +options like `--bindir=DIR' to specify different values for particular
6.121 +kinds of files. Run `configure --help' for a list of the directories
6.122 +you can set and what kinds of files go in them.
6.123 +
6.124 + If the package supports it, you can cause programs to be installed
6.125 +with an extra prefix or suffix on their names by giving `configure' the
6.126 +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
6.127 +
6.128 +Optional Features
6.129 +=================
6.130 +
6.131 +Some packages pay attention to `--enable-FEATURE' options to
6.132 +`configure', where FEATURE indicates an optional part of the package.
6.133 +They may also pay attention to `--with-PACKAGE' options, where PACKAGE
6.134 +is something like `gnu-as' or `x' (for the X Window System). The
6.135 +`README' should mention any `--enable-' and `--with-' options that the
6.136 +package recognizes.
6.137 +
6.138 + For packages that use the X Window System, `configure' can usually
6.139 +find the X include and library files automatically, but if it doesn't,
6.140 +you can use the `configure' options `--x-includes=DIR' and
6.141 +`--x-libraries=DIR' to specify their locations.
6.142 +
6.143 +Specifying the System Type
6.144 +==========================
6.145 +
6.146 +There may be some features `configure' cannot figure out automatically,
6.147 +but needs to determine by the type of machine the package will run on.
6.148 +Usually, assuming the package is built to be run on the _same_
6.149 +architectures, `configure' can figure that out, but if it prints a
6.150 +message saying it cannot guess the machine type, give it the
6.151 +`--build=TYPE' option. TYPE can either be a short name for the system
6.152 +type, such as `sun4', or a canonical name which has the form:
6.153 +
6.154 + CPU-COMPANY-SYSTEM
6.155 +
6.156 +where SYSTEM can have one of these forms:
6.157 +
6.158 + OS KERNEL-OS
6.159 +
6.160 + See the file `config.sub' for the possible values of each field. If
6.161 +`config.sub' isn't included in this package, then this package doesn't
6.162 +need to know the machine type.
6.163 +
6.164 + If you are _building_ compiler tools for cross-compiling, you should
6.165 +use the option `--target=TYPE' to select the type of system they will
6.166 +produce code for.
6.167 +
6.168 + If you want to _use_ a cross compiler, that generates code for a
6.169 +platform different from the build platform, you should specify the
6.170 +"host" platform (i.e., that on which the generated programs will
6.171 +eventually be run) with `--host=TYPE'.
6.172 +
6.173 +Sharing Defaults
6.174 +================
6.175 +
6.176 +If you want to set default values for `configure' scripts to share, you
6.177 +can create a site shell script called `config.site' that gives default
6.178 +values for variables like `CC', `cache_file', and `prefix'.
6.179 +`configure' looks for `PREFIX/share/config.site' if it exists, then
6.180 +`PREFIX/etc/config.site' if it exists. Or, you can set the
6.181 +`CONFIG_SITE' environment variable to the location of the site script.
6.182 +A warning: not all `configure' scripts look for a site script.
6.183 +
6.184 +Defining Variables
6.185 +==================
6.186 +
6.187 +Variables not defined in a site shell script can be set in the
6.188 +environment passed to `configure'. However, some packages may run
6.189 +configure again during the build, and the customized values of these
6.190 +variables may be lost. In order to avoid this problem, you should set
6.191 +them in the `configure' command line, using `VAR=value'. For example:
6.192 +
6.193 + ./configure CC=/usr/local2/bin/gcc
6.194 +
6.195 +causes the specified `gcc' to be used as the C compiler (unless it is
6.196 +overridden in the site shell script). Here is a another example:
6.197 +
6.198 + /bin/bash ./configure CONFIG_SHELL=/bin/bash
6.199 +
6.200 +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
6.201 +configuration-related scripts to be executed by `/bin/bash'.
6.202 +
6.203 +`configure' Invocation
6.204 +======================
6.205 +
6.206 +`configure' recognizes the following options to control how it operates.
6.207 +
6.208 +`--help'
6.209 +`-h'
6.210 + Print a summary of the options to `configure', and exit.
6.211 +
6.212 +`--version'
6.213 +`-V'
6.214 + Print the version of Autoconf used to generate the `configure'
6.215 + script, and exit.
6.216 +
6.217 +`--cache-file=FILE'
6.218 + Enable the cache: use and save the results of the tests in FILE,
6.219 + traditionally `config.cache'. FILE defaults to `/dev/null' to
6.220 + disable caching.
6.221 +
6.222 +`--config-cache'
6.223 +`-C'
6.224 + Alias for `--cache-file=config.cache'.
6.225 +
6.226 +`--quiet'
6.227 +`--silent'
6.228 +`-q'
6.229 + Do not print messages saying which checks are being made. To
6.230 + suppress all normal output, redirect it to `/dev/null' (any error
6.231 + messages will still be shown).
6.232 +
6.233 +`--srcdir=DIR'
6.234 + Look for the package's source code in directory DIR. Usually
6.235 + `configure' can determine that directory automatically.
6.236 +
6.237 +`configure' also accepts some other, not widely useful, options. Run
6.238 +`configure --help' for more details.
6.239 +
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/gmyth-stream/libgnomevfs2/Makefile.am Thu Apr 12 20:35:08 2007 +0100
7.3 @@ -0,0 +1,5 @@
7.4 +SUBDIRS = modules
7.5 +DIST_SUBDIRS = common m4 modules
7.6 +
7.7 +EXTRA_DIST = \
7.8 + autogen.sh
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/gmyth-stream/libgnomevfs2/README Thu Apr 12 20:35:08 2007 +0100
8.3 @@ -0,0 +1,12 @@
8.4 +URI: myth://host:port/filename
8.5 +
8.6 +or, when downloading LiveTV content...
8.7 +
8.8 +URI: myth://user:password@host:port/?dbname&channel=channel_num
8.9 +
8.10 +sample (remote .NUV file): gnomevfs-cat myth://127.0.0.1:7654/video.nuv
8.11 +
8.12 +sample (LiveTV): gnomevfs-cat 'myth://mythtv:mythtv@192.168.3.165:6543/livetv?channel=4'
8.13 +
8.14 +gst-launch-0.10 gnomevfssrc location='myth://192.168.3.165:6543/livetv?channel=444' ! nuvdemux name=d .audio_src ! queue ! alsasink d.video_src ! ffdec_mpeg4 ! xvimagesink
8.15 +
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/gmyth-stream/libgnomevfs2/autogen.sh Thu Apr 12 20:35:08 2007 +0100
9.3 @@ -0,0 +1,99 @@
9.4 +#!/bin/sh
9.5 +# Run this to generate all the initial makefiles, etc.
9.6 +
9.7 +DIE=0
9.8 +package=libgnomevfs2-mythtv
9.9 +srcfile=configure.ac
9.10 +
9.11 +# a quick cvs co if necessary to alleviate the pain - may remove this
9.12 +# when developers get a clue ;)
9.13 +if test ! -d common;
9.14 +then
9.15 + echo "+ getting common/ from cvs"
9.16 + cvs co common
9.17 +fi
9.18 +
9.19 +# source helper functions
9.20 +if test ! -f common/autogen-helper.sh;
9.21 +then
9.22 + echo There is something wrong with your source tree.
9.23 + echo You are missing common/autogen-helper.sh
9.24 + exit 1
9.25 +fi
9.26 +. common/autogen-helper.sh
9.27 +
9.28 +CONFIGURE_DEF_OPT='--enable-maintainer-mode'
9.29 +
9.30 +autogen_options $*
9.31 +
9.32 +echo -n "+ check for build tools"
9.33 +if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
9.34 +version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
9.35 + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
9.36 +version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
9.37 + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
9.38 +version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
9.39 + "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
9.40 +version_check "pkg-config" "" \
9.41 + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
9.42 +
9.43 +die_check $DIE
9.44 +
9.45 +aclocal_check || DIE=1
9.46 +autoheader_check || DIE=1
9.47 +
9.48 +die_check $DIE
9.49 +
9.50 +# if no arguments specified then this will be printed
9.51 +if test -z "$*"; then
9.52 + echo "+ checking for autogen.sh options"
9.53 + echo " This autogen script will automatically run ./configure as:"
9.54 + echo " ./configure $CONFIGURE_DEF_OPT"
9.55 + echo " To pass any additional options, please specify them on the $0"
9.56 + echo " command line."
9.57 +fi
9.58 +
9.59 +toplevel_check $srcfile
9.60 +
9.61 +tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
9.62 +tool_run "$libtoolize" "--copy --force"
9.63 +tool_run "$autoheader"
9.64 +
9.65 +# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
9.66 +echo timestamp > stamp-h.in 2> /dev/null
9.67 +
9.68 +tool_run "$autoconf"
9.69 +tool_run "$automake" "-a -c"
9.70 +
9.71 +# if enable exists, add an -enable option for each of the lines in that file
9.72 +if test -f enable; then
9.73 + for a in `cat enable`; do
9.74 + CONFIGURE_FILE_OPT="--enable-$a"
9.75 + done
9.76 +fi
9.77 +
9.78 +# if disable exists, add an -disable option for each of the lines in that file
9.79 +if test -f disable; then
9.80 + for a in `cat disable`; do
9.81 + CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
9.82 + done
9.83 +fi
9.84 +
9.85 +test -n "$NOCONFIGURE" && {
9.86 + echo "+ skipping configure stage for package $package, as requested."
9.87 + echo "+ autogen.sh done."
9.88 + exit 0
9.89 +}
9.90 +
9.91 +echo "+ running configure ... "
9.92 +test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
9.93 +test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
9.94 +test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
9.95 +echo
9.96 +
9.97 +./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
9.98 + echo " configure failed"
9.99 + exit 1
9.100 +}
9.101 +
9.102 +echo "Now type 'make' to compile $package."
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/gmyth-stream/libgnomevfs2/common/Makefile.am Thu Apr 12 20:35:08 2007 +0100
10.3 @@ -0,0 +1,1 @@
10.4 +EXTRA_DIST = autogen-helper.sh
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/gmyth-stream/libgnomevfs2/common/autogen-helper.sh Thu Apr 12 20:35:08 2007 +0100
11.3 @@ -0,0 +1,302 @@
11.4 +# a silly hack that generates autoregen.sh but it's handy
11.5 +echo "#!/bin/sh" > autoregen.sh
11.6 +echo "./autogen.sh $@ \$@" >> autoregen.sh
11.7 +chmod +x autoregen.sh
11.8 +
11.9 +# helper functions for autogen.sh
11.10 +
11.11 +debug ()
11.12 +# print out a debug message if DEBUG is a defined variable
11.13 +{
11.14 + if test ! -z "$DEBUG"
11.15 + then
11.16 + echo "DEBUG: $1"
11.17 + fi
11.18 +}
11.19 +
11.20 +version_check ()
11.21 +# check the version of a package
11.22 +# first argument : package name (executable)
11.23 +# second argument : optional path where to look for it instead
11.24 +# third argument : source download url
11.25 +# rest of arguments : major, minor, micro version
11.26 +# all consecutive ones : suggestions for binaries to use
11.27 +# (if not specified in second argument)
11.28 +{
11.29 + PACKAGE=$1
11.30 + PKG_PATH=$2
11.31 + URL=$3
11.32 + MAJOR=$4
11.33 + MINOR=$5
11.34 + MICRO=$6
11.35 +
11.36 + # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null
11.37 + if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi
11.38 + debug "major $MAJOR minor $MINOR micro $MICRO"
11.39 + VERSION=$MAJOR
11.40 + if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
11.41 + if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
11.42 +
11.43 + debug "major $MAJOR minor $MINOR micro $MICRO"
11.44 +
11.45 + for SUGGESTION in $PKG_PATH; do
11.46 + COMMAND="$SUGGESTION"
11.47 +
11.48 + # don't check if asked not to
11.49 + test -z "$NOCHECK" && {
11.50 + echo -n " checking for $COMMAND >= $VERSION ... "
11.51 + } || {
11.52 + # we set a var with the same name as the package, but stripped of
11.53 + # unwanted chars
11.54 + VAR=`echo $PACKAGE | sed 's/-//g'`
11.55 + debug "setting $VAR"
11.56 + eval $VAR="$COMMAND"
11.57 + return 0
11.58 + }
11.59 +
11.60 + debug "checking version with $COMMAND"
11.61 + ($COMMAND --version) < /dev/null > /dev/null 2>&1 ||
11.62 + {
11.63 + echo "not found."
11.64 + continue
11.65 + }
11.66 + # strip everything that's not a digit, then use cut to get the first field
11.67 + pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1`
11.68 + debug "pkg_version $pkg_version"
11.69 + # remove any non-digit characters from the version numbers to permit numeric
11.70 + # comparison
11.71 + pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
11.72 + pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
11.73 + pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
11.74 + test -z "$pkg_major" && pkg_major=0
11.75 + test -z "$pkg_minor" && pkg_minor=0
11.76 + test -z "$pkg_micro" && pkg_micro=0
11.77 + debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
11.78 +
11.79 + #start checking the version
11.80 + debug "version check"
11.81 +
11.82 + # reset check
11.83 + WRONG=
11.84 +
11.85 + if [ ! "$pkg_major" -gt "$MAJOR" ]; then
11.86 + debug "major: $pkg_major <= $MAJOR"
11.87 + if [ "$pkg_major" -lt "$MAJOR" ]; then
11.88 + debug "major: $pkg_major < $MAJOR"
11.89 + WRONG=1
11.90 + elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
11.91 + debug "minor: $pkg_minor <= $MINOR"
11.92 + if [ "$pkg_minor" -lt "$MINOR" ]; then
11.93 + debug "minor: $pkg_minor < $MINOR"
11.94 + WRONG=1
11.95 + elif [ "$pkg_micro" -lt "$MICRO" ]; then
11.96 + debug "micro: $pkg_micro < $MICRO"
11.97 + WRONG=1
11.98 + fi
11.99 + fi
11.100 + fi
11.101 +
11.102 + if test ! -z "$WRONG"; then
11.103 + echo "found $pkg_version, not ok !"
11.104 + continue
11.105 + else
11.106 + echo "found $pkg_version, ok."
11.107 + # we set a var with the same name as the package, but stripped of
11.108 + # unwanted chars
11.109 + VAR=`echo $PACKAGE | sed 's/-//g'`
11.110 + debug "setting $VAR"
11.111 + eval $VAR="$COMMAND"
11.112 + return 0
11.113 + fi
11.114 + done
11.115 +
11.116 + echo "not found !"
11.117 + echo "You must have $PACKAGE installed to compile $package."
11.118 + echo "Download the appropriate package for your distribution,"
11.119 + echo "or get the source tarball at $URL"
11.120 + return 1;
11.121 +}
11.122 +
11.123 +aclocal_check ()
11.124 +{
11.125 + # normally aclocal is part of automake
11.126 + # so we expect it to be in the same place as automake
11.127 + # so if a different automake is supplied, we need to adapt as well
11.128 + # so how's about replacing automake with aclocal in the set var,
11.129 + # and saving that in $aclocal ?
11.130 + # note, this will fail if the actual automake isn't called automake*
11.131 + # or if part of the path before it contains it
11.132 + if [ -z "$automake" ]; then
11.133 + echo "Error: no automake variable set !"
11.134 + return 1
11.135 + else
11.136 + aclocal=`echo $automake | sed s/automake/aclocal/`
11.137 + debug "aclocal: $aclocal"
11.138 + if [ "$aclocal" != "aclocal" ];
11.139 + then
11.140 + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal"
11.141 + fi
11.142 + if [ ! -x `which $aclocal` ]; then
11.143 + echo "Error: cannot execute $aclocal !"
11.144 + return 1
11.145 + fi
11.146 + fi
11.147 +}
11.148 +
11.149 +autoheader_check ()
11.150 +{
11.151 + # same here - autoheader is part of autoconf
11.152 + # use the same voodoo
11.153 + if [ -z "$autoconf" ]; then
11.154 + echo "Error: no autoconf variable set !"
11.155 + return 1
11.156 + else
11.157 + autoheader=`echo $autoconf | sed s/autoconf/autoheader/`
11.158 + debug "autoheader: $autoheader"
11.159 + if [ "$autoheader" != "autoheader" ];
11.160 + then
11.161 + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader"
11.162 + fi
11.163 + if [ ! -x `which $autoheader` ]; then
11.164 + echo "Error: cannot execute $autoheader !"
11.165 + return 1
11.166 + fi
11.167 + fi
11.168 +
11.169 +}
11.170 +
11.171 +autoconf_2_52d_check ()
11.172 +{
11.173 + # autoconf 2.52d has a weird issue involving a yes:no error
11.174 + # so don't allow it's use
11.175 + test -z "$NOCHECK" && {
11.176 + ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'`
11.177 + if test "$ac_version" = "2.52d"; then
11.178 + echo "autoconf 2.52d has an issue with our current build."
11.179 + echo "We don't know who's to blame however. So until we do, get a"
11.180 + echo "regular version. RPM's of a working version are on the gstreamer site."
11.181 + exit 1
11.182 + fi
11.183 + }
11.184 + return 0
11.185 +}
11.186 +
11.187 +die_check ()
11.188 +{
11.189 + # call with $DIE
11.190 + # if set to 1, we need to print something helpful then die
11.191 + DIE=$1
11.192 + if test "x$DIE" = "x1";
11.193 + then
11.194 + echo
11.195 + echo "- Please get the right tools before proceeding."
11.196 + echo "- Alternatively, if you're sure we're wrong, run with --nocheck."
11.197 + exit 1
11.198 + fi
11.199 +}
11.200 +
11.201 +autogen_options ()
11.202 +{
11.203 + if test "x$1" = "x"; then
11.204 + return 0
11.205 + fi
11.206 +
11.207 + while test "x$1" != "x" ; do
11.208 + optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
11.209 + case "$1" in
11.210 + --noconfigure)
11.211 + NOCONFIGURE=defined
11.212 + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure"
11.213 + echo "+ configure run disabled"
11.214 + shift
11.215 + ;;
11.216 + --nocheck)
11.217 + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck"
11.218 + NOCHECK=defined
11.219 + echo "+ autotools version check disabled"
11.220 + shift
11.221 + ;;
11.222 + --debug)
11.223 + DEBUG=defined
11.224 + AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug"
11.225 + echo "+ debug output enabled"
11.226 + shift
11.227 + ;;
11.228 + --prefix=*)
11.229 + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg"
11.230 + echo "+ passing --prefix=$optarg to configure"
11.231 + shift
11.232 + ;;
11.233 + --prefix)
11.234 + shift
11.235 + echo "DEBUG: $1"
11.236 + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1"
11.237 + echo "+ passing --prefix=$1 to configure"
11.238 + shift
11.239 + ;;
11.240 + -h|--help)
11.241 + echo "autogen.sh (autogen options) -- (configure options)"
11.242 + echo "autogen.sh help options: "
11.243 + echo " --noconfigure don't run the configure script"
11.244 + echo " --nocheck don't do version checks"
11.245 + echo " --debug debug the autogen process"
11.246 + echo " --prefix will be passed on to configure"
11.247 + echo
11.248 + echo " --with-autoconf PATH use autoconf in PATH"
11.249 + echo " --with-automake PATH use automake in PATH"
11.250 + echo
11.251 + echo "to pass options to configure, put them as arguments after -- "
11.252 + exit 1
11.253 + ;;
11.254 + --with-automake=*)
11.255 + AUTOMAKE=$optarg
11.256 + echo "+ using alternate automake in $optarg"
11.257 + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE"
11.258 + shift
11.259 + ;;
11.260 + --with-autoconf=*)
11.261 + AUTOCONF=$optarg
11.262 + echo "+ using alternate autoconf in $optarg"
11.263 + CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF"
11.264 + shift
11.265 + ;;
11.266 + --disable*|--enable*|--with*)
11.267 + echo "+ passing option $1 to configure"
11.268 + CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1"
11.269 + shift
11.270 + ;;
11.271 + --) shift ; break ;;
11.272 + *) echo "- ignoring unknown autogen.sh argument $1"; shift ;;
11.273 + esac
11.274 + done
11.275 +
11.276 + for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done
11.277 + if test ! -z "$CONFIGURE_EXT_OPT"
11.278 + then
11.279 + echo "+ options passed to configure: $CONFIGURE_EXT_OPT"
11.280 + fi
11.281 +}
11.282 +
11.283 +toplevel_check ()
11.284 +{
11.285 + srcfile=$1
11.286 + test -f $srcfile || {
11.287 + echo "You must run this script in the top-level $package directory"
11.288 + exit 1
11.289 + }
11.290 +}
11.291 +
11.292 +
11.293 +tool_run ()
11.294 +{
11.295 + tool=$1
11.296 + options=$2
11.297 + run_if_fail=$3
11.298 + echo "+ running $tool $options..."
11.299 + $tool $options || {
11.300 + echo
11.301 + echo $tool failed
11.302 + eval $run_if_fail
11.303 + exit 1
11.304 + }
11.305 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/gmyth-stream/libgnomevfs2/configure.ac Thu Apr 12 20:35:08 2007 +0100
12.3 @@ -0,0 +1,117 @@
12.4 +AC_INIT(libgnomevfs2-gmythstream, 0.1)
12.5 +
12.6 +dnl when going to/from release please set the nano (fourth number) right !
12.7 +dnl releases only do Wall, cvs and prerelease does Werror too
12.8 +AS_VERSION(libgnomevfs2-gmythstream, LIBGNOMEVFS2_GMYTHSTREAM, 0, 1, 0, 1, LIBGNOMEVFS2_GMYTHSTREAM_CVS="no", LIBGNOMEVFS2_GMYTHSTREAM_CVS="yes")
12.9 +
12.10 +AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
12.11 +
12.12 +AM_CONFIG_HEADER(config.h)
12.13 +
12.14 +AM_DISABLE_STATIC
12.15 +
12.16 +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
12.17 +AM_MAINTAINER_MODE
12.18 +dnl make aclocal work in maintainer mode
12.19 +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
12.20 +
12.21 +dnl check for tools
12.22 +dnl Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
12.23 +CFLAGS="$CFLAGS "
12.24 +AC_PROG_CC
12.25 +AC_PROG_CPP
12.26 +AM_PROG_CC_STDC
12.27 +AC_HEADER_STDC
12.28 +AC_PROG_LIBTOOL
12.29 +
12.30 +dnl Test if --enable-debug given
12.31 +AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[enable debugging mode])])
12.32 +if test "x$enable_debug" = "xyes" ; then
12.33 + CFLAGS="$CFLAGS -g"
12.34 +fi
12.35 +
12.36 +dnl optimisation flag
12.37 +CFLAGS="$CFLAGS -O2"
12.38 +
12.39 +dnl decide on error flags
12.40 +AS_COMPILER_FLAG(-Wall, LIBGNOMEVFS2_MYTHTV_WALL="yes", LIBGNOMEVFS2_MYTHTV_WALL="no")
12.41 +
12.42 +if test "x$LIBGNOMEVFS2_MYTHTV_WALL" = "xyes"; then
12.43 + CFLAGS="$CFLAGS -Wall"
12.44 +
12.45 + if test "x$LIBGNOMEVFS2_MYTHTV_CVS" = "xyes"; then
12.46 + AS_COMPILER_FLAG(-Werror,CFLAGS="$CFLAGS -Werror",)
12.47 + fi
12.48 +fi
12.49 +
12.50 +dnl Now check required packages
12.51 +
12.52 +dnl Check for pkgconfig
12.53 +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
12.54 +dnl Give error and exit if we don't have pkgconfig
12.55 +if test "x$HAVE_PKGCONFIG" = "xno"; then
12.56 + AC_MSG_ERROR(you need to have pkgconfig installed !)
12.57 +fi
12.58 +
12.59 +dnl Check for Glib2.0
12.60 +PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
12.61 +
12.62 +dnl Give error and exit if we don't have glib
12.63 +if test "x$HAVE_GLIB" = "xno"; then
12.64 + AC_MSG_ERROR(you need glib-2.0 installed)
12.65 +fi
12.66 +
12.67 +dnl make GLIB_CFLAGS and GLIB_LIBS available
12.68 +AC_SUBST(GLIB_CFLAGS)
12.69 +AC_SUBST(GLIB_LIBS)
12.70 +
12.71 +AC_DEFINE(HAVE_GLIB,1,[Defined when glib-2.0 was found])
12.72 +
12.73 +dnl Check for GObject2.0
12.74 +PKG_CHECK_MODULES(GOBJECT,
12.75 + gobject-2.0,
12.76 + HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
12.77 +
12.78 +dnl Give error and exit if we don't have gobject
12.79 +if test "x$HAVE_GOBJECT" = "xno"; then
12.80 + AC_MSG_ERROR(you need gobject-2.0 installed)
12.81 +fi
12.82 +
12.83 +dnl make GOBJECT_CFLAGS and GOBJECT_LIBS available
12.84 +AC_SUBST(GOBJECT_CFLAGS)
12.85 +AC_SUBST(GOBJECT_LIBS)
12.86 +
12.87 +GNOME_VFS_REQS=2.7.4
12.88 +PKG_CHECK_MODULES(GNOME_VFS,
12.89 + gnome-vfs-2.0 >= $GNOME_VFS_REQS gnome-vfs-module-2.0 >= $GNOME_VFS_REQS,
12.90 + HAVE_GNOME_VFS=yes,
12.91 + HAVE_GNOME_VFS=no)
12.92 +
12.93 +if test x"$HAVE_GNOME_VFS" = xno; then
12.94 + AC_MSG_ERROR([You need gnome-vfs2 development packages to compile libgnomevfs2-gmythstream])
12.95 +fi
12.96 +
12.97 +AC_SUBST(GNOME_VFS_CFLAGS)
12.98 +AC_SUBST(GNOME_VFS_LIBS)
12.99 +
12.100 +dnl Check for gmyth
12.101 +MYTHSTREAM_REQS=0.1
12.102 +PKG_CHECK_MODULES(LIBMYTHSTREAM,
12.103 + gmyth-stream-client >= $MYTHSTREAM_REQS,
12.104 + have_libgmythstream=yes,
12.105 + have_libgmythstream=no)
12.106 +
12.107 +if test x"$have_libgmyth" = "xno"; then
12.108 + AC_MSG_ERROR(gmyth-stream-client, not found)
12.109 +fi
12.110 +
12.111 +AC_SUBST(LIBMYTHSTREAM_CFLAGS)
12.112 +AC_SUBST(LIBMYTHSTREAM_LIBS)
12.113 +
12.114 +
12.115 +AC_OUTPUT([
12.116 +Makefile
12.117 +modules/Makefile
12.118 +common/Makefile
12.119 +m4/Makefile
12.120 +])
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/gmyth-stream/libgnomevfs2/debian/README.Debian Thu Apr 12 20:35:08 2007 +0100
13.3 @@ -0,0 +1,6 @@
13.4 +libgnomevfs2-mythtv for Debian
13.5 +------------------
13.6 +
13.7 +This package provides the libgnomevfs2 mythtv modules.
13.8 +
13.9 + -- Hallyson Melo <hallyson.melo@indt.org.br>, Tue, 20 Oct 2006 10:53:12 -0300
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/gmyth-stream/libgnomevfs2/debian/changelog Thu Apr 12 20:35:08 2007 +0100
14.3 @@ -0,0 +1,6 @@
14.4 +libgnomevfs2-mythtv (0.1.1) unstable; urgency=low
14.5 +
14.6 + * Initial release
14.7 +
14.8 + -- Hallyson Melo <hallyson.melo@indt.org.br> Tue, 20 Oct 2006 10:53:12 -0300
14.9 +
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/gmyth-stream/libgnomevfs2/debian/compat Thu Apr 12 20:35:08 2007 +0100
15.3 @@ -0,0 +1,1 @@
15.4 +4
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/gmyth-stream/libgnomevfs2/debian/control Thu Apr 12 20:35:08 2007 +0100
16.3 @@ -0,0 +1,15 @@
16.4 +Source: libgnomevfs2-mythtv
16.5 +Priority: optional
16.6 +Maintainer: Hallyson Melo <hallyson.melo@indt.org.br>
16.7 +Build-Depends: debhelper (>= 4.0.0), autotools-dev, cdbs (>= 0.4.0), libglib2.0-dev, gmyth-dev (>= 0.1)
16.8 +Standards-Version: 3.6.1
16.9 +Section: libs
16.10 +
16.11 +Package: libgnomevfs2-mythtv
16.12 +Section: libs
16.13 +Architecture: any
16.14 +Depends: libglib2.0-0, gmyth (>= 0.1)
16.15 +Description: libgnomevfs2-mythtv
16.16 + Contains the gnomevfs2 modules for Mythtv protocol. It allows access backend recorded program files and livetv.
16.17 + .
16.18 + This package contains the libgnomevfs2 mythtv modules.
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/gmyth-stream/libgnomevfs2/debian/copyright Thu Apr 12 20:35:08 2007 +0100
17.3 @@ -0,0 +1,23 @@
17.4 +This package was debianized by Hallyson Melo <hallyson.melo@indt.org.br> on
17.5 +Tue, 16 May 2006 10:53:12 -0300.
17.6 +
17.7 +Copyright Holder: 2006 INdT
17.8 +
17.9 +License:
17.10 +
17.11 + This package is free software; you can redistribute it and/or
17.12 + modify it under the terms of the GNU Lesser General Public
17.13 + License as published by the Free Software Foundation; either
17.14 + version 2 of the License, or (at your option) any later version.
17.15 +
17.16 + This package is distributed in the hope that it will be useful,
17.17 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17.18 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17.19 + Lesser General Public License for more details.
17.20 +
17.21 + You should have received a copy of the GNU Lesser General Public
17.22 + License along with this package; if not, write to the Free Software
17.23 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17.24 +
17.25 +On Debian GNU/Linux systems, the complete text of the GNU Lesser General
17.26 +Public License can be found in `/usr/share/common-licenses/LGPL'.
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/gmyth-stream/libgnomevfs2/debian/dirs Thu Apr 12 20:35:08 2007 +0100
18.3 @@ -0,0 +1,2 @@
18.4 +usr/lib/gnome-vfs-2.0/modules/
18.5 +etc/gnome-vfs-2.0/modules/
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/gmyth-stream/libgnomevfs2/debian/rules Thu Apr 12 20:35:08 2007 +0100
19.3 @@ -0,0 +1,21 @@
19.4 +#!/usr/bin/make -f
19.5 +
19.6 +include /usr/share/cdbs/1/rules/debhelper.mk
19.7 +include /usr/share/cdbs/1/class/autotools.mk
19.8 +include /usr/share/cdbs/1/rules/simple-patchsys.mk
19.9 +include /usr/share/cdbs/1/rules/utils.mk
19.10 +
19.11 +# debian package version
19.12 +version=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
19.13 +
19.14 +maint: debian/control
19.15 +
19.16 +common_conf_flags = \
19.17 + --disable-debug
19.18 +
19.19 +# FIXME: should disable docs for arch only builds
19.20 +DEB_CONFIGURE_EXTRA_FLAGS := $(common_conf_flags)
19.21 +
19.22 +DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
19.23 +
19.24 +.PHONY: maint
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/gmyth-stream/libgnomevfs2/m4/Makefile.am Thu Apr 12 20:35:08 2007 +0100
20.3 @@ -0,0 +1,4 @@
20.4 +EXTRA_DIST = \
20.5 + as-compiler-flag.m4 \
20.6 + as-expand.m4 \
20.7 + as-version.m4
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/gmyth-stream/libgnomevfs2/m4/as-compiler-flag.m4 Thu Apr 12 20:35:08 2007 +0100
21.3 @@ -0,0 +1,33 @@
21.4 +dnl as-compiler-flag.m4 0.1.0
21.5 +
21.6 +dnl autostars m4 macro for detection of compiler flags
21.7 +
21.8 +dnl David Schleef <ds@schleef.org>
21.9 +
21.10 +dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
21.11 +
21.12 +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
21.13 +dnl Tries to compile with the given CFLAGS.
21.14 +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
21.15 +dnl and ACTION-IF-NOT-ACCEPTED otherwise.
21.16 +
21.17 +AC_DEFUN([AS_COMPILER_FLAG],
21.18 +[
21.19 + AC_MSG_CHECKING([to see if compiler understands $1])
21.20 +
21.21 + save_CFLAGS="$CFLAGS"
21.22 + CFLAGS="$CFLAGS $1"
21.23 +
21.24 + AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
21.25 + CFLAGS="$save_CFLAGS"
21.26 +
21.27 + if test "X$flag_ok" = Xyes ; then
21.28 + $2
21.29 + true
21.30 + else
21.31 + $3
21.32 + true
21.33 + fi
21.34 + AC_MSG_RESULT([$flag_ok])
21.35 +])
21.36 +
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/gmyth-stream/libgnomevfs2/m4/as-expand.m4 Thu Apr 12 20:35:08 2007 +0100
22.3 @@ -0,0 +1,40 @@
22.4 +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
22.5 +dnl
22.6 +dnl example
22.7 +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
22.8 +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
22.9 +
22.10 +AC_DEFUN([AS_AC_EXPAND],
22.11 +[
22.12 + EXP_VAR=[$1]
22.13 + FROM_VAR=[$2]
22.14 +
22.15 + dnl first expand prefix and exec_prefix if necessary
22.16 + prefix_save=$prefix
22.17 + exec_prefix_save=$exec_prefix
22.18 +
22.19 + dnl if no prefix given, then use /usr/local, the default prefix
22.20 + if test "x$prefix" = "xNONE"; then
22.21 + prefix=$ac_default_prefix
22.22 + fi
22.23 + dnl if no exec_prefix given, then use prefix
22.24 + if test "x$exec_prefix" = "xNONE"; then
22.25 + exec_prefix=$prefix
22.26 + fi
22.27 +
22.28 + full_var="$FROM_VAR"
22.29 + dnl loop until it doesn't change anymore
22.30 + while true; do
22.31 + new_full_var="`eval echo $full_var`"
22.32 + if test "x$new_full_var"="x$full_var"; then break; fi
22.33 + full_var=$new_full_var
22.34 + done
22.35 +
22.36 + dnl clean up
22.37 + full_var=$new_full_var
22.38 + AC_SUBST([$1], "$full_var")
22.39 +
22.40 + dnl restore prefix and exec_prefix
22.41 + prefix=$prefix_save
22.42 + exec_prefix=$exec_prefix_save
22.43 +])
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/gmyth-stream/libgnomevfs2/m4/as-version.m4 Thu Apr 12 20:35:08 2007 +0100
23.3 @@ -0,0 +1,59 @@
23.4 +dnl version.m4 0.0.5
23.5 +dnl autostars m4 macro for versioning
23.6 +dnl thomas@apestaart.org
23.7 +dnl
23.8 +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
23.9 +dnl example
23.10 +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
23.11 +dnl for a 0.3.2 release version
23.12 +dnl
23.13 +dnl this macro
23.14 +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
23.15 +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
23.16 +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
23.17 +dnl - executes the relevant action
23.18 +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
23.19 +dnl as well as the little ones
23.20 +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
23.21 +dnl maintainer mode from running ok
23.22 +dnl
23.23 +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
23.24 +
23.25 +AC_DEFUN([AS_VERSION],
23.26 +[
23.27 + PACKAGE=[$1]
23.28 + [$2]_MAJOR_VERSION=[$3]
23.29 + [$2]_MINOR_VERSION=[$4]
23.30 + [$2]_MICRO_VERSION=[$5]
23.31 + NANO=[$6]
23.32 + [$2]_NANO_VERSION=$NANO
23.33 + if test "x$NANO" = "x" || test "x$NANO" = "x0";
23.34 + then
23.35 + AC_MSG_NOTICE(configuring [$1] for release)
23.36 + VERSION=[$3].[$4].[$5]
23.37 + [$2]_RELEASE=1
23.38 + dnl execute action
23.39 + ifelse([$7], , :, [$7])
23.40 + else
23.41 + AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
23.42 + VERSION=[$3].[$4].[$5].$NANO
23.43 + [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
23.44 + dnl execute action
23.45 + ifelse([$8], , :, [$8])
23.46 + fi
23.47 +
23.48 + [$2]_VERSION=$VERSION
23.49 + AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
23.50 + AC_SUBST([$2]_VERSION)
23.51 +
23.52 + AC_SUBST([$2]_RELEASE)
23.53 +
23.54 + AC_SUBST([$2]_MAJOR_VERSION)
23.55 + AC_SUBST([$2]_MINOR_VERSION)
23.56 + AC_SUBST([$2]_MICRO_VERSION)
23.57 + AC_SUBST([$2]_NANO_VERSION)
23.58 + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
23.59 + AC_SUBST(PACKAGE)
23.60 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
23.61 + AC_SUBST(VERSION)
23.62 +])
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/gmyth-stream/libgnomevfs2/modules/Makefile.am Thu Apr 12 20:35:08 2007 +0100
24.3 @@ -0,0 +1,29 @@
24.4 +INCLUDES = \
24.5 + -I$(top_srcdir) \
24.6 + -I$(top_builddir) \
24.7 + $(GNOME_VFS_CFLAGS) \
24.8 + $(LIBMYTHSTREAM_CFLAGS) \
24.9 + -D_FILE_OFFSET_BITS=64 \
24.10 + -D_BSD_SOURCE \
24.11 + -D_LARGEFILE64_SOURCE \
24.12 + -D_POSIX_PTHREAD_SEMANTICS \
24.13 + -D_REENTRANT \
24.14 + -DG_DISABLE_DEPRECATED \
24.15 + -DG_LOG_DOMAIN=\"gnome-vfs-modules\"
24.16 +
24.17 +EXTRA_DIST = \
24.18 + gmythstream-module.conf
24.19 +
24.20 +modulesconfdir = $(sysconfdir)/gnome-vfs-2.0/modules
24.21 +modulesconf_DATA = \
24.22 + gmythstream-module.conf
24.23 +
24.24 +module_flags = -export_dynamic -avoid-version -module -no-undefined
24.25 +modulesdir = $(libdir)/gnome-vfs-2.0/modules
24.26 +modules_LTLIBRARIES = libgmythstream.la
24.27 +
24.28 +libgmythstream_la_SOURCES = gmythstream-method.c
24.29 +libgmythstream_la_LDFLAGS = $(module_flags)
24.30 +libgmythstream_la_LIBADD = \
24.31 + $(GNOME_VFS_LIBS) \
24.32 + $(LIBMYTHSTREAM_LIBS)
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/gmyth-stream/libgnomevfs2/modules/gmythstream-method.c Thu Apr 12 20:35:08 2007 +0100
25.3 @@ -0,0 +1,354 @@
25.4 +/*
25.5 + * @author Artur Duque de Souza <souza.artur@indt.org.br>
25.6 + *
25.7 + * This program is free software; you can redistribute it and/or modify
25.8 + * it under the terms of the GNU Lesser General Public License as published by
25.9 + * the Free Software Foundation; either version 2 of the License, or
25.10 + * (at your option) any later version.
25.11 + *
25.12 + * This program is distributed in the hope that it will be useful,
25.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25.15 + * GNU General Public License for more details.
25.16 + *
25.17 + m * You should have received a copy of the GNU Lesser General Public License
25.18 + * along with this program; if not, write to the Free Software
25.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25.20 + */
25.21 +
25.22 +#ifdef HAVE_CONFIG_H
25.23 +#include <config.h>
25.24 +#endif
25.25 +
25.26 +#include <sys/socket.h> /* for socket(), connect(), send(), and recv() */
25.27 +#include <arpa/inet.h> /* for sockaddr_in and inet_addr() */
25.28 +#include <stdlib.h> /* for atoi() and exit() */
25.29 +#include <string.h> /* for memset() */
25.30 +#include <unistd.h> /* for close() */
25.31 +#include <errno.h>
25.32 +
25.33 +#include <glib.h>
25.34 +#include <glib/gprintf.h>
25.35 +#include <glib/gstdio.h>
25.36 +#include <gmyth-stream-client.h>
25.37 +
25.38 +#include <libgnomevfs/gnome-vfs-module.h>
25.39 +#include <libgnomevfs/gnome-vfs-utils.h>
25.40 +
25.41 +#define BUFFER_SIZE 4096
25.42 +
25.43 +typedef struct {
25.44 + gint port;
25.45 + gchar* hostname;
25.46 +
25.47 + GMythStreamClient *stream;
25.48 + gint fd;
25.49 +} gmsHandle;
25.50 +
25.51 +typedef struct {
25.52 + gchar *file_name;
25.53 + gchar *mux;
25.54 + gchar *vcodec;
25.55 + guint vbitrate;
25.56 + gdouble fps;
25.57 + gchar *acodec;
25.58 + guint abitrate;
25.59 + guint width;
25.60 + guint height;
25.61 + guint port;
25.62 + gchar *opt;
25.63 +} UriArgs;
25.64 +
25.65 +
25.66 +static gmsHandle* gmsHandle_new(GnomeVFSURI *uri);
25.67 +
25.68 +static GnomeVFSResult
25.69 +do_open (GnomeVFSMethod *method,
25.70 + GnomeVFSMethodHandle **method_handle,
25.71 + GnomeVFSURI *uri,
25.72 + GnomeVFSOpenMode mode,
25.73 + GnomeVFSContext *context);
25.74 +
25.75 +static GnomeVFSResult
25.76 +do_read (GnomeVFSMethod *method,
25.77 + GnomeVFSMethodHandle *method_handle,
25.78 + gpointer buffer,
25.79 + GnomeVFSFileSize bytes,
25.80 + GnomeVFSFileSize *bytes_read,
25.81 + GnomeVFSContext *context);
25.82 +
25.83 +static GnomeVFSResult
25.84 +do_close (GnomeVFSMethod * method,
25.85 + GnomeVFSMethodHandle * method_handle,
25.86 + GnomeVFSContext * context);
25.87 +
25.88 +static GnomeVFSResult
25.89 +do_get_file_info (GnomeVFSMethod * method,
25.90 + GnomeVFSURI * uri,
25.91 + GnomeVFSFileInfo * file_info,
25.92 + GnomeVFSFileInfoOptions options,
25.93 + GnomeVFSContext * context);
25.94 +
25.95 +
25.96 +static GnomeVFSResult
25.97 +do_get_file_info_from_handle (GnomeVFSMethod *method,
25.98 + GnomeVFSMethodHandle *method_handle,
25.99 + GnomeVFSFileInfo *file_info,
25.100 + GnomeVFSFileInfoOptions options,
25.101 + GnomeVFSContext *context);
25.102 +
25.103 +
25.104 +static gboolean
25.105 +do_is_local (GnomeVFSMethod * method, const GnomeVFSURI * uri);
25.106 +
25.107 +
25.108 +static gmsHandle* gmsHandle_new(GnomeVFSURI *uri)
25.109 +{
25.110 + gmsHandle* handler = (gmsHandle*)g_malloc0(sizeof(gmsHandle));
25.111 +
25.112 + handler->hostname = (gchar*)gnome_vfs_uri_get_host_name(uri);
25.113 + handler->port = gnome_vfs_uri_get_host_port(uri);
25.114 + handler->stream = gmyth_stream_client_new ();
25.115 +
25.116 + return handler;
25.117 +}
25.118 +
25.119 +static GnomeVFSMethod method = {
25.120 + sizeof (GnomeVFSMethod),
25.121 + do_open, /* open */
25.122 + NULL, /* create */
25.123 + do_close, /* close */
25.124 + do_read, /* read */
25.125 + NULL, /* write */
25.126 + NULL, /* seek */
25.127 + NULL, /* tell */
25.128 + NULL, /* truncate_handle */
25.129 + NULL, /* open_directory */
25.130 + NULL, /* close_directory */
25.131 + NULL, /* read_directory */
25.132 + do_get_file_info, /* get_file_info */
25.133 + do_get_file_info_from_handle, /* get_file_info_from_handle */
25.134 + do_is_local, /* is_local */
25.135 + NULL, /* make_directory */
25.136 + NULL, /* remove_directory */
25.137 + NULL, /* move */
25.138 + NULL, /* unlink */
25.139 + NULL, /* check_same_fs */
25.140 + NULL, /* set_file_info */
25.141 + NULL, /* truncate */
25.142 + NULL, /* find_directory */
25.143 + NULL, /* create_symbolic_link */
25.144 + NULL, /* monitor_add */
25.145 + NULL, /* monitor_cancel */
25.146 + NULL /* file_control */
25.147 +};
25.148 +
25.149 +GnomeVFSMethod *
25.150 +vfs_module_init (const char *method_name, const char *args)
25.151 +{
25.152 + return &method;
25.153 +}
25.154 +
25.155 +void
25.156 +vfs_module_shutdown (GnomeVFSMethod* method)
25.157 +{
25.158 + return;
25.159 +}
25.160 +
25.161 +char* _parse_opt(char* opt)
25.162 +{
25.163 + char** list = g_strsplit(opt, "opt=", 2);
25.164 + char** opts = g_strsplit(list[1], "+", 32);
25.165 + char* value = "";
25.166 + char* aux;
25.167 + gint i = 0;
25.168 +
25.169 + for (aux = opts[0]; aux != NULL; aux = opts[++i])
25.170 + value = g_strdup_printf("%s %s", value, aux);
25.171 +
25.172 + g_free(aux);
25.173 + g_strfreev(list);
25.174 + g_strfreev(opts);
25.175 + return value;
25.176 +}
25.177 +
25.178 +static UriArgs *
25.179 +_uri_parse_args (const GnomeVFSURI *uri)
25.180 +{
25.181 + gchar *file = gnome_vfs_unescape_string (uri->text, NULL);
25.182 + gchar **lst = g_strsplit (file, "?", 0);
25.183 + UriArgs *info = g_new0 (UriArgs, 1);
25.184 + gint i = 1;
25.185 +
25.186 + gchar** prop = NULL;
25.187 + prop = g_strsplit_set(lst[0], "/=", 3);
25.188 +
25.189 + info->file_name = g_strdup_printf ("%s://%s",\
25.190 + prop[1],prop[2]);
25.191 + g_strfreev(prop);
25.192 +
25.193 + gchar* walk;
25.194 + for (walk = lst[1]; walk != NULL; walk = lst[++i])
25.195 + {
25.196 + prop = g_strsplit(walk, "=", 2);
25.197 +
25.198 + if (g_strv_length (prop) == 2) {
25.199 + if (strcmp (prop[0], "mux") == 0) {
25.200 + info->mux = g_strdup (prop[1]);
25.201 + } else if (strcmp (prop[0], "vcodec") == 0) {
25.202 + info->vcodec = g_strdup (prop[1]);
25.203 + } else if (strcmp (prop[0], "vbitrate") == 0) {
25.204 + info->vbitrate = atoi (prop[1]);
25.205 + } else if (strcmp (prop[0], "fps") == 0) {
25.206 + info->fps = g_strtod (prop[1], NULL);
25.207 + } else if (strcmp (prop[0], "acodec") == 0) {
25.208 + info->acodec = g_strdup (prop[1]);
25.209 + } else if (strcmp (prop[0], "abitrate") == 0) {
25.210 + info->abitrate = atoi (prop[1]);
25.211 + } else if (strcmp (prop[0], "width") == 0) {
25.212 + info->width = atoi (prop[1]);
25.213 + } else if (strcmp (prop[0], "height") == 0) {
25.214 + info->height = atoi (prop[1]);
25.215 + } else if (strcmp (prop[0], "opt") == 0) {
25.216 + g_debug("DENTRO DE OPT: %s", walk);
25.217 + char* v = _parse_opt(walk);
25.218 + info->opt = g_strdup (v);
25.219 + }
25.220 + }
25.221 + g_strfreev (prop);
25.222 + }
25.223 +
25.224 + g_free (file);
25.225 + g_strfreev (lst);
25.226 + return info;
25.227 +}
25.228 +
25.229 +static GnomeVFSResult
25.230 +do_open (GnomeVFSMethod *method,
25.231 + GnomeVFSMethodHandle **method_handle,
25.232 + GnomeVFSURI *uri,
25.233 + GnomeVFSOpenMode mode,
25.234 + GnomeVFSContext *context)
25.235 +{
25.236 + gmsHandle *handle = gmsHandle_new(uri);
25.237 + UriArgs *args;
25.238 +
25.239 + if (!gmyth_stream_client_connect (handle->stream,
25.240 + gnome_vfs_uri_get_host_name (uri),
25.241 + gnome_vfs_uri_get_host_port (uri))) {
25.242 +
25.243 + return GNOME_VFS_ERROR_INVALID_FILENAME;
25.244 + }
25.245 +
25.246 + args = _uri_parse_args (uri);
25.247 +
25.248 + gint ret = gmyth_stream_client_open_stream (handle->stream,
25.249 + args->file_name,
25.250 + args->mux,
25.251 + args->vcodec,
25.252 + args->vbitrate,
25.253 + args->fps,
25.254 + args->acodec,
25.255 + args->abitrate,
25.256 + args->width,
25.257 + args->height,
25.258 + args->opt);
25.259 +
25.260 + g_free (args);
25.261 +
25.262 + if (ret == -1) {
25.263 + gmyth_stream_client_disconnect (handle->stream);
25.264 + return GNOME_VFS_ERROR_INVALID_FILENAME;
25.265 + }
25.266 +
25.267 + handle->fd = gmyth_stream_client_play_stream (handle->stream);
25.268 +
25.269 + if (handle->fd == -1) {
25.270 + gmyth_stream_client_disconnect (handle->stream);
25.271 + return GNOME_VFS_ERROR_INVALID_FILENAME;
25.272 + }
25.273 +
25.274 + *method_handle = (GnomeVFSMethodHandle *) handle;
25.275 + return GNOME_VFS_OK;
25.276 +}
25.277 +
25.278 +static GnomeVFSResult
25.279 +do_read (GnomeVFSMethod *method,
25.280 + GnomeVFSMethodHandle *method_handle,
25.281 + gpointer buffer,
25.282 + GnomeVFSFileSize bytes,
25.283 + GnomeVFSFileSize *bytes_read,
25.284 + GnomeVFSContext *context)
25.285 +{
25.286 +
25.287 + gint64 total_read = 0;
25.288 + gmsHandle *handle = (gmsHandle *) method_handle;
25.289 +
25.290 + total_read = recv(handle->fd, buffer, BUFFER_SIZE, 0);
25.291 + *bytes_read = (GnomeVFSFileSize) total_read;
25.292 +
25.293 + if (total_read < 0) return GNOME_VFS_ERROR_INTERNAL;
25.294 + else return GNOME_VFS_OK;
25.295 +
25.296 +}
25.297 +
25.298 +static GnomeVFSResult
25.299 +do_close (GnomeVFSMethod * method,
25.300 + GnomeVFSMethodHandle * method_handle,
25.301 + GnomeVFSContext * context)
25.302 +{
25.303 + gmsHandle *handle = (gmsHandle *) method_handle;
25.304 +
25.305 + gmyth_stream_client_close_stream (handle->stream);
25.306 + gmyth_stream_client_disconnect (handle->stream);
25.307 +
25.308 + g_free(handle);
25.309 + return GNOME_VFS_OK;
25.310 +}
25.311 +
25.312 +
25.313 +static GnomeVFSResult
25.314 +do_get_file_info (GnomeVFSMethod * method,
25.315 + GnomeVFSURI * uri,
25.316 + GnomeVFSFileInfo * file_info,
25.317 + GnomeVFSFileInfoOptions options,
25.318 + GnomeVFSContext * context)
25.319 +{
25.320 + file_info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE |
25.321 + GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
25.322 +
25.323 + file_info->type = GNOME_VFS_FILE_TYPE_SOCKET;
25.324 +
25.325 + file_info->permissions = GNOME_VFS_PERM_USER_READ |
25.326 + GNOME_VFS_PERM_OTHER_READ |
25.327 + GNOME_VFS_PERM_GROUP_READ;
25.328 +
25.329 + return GNOME_VFS_OK;
25.330 +}
25.331 +
25.332 +
25.333 +static GnomeVFSResult
25.334 +do_get_file_info_from_handle (GnomeVFSMethod *method,
25.335 + GnomeVFSMethodHandle *method_handle,
25.336 + GnomeVFSFileInfo *file_info,
25.337 + GnomeVFSFileInfoOptions options,
25.338 + GnomeVFSContext *context)
25.339 +{
25.340 + file_info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE |
25.341 + GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
25.342 +
25.343 + file_info->type = GNOME_VFS_FILE_TYPE_SOCKET;
25.344 +
25.345 + file_info->permissions = GNOME_VFS_PERM_USER_READ |
25.346 + GNOME_VFS_PERM_OTHER_READ |
25.347 + GNOME_VFS_PERM_GROUP_READ;
25.348 +
25.349 + return GNOME_VFS_OK;
25.350 +}
25.351 +
25.352 +
25.353 +static gboolean
25.354 +do_is_local (GnomeVFSMethod * method, const GnomeVFSURI * uri)
25.355 +{
25.356 + return FALSE;
25.357 +}
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/gmyth-stream/libgnomevfs2/modules/gmythstream-module.conf Thu Apr 12 20:35:08 2007 +0100
26.3 @@ -0,0 +1,1 @@
26.4 +gmyth: gmythstream
27.1 --- a/gmyth-stream/server/plugins/media/gstreamer.py Thu Apr 12 15:12:12 2007 +0100
27.2 +++ b/gmyth-stream/server/plugins/media/gstreamer.py Thu Apr 12 20:35:08 2007 +0100
27.3 @@ -7,40 +7,40 @@
27.4 from threading import Thread
27.5
27.6 class Media:
27.7 - class StreamListener(Thread):
27.8 - def __init__ (self, stream_data):
27.9 - Thread.__init__(self)
27.10 - self.stream = stream_data
27.11 - print "Thread Created"
27.12 + class StreamListener(Thread):
27.13 + def __init__ (self, stream_data):
27.14 + Thread.__init__(self)
27.15 + self.stream = stream_data
27.16 + print "Thread Created"
27.17
27.18 - def run (self):
27.19 - #Create socket
27.20 - print "Waiting connection"
27.21 - self.stream.Socket.listen(1)
27.22 - self.stream.Connection, self.stream.Addr = self.stream.Socket.accept ()
27.23 - print "Connection requested"
27.24 - self.stream.Sink.set_property ("fd", self.stream.Connection.fileno())
27.25 - self.stream.Pipe.set_state(gst.STATE_PLAYING)
27.26 - print "PLAYING"
27.27 + def run (self):
27.28 + #Create socket
27.29 + print "Waiting connection"
27.30 + self.stream.Socket.listen(1)
27.31 + self.stream.Connection, self.stream.Addr = self.stream.Socket.accept ()
27.32 + print "Connection requested"
27.33 + self.stream.Sink.set_property ("fd", self.stream.Connection.fileno())
27.34 + self.stream.Pipe.set_state(gst.STATE_PLAYING)
27.35 + print "PLAYING"
27.36
27.37
27.38 class StreamData:
27.39 stream_count = 0
27.40
27.41 - def __init__ (self, pipe, abin, vbin, sink):
27.42 - self.stream_count += 1
27.43 - self.Id = self.stream_count
27.44 - self.Pipe = pipe
27.45 - self.Abin = abin
27.46 - self.Vbin = vbin
27.47 - self.Sink = sink
27.48 - self.Loop = gobject.MainLoop()
27.49 - self.ACaps = ""
27.50 - self.VCaps = ""
27.51 - self.Ready = False
27.52 - self.Socket = None
27.53 - self.Connection = None
27.54 - self.Addr = None
27.55 + def __init__ (self, pipe, abin, vbin, sink):
27.56 + self.stream_count += 1
27.57 + self.Id = self.stream_count
27.58 + self.Pipe = pipe
27.59 + self.Abin = abin
27.60 + self.Vbin = vbin
27.61 + self.Sink = sink
27.62 + self.Loop = gobject.MainLoop()
27.63 + self.ACaps = ""
27.64 + self.VCaps = ""
27.65 + self.Ready = False
27.66 + self.Socket = None
27.67 + self.Connection = None
27.68 + self.Addr = None
27.69
27.70 def __init__(self, config):
27.71 # set gstreamer basic options
27.72 @@ -49,7 +49,7 @@
27.73 self.socket = None
27.74 self.connection = None
27.75 self.addr = None
27.76 - self.ready = False
27.77 + self.ready = False
27.78
27.79
27.80 def setup(self, uri, mux, vcodec, vbitrate,
27.81 @@ -181,26 +181,25 @@
27.82 print "End run"
27.83
27.84
27.85 - #Create socket
27.86 - stream_data.Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
27.87 - print "Bind on port %d" % port
27.88 - stream_data.Socket.bind(('', int (port)))
27.89 + #Create socket
27.90 + stream_data.Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
27.91 + print "Bind on port %d" % port
27.92 + stream_data.Socket.bind(('', int (port)))
27.93 + self.streams.append (stream_data)
27.94 + return (True, "")
27.95
27.96 - self.streams.append (stream_data)
27.97 - return True
27.98 -
27.99 - def play(self):
27.100 - stream = self.streams[0]
27.101 - current = self.StreamListener(stream)
27.102 - current.start ()
27.103 - print "Saindo"
27.104 - return True
27.105 + def play(self):
27.106 + stream = self.streams[0]
27.107 + current = self.StreamListener(stream)
27.108 + current.start ()
27.109 + print "Saindo"
27.110 + return (True, "")
27.111
27.112 def stop(self):
27.113 - stream = self.streams[0]
27.114 - stream.Pipe.set_state(gst.STATE_NULL)
27.115 - stream.Connection.close ()
27.116 - return True
27.117 + stream = self.streams[0]
27.118 + stream.Pipe.set_state(gst.STATE_NULL)
27.119 + stream.Connection.close ()
27.120 + return (True, "")
27.121
27.122
27.123 def __on_bus_message (self, bus, message, stream_data):
28.1 --- a/gmyth-stream/server/plugins/media/mencoder.py Thu Apr 12 15:12:12 2007 +0100
28.2 +++ b/gmyth-stream/server/plugins/media/mencoder.py Thu Apr 12 20:35:08 2007 +0100
28.3 @@ -201,7 +201,7 @@
28.4 self.filename = "dvd://" + filename
28.5
28.6 elif self.kind == "myth":
28.7 - self.filename = "myth://" + filename
28.8 + self.filename = filename
28.9 self.gst_pipe = os.pipe()
28.10 print self.gst_pipe[0]
28.11 print self.gst_pipe[1]
28.12 @@ -267,6 +267,7 @@
28.13 self.setup_mencoder()
28.14
28.15 ret_val = self.setup_filename(filename)
28.16 +
28.17 if not ret_val[0]:
28.18 return ret_val
28.19
28.20 @@ -332,7 +333,7 @@
28.21 if self.gst_pipe:
28.22 try:
28.23 gst = [ lib.which("gst-launch-0.10") ]
28.24 - self.arg_append(gst, "filesrc location=/tmp/mpg/bad_day.mpg")
28.25 + self.arg_append(gst, "gnomevfssrc location=%s" % self.filename)
28.26 self.arg_append(gst, "! fdsink fd=%d" % self.gst_pipe[1])
28.27 self.gst_pid = Popen(gst, stdout=self.gst_pipe[1], close_fds=True)
28.28 except Exception, e: