[packages/dumb] - added shared patch, build shared libraries - separated allegro libraries to -allegro* subpackages

qboosh qboosh at pld-linux.org
Mon Apr 1 09:18:51 CEST 2013


commit 5ad428f3b6e30596cc2adc08ba2f91ccf800d21d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Apr 1 09:18:43 2013 +0200

    - added shared patch, build shared libraries
    - separated allegro libraries to -allegro* subpackages
    - updated descriptions (official name changed with 0.9.2 release)
    - release 5

 dumb-shared.patch | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 dumb.spec         | 149 ++++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 266 insertions(+), 31 deletions(-)
---
diff --git a/dumb.spec b/dumb.spec
index 011a9d1..2806f5a 100644
--- a/dumb.spec
+++ b/dumb.spec
@@ -1,62 +1,108 @@
-# TODO
-# - build shared lib
-# - do we need debug version of libraires/headers?
-Summary:	DUMB - Dedicated Universal Music Bastardisation
-Summary(pl.UTF-8):	DUMB - Dedicated Universal Music Bastardisation
+# TODO: don't build debug version of libraries when not packaging them
+#
+# Conditional build:
+%bcond_without	allegro		# Allegro libraries
+%bcond_without	debug_libs	# debug libraries packaging (they are built anyway)
+#
+Summary:	DUMB - Dynamic Universal Music Bibliotheque
+Summary(pl.UTF-8):	DUMB - uniwersalna biblioteka do odtwarzania muzyki
 Name:		dumb
 Version:	0.9.3
-Release:	4
+Release:	5
 License:	GPL-like
 Group:		Development/Libraries
-Source0:	http://dl.sourceforge.net/dumb/%{name}-%{version}.tar.gz
+Source0:	http://downloads.sourceforge.net/dumb/%{name}-%{version}.tar.gz
 # Source0-md5:	f48da5b990aa8aa822d3b6a951baf5c2
+Patch0:		%{name}-shared.patch
 URL:		http://dumb.sourceforge.net/
-BuildRequires:	allegro-devel
+%{?with_allegro:BuildRequires:	allegro-devel}
+BuildRequires:	libtool
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		specflags_ia32		-fomit-frame-pointer
-%define		specflags_x86_64	-fPIC
 
 %description
-DUMB - Dedicated Universal Music Bastardisation library.
+DUMB (Dynamic Universal Music Bibliotheque, formerly Dedicated
+Universal Music Bastardisation) - IT, XM, S3M and MOD player library.
 
 %description -l pl.UTF-8
-Biblioteka DUMB - Dedicated Universal Music Bastardisation.
+DUMB (Dynamic Universal Music Bibliotheque, dawniej Dedicated
+Universal Music Bastardisation) - biblioteka do odtwarzania muzyki w
+formatach IT, XM, S3M i MOD.
 
 %package devel
-Summary:	Header files for dumb
-Summary(pl.UTF-8):	Pliki nagłówkowe dla dumb
+Summary:	Header files for DUMB library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki DUMB
 Group:		Development/Libraries
-Requires:	%{name}-static = %{version}-%{release}
-# for libaldmb
-#Requires:	allegro-devel
+Requires:	%{name} = %{version}-%{release}
 
 %description devel
-dumb header files.
+Header files for DUMB library.
 
 %description devel -l pl.UTF-8
-Pliki nagłówkowe dla dumb.
+Pliki nagłówkowe biblioteki DUMB.
 
 %package static
-Summary:	Static libraries for dumb
-Summary(pl.UTF-8):	Statyczne biblioteki dla dumb
+Summary:	Static DUMB libraries
+Summary(pl.UTF-8):	Statyczne biblioteki DUMB
 Group:		Development/Libraries
 Requires:	%{name}-devel = %{version}-%{release}
 
 %description static
-dumb static libraries.
+Static DUMB libraries.
 
 %description static -l pl.UTF-8
