rpms/lib3ds/F-7 lib3ds-1.3.0-3ds2m.diff, NONE, 1.1 lib3ds-1.2.0-pkgconfig.diff, NONE, 1.1

Ralf Corsépius (corsepiu) fedora-extras-commits at redhat.com
Sat Nov 3 07:34:15 UTC 2007


Author: corsepiu

Update of /cvs/pkgs/rpms/lib3ds/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11667

Added Files:
	lib3ds-1.3.0-3ds2m.diff lib3ds-1.2.0-pkgconfig.diff 
Log Message:
New.

lib3ds-1.3.0-3ds2m.diff:

--- NEW FILE lib3ds-1.3.0-3ds2m.diff ---
diff -uNr lib3ds-1.3.0.orig/tools/3ds2m.1 lib3ds-1.3.0/tools/3ds2m.1
--- lib3ds-1.3.0.orig/tools/3ds2m.1	1970-01-01 01:00:00.000000000 +0100
+++ lib3ds-1.3.0/tools/3ds2m.1	2007-11-03 07:23:44.000000000 +0100
@@ -0,0 +1,38 @@
+.TH 3ds2m 1 "12 Jan 2001" Version 1.0
+.SH NAME
+3ds2m - Converts meshes of a 3DS file into a m-file.
+.SH SYNOPSIS
+.B 3ds2m
+[options] filename [options]
+.SH DESCRIPTION
+.PP
+\fI3ds2m\fP is a tool to convert meshes of a 3DS file into a m-file. 
+.SH OPTIONS
+.l
+\fI3ds2m\fP accepts the following options:
+.TP 8
+.B -h/--help
+This help
+.TP 8
+.B -o/--output <filename>
+Write output to <filename> instead of stdout
+.TP 8
+.B -m/--mesh name
+Write only specific mesh.B -c/--camera <name>
+.SH COPYRIGHT
+3ds2m Copyright \(co 1996-2001 by J.E. Hoffmann <je-h at gmx.net>
+.PP
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+.PP
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+.PP
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
diff -uNr lib3ds-1.3.0.orig/tools/3ds2m.c lib3ds-1.3.0/tools/3ds2m.c
--- lib3ds-1.3.0.orig/tools/3ds2m.c	1970-01-01 01:00:00.000000000 +0100
+++ lib3ds-1.3.0/tools/3ds2m.c	2007-11-03 07:23:44.000000000 +0100
@@ -0,0 +1,211 @@
+/*
+ * The 3D Studio File Format Library
+ * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h at gmx.net>
+ * All rights reserved.
+ *
+ * This program is  free  software;  you can redistribute it and/or modify it
+ * under the terms of the  GNU Lesser General Public License  as published by 
+ * the  Free Software Foundation;  either version 2.1 of the License,  or (at 
+ * your option) any later version.
+ *
+ * This  program  is  distributed in  the  hope that it will  be useful,  but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public  
+ * License for more details.
+ *
+ * You should  have received  a copy of the GNU Lesser General Public License
+ * along with  this program;  if not, write to the  Free Software Foundation,
+ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: 3ds2m.c,v 1.1 2001/07/18 12:17:49 jeh Exp $
+ */
+#include <lib3ds/file.h>
+#include <lib3ds/mesh.h>
+#include <lib3ds/vector.h>
+#include <stdlib.h>
+#include <string.h>
+#include <config.h>
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
+
+/*!
+\example 3ds2m.c
+
+Converts meshes of a <i>3DS</i> file into a m-file.
+
+\code
+Syntax: 3ds2m [options] filename [options]
+
+Options:
+  -h/--help              This help
+  -o/--output filename   Write output to file instead of stdout
+  -m/--mesh name         Write only specific mesh
+\endcode
+
+A m-file is a simple data format storing vertex and face information of a polygonal mesh.
+It has the following structure.
+
+\code
+#
+# <comment>
+#
+Vertex <vertex-id> <x> <y> <z>
+...
+Face <face-id> <vertex-1> <vertex-2> ... <vertex-n>
+\endcode
+
+\author J.E. Hoffmann <je-h at gmx.net>
+*/
+
+
+static void
+help()
+{
+  fprintf(stderr,
+"The 3D Studio File Format Library - 3ds2m Version " VERSION "\n"
+"Copyright (C) 1996-2001 by J.E. Hoffmann <je-h at gmx.net>\n"
+"All rights reserved.\n"
+""
+"Syntax: 3ds2m [options] filename [options]\n"
+"\n"
+"Options:\n"
+"  -h/--help              This help\n"
+"  -o/--output filename   Write output to file instead of stdout\n"
+"  -m/--mesh name         Write only specific mesh\n"
+"\n"
+);
+  exit(1);
+}
+
+
+static const char* filename=0;
+static const char* output=0;
+static const char* mesh=0;
+
+
+static void
+parse_args(int argc, char **argv)
+{
+  int i;
+  
+  for (i=1; i<argc; ++i) {
+    if (argv[i][0]=='-') {
+      if ((strcmp(argv[i],"-h")==0) || (strcmp(argv[i],"--help")==0)) {
+        help();
+      }
+      else
+      if ((strcmp(argv[i],"-o")==0) || (strcmp(argv[i],"--output")==0)) {
+        ++i;
+        if (output || (i>=argc)) {
+          help();
+        }
+        output=argv[i];
+      }
+      else
+      if ((strcmp(argv[i],"-m")==0) || (strcmp(argv[i],"--mesh")==0)) {
+        ++i;
+        if (mesh || (i>=argc)) {
+          help();
+        }
+        mesh=argv[i];
+      }
+      else {
+        help();
+      }
+    }
+    else {
+      if (filename) {
+        help();
+      }
+      filename=argv[i];
+    }
+  }
+  if (!filename) {
+    help();
+  }
+}
+
+
+static void
+dump_m_file(Lib3dsFile *f, FILE *o)
+{
+  Lib3dsMesh *m;
+  int points=0;
+  int faces=0;
+  unsigned i;
+  Lib3dsVector pos;
+
+  fprintf(o, "#\n");
+  fprintf(o, "# Created by lib3ds2m (http://lib3ds.sourceforge.net)\n");
+  fprintf(o, "#\n");
+  for (m=f->meshes; m; m=m->next) {
+    if (mesh) {
+      if (strcmp(mesh, m->name)!=0) {
+        continue;
+      }
+    }
+    
+    fprintf(o, "#\n");
+    fprintf(o, "# %s vertices=%ld faces=%ld\n",
+      m->name,
+      m->points,
+      m->faces
+    );
+    fprintf(o, "#\n");
+    
+    for (i=0; i<m->points; ++i) {
+      lib3ds_vector_copy(pos, m->pointL[i].pos);
+      fprintf(o, "Vertex %d %f %f %f\n", points+i, pos[0], pos[1],pos[2]);
+    }
+
+    for (i=0; i<m->faces; ++i) {
+      fprintf(o, "Face %d %d %d %d\n",
+        faces+i,
+        points+m->faceL[i].points[0],
+        points+m->faceL[i].points[1],
+        points+m->faceL[i].points[2]
+      );
+    }
+
+    points+=m->points;
+    faces+=m->faces;
+  }
+}
+
+
+int
+main(int argc, char **argv)
+{
+  Lib3dsFile *f=0;
+
+  parse_args(argc, argv);
+  f=lib3ds_file_load(filename);
+  if (!f) {
+    fprintf(stderr, "***ERROR***\nLoading file %s failed\n", filename);
+    exit(1);
+  }
+  if (output) {
+    FILE *o=fopen(output, "w+");
+    if (!o) {
+      fprintf(stderr, "***ERROR***\nCan't open %s for writing\n", output);
+      exit(1);
+    }
+    dump_m_file(f,o);
+    fclose(o);
+  }
+  else {
+    dump_m_file(f,stdout);
+  }
+
+  lib3ds_file_free(f);
+  return(0);
+}
+
+
+
+
+
+
+
diff -uNr lib3ds-1.3.0.orig/tools/Makefile.am lib3ds-1.3.0/tools/Makefile.am
--- lib3ds-1.3.0.orig/tools/Makefile.am	2007-06-14 11:59:10.000000000 +0200
+++ lib3ds-1.3.0/tools/Makefile.am	2007-11-03 07:25:10.000000000 +0100
@@ -24,13 +24,13 @@
   -I$(top_srcdir) 
 
 bin_PROGRAMS = \
-  3dsdump 
+  3dsdump 3ds2m
 
 LDADD = \
   $(top_builddir)/lib3ds/lib3ds.la 
 
 MANPAGES = \
-  3dsdump.1 
+  3dsdump.1 3ds2m.1
 
 man_MANS = $(MANPAGES)
 EXTRA_DIST = $(MANPAGES) 
diff -uNr lib3ds-1.3.0.orig/tools/Makefile.in lib3ds-1.3.0/tools/Makefile.in
--- lib3ds-1.3.0.orig/tools/Makefile.in	2007-06-27 08:37:20.000000000 +0200
+++ lib3ds-1.3.0/tools/Makefile.in	2007-11-03 07:25:30.000000000 +0100
@@ -32,7 +32,7 @@
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = 3dsdump$(EXEEXT)
+bin_PROGRAMS = 3dsdump$(EXEEXT) 3ds2m$(EXEEXT)
 subdir = tools
 DIST_COMMON = $(srcdir)/3dsdump.1.in $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
@@ -50,6 +50,10 @@
 3dsdump_OBJECTS = 3dsdump.$(OBJEXT)
 3dsdump_LDADD = $(LDADD)
 3dsdump_DEPENDENCIES = $(top_builddir)/lib3ds/lib3ds.la
+3ds2m_SOURCES = 3ds2m.c
+3ds2m_OBJECTS = 3ds2m.$(OBJEXT)
+3ds2m_LDADD = $(LDADD)
+3ds2m_DEPENDENCIES = $(top_builddir)/lib3ds/lib3ds.la
 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
@@ -62,8 +66,8 @@
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-SOURCES = 3dsdump.c
-DIST_SOURCES = 3dsdump.c
+SOURCES = 3dsdump.c 3ds2m.c
+DIST_SOURCES = 3dsdump.c 3ds2m.c
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
@@ -187,7 +191,7 @@
   $(top_builddir)/lib3ds/lib3ds.la 
 
 MANPAGES = \
-  3dsdump.1 
+  3dsdump.1 3ds2m.1
 
 man_MANS = $(MANPAGES)
 EXTRA_DIST = $(MANPAGES) 
@@ -257,6 +261,9 @@
 3dsdump$(EXEEXT): $(3dsdump_OBJECTS) $(3dsdump_DEPENDENCIES) 
 	@rm -f 3dsdump$(EXEEXT)
 	$(LINK) $(3dsdump_OBJECTS) $(3dsdump_LDADD) $(LIBS)
+3ds2m$(EXEEXT): $(3ds2m_OBJECTS) $(3ds2m_DEPENDENCIES) 
+	@rm -f 3ds2m$(EXEEXT)
+	$(LINK) $(3ds2m_OBJECTS) $(3ds2m_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -265,6 +272,7 @@
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3dsdump.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/3ds2m.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<

lib3ds-1.2.0-pkgconfig.diff:

--- NEW FILE lib3ds-1.2.0-pkgconfig.diff ---
diff -uNr lib3ds-1.2.0.orig/lib3ds-config.in lib3ds-1.2.0/lib3ds-config.in
--- lib3ds-1.2.0.orig/lib3ds-config.in	2000-05-23 14:13:08.000000000 +0200
+++ lib3ds-1.2.0/lib3ds-config.in	2007-10-21 06:37:48.000000000 +0200
@@ -1,9 +1,5 @@
 #!/bin/sh
 
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-
 usage()
 {
     cat <<EOF
@@ -22,6 +18,8 @@
 	usage 1 1>&2
 fi
 
+PKG_CONFIG_ARGS=
+
 while test $# -gt 0; do
   case "$1" in
   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
@@ -30,23 +28,23 @@
 
   case $1 in
     --prefix=*)
-      prefix=$optarg
+      PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=prefix=$optarg"
       if test $exec_prefix_set = no ; then
-        exec_prefix=$optarg
+        PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=exec_prefix=$optarg"
       fi
       ;;
     --prefix)
       echo_prefix=yes
       ;;
     --exec-prefix=*)
