From 318d2f96769e3edc573fd868c4a0ca9e11dfe71a Mon Sep 17 00:00:00 2001 From: corsepiu Date: Nov 03 2007 07:27:39 +0000 Subject: - Cleanup spec. - Add post/postun. - Re-add 3ds2m for fedora < 9. - Abandon *-static for fedora >= 9. --- diff --git a/.cvsignore b/.cvsignore index 31ed462..dbd6a9b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1 @@ -lib3ds-1.2.0.tar.gz -lib3ds-cvs-20060105.diff +lib3ds-1.3.0.zip diff --git a/lib3ds-1.2.0-pkgconfig.diff b/lib3ds-1.2.0-pkgconfig.diff new file mode 100644 index 0000000..41f658e --- /dev/null +++ b/lib3ds-1.2.0-pkgconfig.diff @@ -0,0 +1,94 @@ +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 <&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@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@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} diff --git a/lib3ds-1.3.0-3ds2m.diff b/lib3ds-1.3.0-3ds2m.diff new file mode 100644 index 0000000..4578a70 --- /dev/null +++ b/lib3ds-1.3.0-3ds2m.diff @@ -0,0 +1,337 @@ +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 ++Write output to instead of stdout ++.TP 8 ++.B -m/--mesh name ++Write only specific mesh.B -c/--camera ++.SH COPYRIGHT ++3ds2m Copyright \(co 1996-2001 by J.E. Hoffmann ++.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 ++ * 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: lib3ds-1.3.0-3ds2m.diff,v 1.1 2007/11/03 07:27:39 corsepiu Exp $ ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#ifdef WITH_DMALLOC ++#include ++#endif ++ ++ ++/*! ++\example 3ds2m.c ++ ++Converts meshes of a 3DS 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 ++# ++# ++# ++Vertex ++... ++Face ... ++\endcode ++ ++\author J.E. Hoffmann ++*/ ++ ++ ++static void ++help() ++{ ++ fprintf(stderr, ++"The 3D Studio File Format Library - 3ds2m Version " VERSION "\n" ++"Copyright (C) 1996-2001 by J.E. Hoffmann \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)) { ++ 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; ipoints; ++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; ifaces; ++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@./$(DEPDIR)/3dsdump.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3ds2m.Po@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/lib3ds.spec b/lib3ds.spec index 565f4b0..de66534 100644 --- a/lib3ds.spec +++ b/lib3ds.spec @@ -1,15 +1,16 @@ Name: lib3ds -Version: 1.2.0 -Release: 12%{?dist} +Version: 1.3.0 +Release: 1%{?dist} Summary: 3D Studio file format library Group: System Environment/Libraries License: LGPLv2+ URL: http://lib3ds.sourceforge.net -Source: http://downloads.sourceforge.net/lib3ds/lib3ds-%{version}.tar.gz -Patch0: lib3ds-1.2.0.diff -Patch1: lib3ds-cvs-20060105.diff +Source: http://downloads.sourceforge.net/lib3ds/lib3ds-%{version}.zip +Patch2: lib3ds-1.2.0-pkgconfig.diff +Patch3: lib3ds-1.3.0-3ds2m.diff + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -35,44 +36,108 @@ Some tools to process 3ds files. %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README %{_bindir}/3dsdump -%{_bindir}/3ds2m %{_mandir}/man1/3dsdump.1* +%if "%{?fedora}" < "9" +%{_bindir}/3ds2m %{_mandir}/man1/3ds2m.1* +%endif %package devel Summary: %summary Group: Development/Libraries -Provides: lib3ds-static = %{version}-%{release} +Requires: pkgconfig +Requires: lib3ds = %{version}-%{release} %description devel Development files for lib3ds +%if "%{?fedora}" < "9" +%package static +Summary: %summary +Group: Development/Libraries +Requires: lib3ds-devel = %{version}-%{release} + +%description static +Static development files for lib3ds +%endif + %prep %setup -q -%patch -p1 -P 0 -%patch -p2 -P 1 +%patch -p1 -P 2 + +%if "%{?fedora}" < "9" +%patch -p1 -P 3 +%endif %build -%configure +%configure \ +%if "%{?fedora}" >= "9" + --disable-static +%endif + make %{?_smp_mflags} +sed -e 's,@prefix@,%{_prefix},' \ + -e 's,@exec_prefix@,%{_exec_prefix},' \ + -e 's,@libdir@,%{_libdir},' \ + -e 's,@includedir@,%{_includedir},' \ + -e 's,@VERSION@,%{version},' \ + lib3ds.pc.in > lib3ds.pc + %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT +install -d ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig +install lib3ds.pc -m 0644 ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig + +## Remove libtool archive +rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la + + %clean rm -rf $RPM_BUILD_ROOT -%files devel +%files %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog README -%{_bindir}/lib3ds-config +%{_libdir}/*.so.* + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%if "%{?fedora}" < "9" +%files static %{_libdir}/*.a +%endif + + +%files devel +%defattr(-,root,root,-) +%{_bindir}/lib3ds-config +%{_libdir}/*.so +%{_libdir}/pkgconfig/lib3ds.pc %{_mandir}/man1/lib3ds-config.1* %{_includedir}/lib3ds %{_datadir}/aclocal/* %changelog +* Sat Nov 03 2007 Ralf Corsépius - 1.3.0-1 +- Cleanup spec. +- Add post/postun. +- Re-add 3ds2m for fedora < 9. +- Abandon *-static for fedora >= 9. + +* Fri Nov 02 2007 Xavier Lamien - 1.3.0 +- Updated Release. + +* Sun Oct 21 2007 Ralf Corsépius - 1.2.0-13 +- Address BZ 341851: + - Add lib3ds.pc. + - Rework lib3ds-config to using lib3ds.pc. + - Add lib3ds-1.2.0-pkgconfig.diff + * Sat Oct 20 2007 Ralf Corsépius - 1.2.0-12 - Change Source: to using downloads.sourceforge.net. diff --git a/sources b/sources index 2c00843..b16ffd6 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -3a7f891d18af0151876b98bc05d3b373 lib3ds-1.2.0.tar.gz -f337a875d264c2e938d762ca82491451 lib3ds-cvs-20060105.diff +2572f7b0f29b591d494c1a0658b35c86 lib3ds-1.3.0.zip