-Biblioteki statyczne dla dumb.
+Statyczne biblioteki DUMB.
+
+%package allegro
+Summary:	DUMB Allegro library
+Summary(pl.UTF-8):	Biblioteka DUMB dla Allegro
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description allegro
+DUMB Allegro library.
+
+%description allegro -l pl.UTF-8
+Biblioteka DUMB dla Allegro.
+
+%package allegro-devel
+Summary:	Header files for DUMB Allegro library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki DUMB dla Allegro
+Group:		Development/Libraries
+Requires:	%{name}-allegro = %{version}-%{release}
+Requires:	%{name}-devel = %{version}-%{release}
+Requires:	allegro-devel
+
+%description allegro-devel
+Header files for DUMB Allegro library.
+
+%description allegro-devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki DUMB dla Allegro.
+
+%package allegro-static
+Summary:	Static DUMB Allegro libraries
+Summary(pl.UTF-8):	Statyczne biblioteki DUMB dla Allegro
+Group:		Development/Libraries
+Requires:	%{name}-allegro-devel = %{version}-%{release}
+
+%description allegro-static
+Static DUMB Allegro libraries.
+
+%description allegro-static -l pl.UTF-8
+Statyczne biblioteki DUMB dla Allegro.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 cat <<EOF > make/config.txt
 include make/unix.inc
 ALL_TARGETS := core core-examples core-headers
+%if %{with allegro}
 ALL_TARGETS += allegro allegro-examples allegro-headers
+%endif
 PREFIX := /usr
 EOF
 
@@ -64,7 +110,8 @@ EOF
 	CC="%{__cc}" \
 	LDFLAGS="%{rpmldflags}" \
 	OFLAGS="%{rpmcflags}" \
-	DBGFLAGS="-DDEBUGMODE=1 %{rpmcflags}"
+	DBGFLAGS="-DDEBUGMODE=1 %{rpmcflags}" \
+	LIB_INSTALL_PATH=%{_libdir}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -74,27 +121,67 @@ install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
 	PREFIX=$RPM_BUILD_ROOT%{_prefix} \
 	LIB_INSTALL_PATH=$RPM_BUILD_ROOT%{_libdir}
 