-      exec_prefix=$optarg
+      PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=exec_prefix=$optarg"
       exec_prefix_set=yes
       ;;
     --exec-prefix)
       echo_exec_prefix=yes
       ;;
     --version)
-      echo @LIB3DS_VERSION@
+      pkg-config --modversion lib3ds
       ;;
     --cflags)
       echo_cflags=yes
@@ -62,23 +60,18 @@
 done
 
 if test "$echo_prefix" = "yes"; then
-	echo $prefix
+  pkg-config $PKG_CONFIG_ARGS --variable=prefix lib3ds
 fi
 
 if test "$echo_exec_prefix" = "yes"; then
-	echo $exec_prefix
+  pkg-config $PKG_CONFIG_ARGS --variable=exec_prefix lib3ds
 fi
 
 if test "$echo_cflags" = "yes"; then
-      if test @includedir@ != /usr/include ; then
-            echo -I at includedir@
-      fi
+  pkg-config $PKG_CONFIG_ARGS --cflags lib3ds
 fi
 
 if test "$echo_libs" = "yes"; then
-      if test @libdir@ != /usr/lib ; then
-            my_linker_flags="-L at libdir@"
-      fi
-      echo ${my_linker_flags} -l3ds
-fi      
+  pkg-config $PKG_CONFIG_ARGS --libs lib3ds
+fi
 
diff -uNr lib3ds-1.2.0.orig/lib3ds.pc.in lib3ds-1.2.0/lib3ds.pc.in
--- lib3ds-1.2.0.orig/lib3ds.pc.in	1970-01-01 01:00:00.000000000 +0100
+++ lib3ds-1.2.0/lib3ds.pc.in	2007-10-21 06:23:53.000000000 +0200
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: lib3ds
+Description: lib3ds
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -l3ds -lm
+Cflags: -I${includedir}




More information about the fedora-extras-commits mailing list