-%{__make} install \
-	DEBUGMODE=1 \
-	PREFIX=$RPM_BUILD_ROOT%{_prefix} \
-	LIB_INSTALL_PATH=$RPM_BUILD_ROOT%{_libdir}
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%post	allegro -p /sbin/ldconfig
+%postun	allegro -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc *.txt docs/*
-%attr(755,root,root) %{_bindir}/dumb*
+%doc *.txt docs/*.txt
+%attr(755,root,root) %{_bindir}/dumb2wav
+%attr(755,root,root) %{_bindir}/dumbout
+%attr(755,root,root) %{_libdir}/libdumb.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libdumb.so.0
+%if %{with debug_libs}
+%attr(755,root,root) %{_libdir}/libdumbd.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libdumbd.so.0
+%endif
 
 %files devel
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libdumb.so
+%{_libdir}/libdumb.la
+%if %{with debug_libs}
+%attr(755,root,root) %{_libdir}/libdumbd.so
+%{_libdir}/libdumbd.la
+%endif
 %{_includedir}/dumb.h
-%{_includedir}/aldumb.h
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libdumb.a
+%if %{with debug_libs}
 %{_libdir}/libdumbd.a
+%endif
+
+%files allegro
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/dumbplay
+%attr(755,root,root) %{_libdir}/libaldmb.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libaldmb.so.0
+%if %{with debug_libs}
+%attr(755,root,root) %{_libdir}/libaldmd.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libaldmd.so.0
+%endif
+
+%files allegro-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libaldmb.so
+%{_libdir}/libaldmb.la
+%if %{with debug_libs}
+%attr(755,root,root) %{_libdir}/libaldmd.so
+%{_libdir}/libaldmd.la
+%endif
+%{_includedir}/aldumb.h
+
+%files allegro-static
+%defattr(644,root,root,755)
 %{_libdir}/libaldmb.a
+%if %{with debug_libs}
 %{_libdir}/libaldmd.a
+%endif
diff --git a/dumb-shared.patch b/dumb-shared.patch
new file mode 100644
index 0000000..d728b81
--- /dev/null
+++ b/dumb-shared.patch
@@ -0,0 +1,148 @@
+--- dumb-0.9.3/make/unix.inc.orig	2005-08-08 02:18:40.000000000 +0200
++++ dumb-0.9.3/make/unix.inc	2013-03-31 22:26:03.606001233 +0200
+@@ -11,6 +11,10 @@ FIX = $(1)
+ ECHO = @echo $(1)
+ DELETE = rm -f $(1)
+ COPY = cp $(1) $(2)
++LIBTOOL = libtool
++COPY_BIN = $(LIBTOOL) --mode=install install $(1) $(2)
++LIBTOOL_LINK = $(LIBTOOL) --mode=link --tag=CC
++LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile --tag=CC
+ MKDIR = mkdir $(1)
+ 
+ EXE_SUFFIX :=
+--- dumb-0.9.3/make/Makefile.inc.orig	2005-08-08 02:18:40.000000000 +0200
++++ dumb-0.9.3/make/Makefile.inc	2013-03-31 22:31:29.732661102 +0200
+@@ -2,8 +2,8 @@
+ # twice with different values for CFLAGS and OBJDIR, so the optimised and
+ # debugging libraries are both built.
+ 
+-CORE_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(CORE_MODULES))))
+-ALLEGRO_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_MODULES))))
++CORE_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.lo, $(CORE_MODULES))))
++ALLEGRO_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.lo, $(ALLEGRO_MODULES))))
+ 
+ 
+ # Pass the current value of CFLAGS through to the commands. Or, more
+@@ -14,26 +14,26 @@ $(CORE_LIB_FILE): CFLAGS := $(CFLAGS)
+ $(ALLEGRO_LIB_FILE): CFLAGS := $(CFLAGS)
+ 
+ 
+-$(OBJDIR)/%.o: src/core/%.c include/dumb.h include/internal/dumb.h
+-	$(CC) $(CFLAGS) -c -o $@ $<
++$(OBJDIR)/%.lo: src/core/%.c include/dumb.h include/internal/dumb.h
++	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -c -o $@ $<
+ 
+-$(OBJDIR)/%.o: src/helpers/%.c include/dumb.h
+-	$(CC) $(CFLAGS) -c -o $@ $<
++$(OBJDIR)/%.lo: src/helpers/%.c include/dumb.h
++	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -c -o $@ $<
+ 
+-$(OBJDIR)/resample.o: src/helpers/resample.inc src/helpers/resamp2.inc src/helpers/resamp3.inc
++$(OBJDIR)/resample.lo: src/helpers/resample.inc src/helpers/resamp2.inc src/helpers/resamp3.inc
+ 
+-$(OBJDIR)/%.o: src/it/%.c include/dumb.h include/internal/it.h
+-	$(CC) $(CFLAGS) -c -o $@ $<
++$(OBJDIR)/%.lo: src/it/%.c include/dumb.h include/internal/it.h
++	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -c -o $@ $<
+ 
+-$(OBJDIR)/%.o: src/sigtypes/%.c include/dumb.h
+-	$(CC) $(CFLAGS) -c -o $@ $<
++$(OBJDIR)/%.lo: src/sigtypes/%.c include/dumb.h
++	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) -c -o $@ $<
+ 
+-$(OBJDIR)/%.o: src/allegro/%.c include/aldumb.h include/dumb.h \
++$(OBJDIR)/%.lo: src/allegro/%.c include/aldumb.h include/dumb.h \
+                       include/internal/aldumb.h include/internal/dumb.h
+-	$(CC) $(CFLAGS) $(WFLAGS_ALLEGRO) -c -o $@ $<
++	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(WFLAGS_ALLEGRO) -c -o $@ $<
+ 
+ $(CORE_LIB_FILE): $(CORE_OBJECTS)
+-	$(AR) rs $@ $^
++	$(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LINK_MATH) -rpath $(LIB_INSTALL_PATH)
+ 
+ $(ALLEGRO_LIB_FILE): $(ALLEGRO_OBJECTS)
+-	$(AR) rs $@ $^
++	$(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(CORE_LIB_FILE) $(LINK_ALLEGRO) -rpath $(LIB_INSTALL_PATH)
+--- dumb-0.9.3/Makefile.orig	2005-08-08 02:18:41.000000000 +0200
++++ dumb-0.9.3/Makefile	2013-03-31 22:26:27.906000727 +0200
+@@ -22,7 +22,7 @@
+ #                    (Note that this is unable to delete the dumbask
+ #                    executable if the configuration is absent.)
+ 
+-MAKEFILE = Makefile.rdy
++MAKEFILE = Makefile
+ 
+ .PHONY: all install uninstall clean veryclean distclean config config-if-necessary make-outdirs
+ 
+@@ -244,11 +244,11 @@ CORE_EXAMPLES_EXE := $(addprefix example
+ ALLEGRO_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(ALLEGRO_EXAMPLES))))
+ 
+ 
+-CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.a
+-ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.a
++CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.la
++ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.la
+ 
+-CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.a
+-ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.a
++CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.la
++ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.la
+ 
+ 
+ core: $(CORE_LIB_FILE_RELEASE) $(CORE_LIB_FILE_DEBUG)
+@@ -262,19 +262,19 @@ core-headers:
+ allegro-headers:
+ 
+ install-core: core
+-	$(call COPY,$(CORE_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
+-	$(call COPY,$(CORE_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
++	$(call COPY_BIN,$(CORE_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
++	$(call COPY_BIN,$(CORE_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
+ 
+ install-allegro: allegro
+-	$(call COPY,$(ALLEGRO_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
+-	$(call COPY,$(ALLEGRO_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
++	$(call COPY_BIN,$(ALLEGRO_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
++	$(call COPY_BIN,$(ALLEGRO_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
+ 
+ ifeq "$(COMSPEC)" ""
+ install-core-examples: core-examples
+-	$(call COPY,$(CORE_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
++	$(call COPY_BIN,$(CORE_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
+ 
+ install-allegro-examples: allegro-examples
+-	$(call COPY,$(ALLEGRO_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
++	$(call COPY_BIN,$(ALLEGRO_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
+ else
+ # Don't install the examples on a Windows system.
+ install-core-examples:
+@@ -317,22 +317,22 @@
+ 
+ OBJDIR := $(OBJDIR_BASE)/release
+ CFLAGS := $(CFLAGS_RELEASE)
+-CORE_LIB_FILE := $(LIBDIR)/libdumb.a
+-ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.a
++CORE_LIB_FILE := $(LIBDIR)/libdumb.la
++ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.la
+ include make/Makefile.inc
+ 
+ OBJDIR := $(OBJDIR_BASE)/debug
+ CFLAGS := $(CFLAGS_DEBUG)
+-CORE_LIB_FILE := $(LIBDIR)/libdumbd.a
+-ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.a
++CORE_LIB_FILE := $(LIBDIR)/libdumbd.la
++ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.la
+ include make/Makefile.inc
+ 
+ 
+ $(CORE_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(CORE_LIB_FILE_RELEASE)
+-	$(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH)
++	$(LIBTOOL_LINK) $(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH)
+ 
+ $(ALLEGRO_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(ALLEGRO_LIB_FILE_RELEASE) $(CORE_LIB_FILE_RELEASE)
+-	$(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO)
++	$(LIBTOOL_LINK) $(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO) $(LINK_MATH)
+ 
+ $(CORE_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h
+ 	$(CC) $(CFLAGS_RELEASE) -c $< -o $@
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dumb.git/commitdiff/5ad428f3b6e30596cc2adc08ba2f91ccf800d21d



More information about the pld-cvs-commit mailing list