commit 6e122c4b2ea24fcc50d001162e5f04e6c8850dba Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:52:11 2019 -0400 Package init diff --git a/gsm-1.0.18.tar.gz b/gsm-1.0.18.tar.gz new file mode 100644 index 0000000..bd029ec Binary files /dev/null and b/gsm-1.0.18.tar.gz differ diff --git a/gsm-makefile.patch b/gsm-makefile.patch new file mode 100644 index 0000000..b5b0797 --- /dev/null +++ b/gsm-makefile.patch @@ -0,0 +1,185 @@ +diff -up gsm-1.0-pl17/Makefile.mk gsm-1.0-pl17/Makefile +--- gsm-1.0-pl17/Makefile.mk 2017-06-28 02:24:24.000000000 +0200 ++++ gsm-1.0-pl17/Makefile 2017-06-29 13:18:44.138719902 +0200 +@@ -44,13 +44,17 @@ WAV49 = -DWAV49 + # CCFLAGS = -c -O + + CC = gcc -ansi -pedantic +-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment ++CCFLAGS = -c $(RPM_OPT_FLAGS) -DNeedFunctionPrototypes=1 -Wall -Wno-comment -D_XOPEN_SOURCE=700 -D_REENTRANT -fPIC + + LD = $(CC) + + # LD = gcc + # LDFLAGS = + ++SO_MAJOR = 1 ++SO_MINOR = 0 ++SO_MICRO = 18 ++SO_VER = $(SO_MAJOR).$(SO_MINOR).$(SO_MICRO) + + # If your compiler needs additional flags/libraries, regardless of + # the source compiled, configure them here. +@@ -81,7 +85,7 @@ INSTALL_ROOT = + GSM_INSTALL_ROOT = $(INSTALL_ROOT) + GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib + GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc +-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3 ++GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3 + + + # Where do you want to install the toast binaries and their manpage? +@@ -91,16 +95,16 @@ GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/ma + + TOAST_INSTALL_ROOT = $(INSTALL_ROOT) + TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin +-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1 ++TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1 + + # Other tools + + SHELL = /bin/sh +-LN = ln ++LN = ln -s + BASENAME = basename + AR = ar + ARFLAGS = cr +-RMFLAGS = ++RMFLAGS = -f + FIND = find + COMPRESS = compress + COMPRESSFLAGS = +@@ -140,6 +144,7 @@ LFLAGS = $(LDFLAGS) $(LDINC) + # Targets + + LIBGSM = $(LIB)/libgsm.a ++LIBGSMSO = $(LIB)/libgsm.so + + TOAST = $(BIN)/toast + UNTOAST = $(BIN)/untoast +@@ -257,7 +262,9 @@ STUFF = ChangeLog \ + # Install targets + + GSM_INSTALL_TARGETS = \ +- $(GSM_INSTALL_LIB)/libgsm.a \ ++ $(GSM_INSTALL_LIB)/libgsm.so.$(SO_VER) \ ++ $(GSM_INSTALL_LIB)/libgsm.so.$(SO_MAJOR)\ ++ $(GSM_INSTALL_LIB)/libgsm.so \ + $(GSM_INSTALL_INC)/gsm.h \ + $(GSM_INSTALL_MAN)/gsm.3 \ + $(GSM_INSTALL_MAN)/gsm_explode.3 \ +@@ -279,7 +286,7 @@ TOAST_INSTALL_TARGETS = \ + + # Target rules + +-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) ++all: $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST) + @-echo $(ROOT): Done. + + tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result +@@ -299,24 +306,32 @@ install: toastinstall gsminstall + + # The basic API: libgsm + ++$(LIBGSMSO).$(SO_VER): $(LIB) $(GSM_OBJECTS) ++ $(LD) $(LFLAGS) -o $@ -shared -Xlinker -soname -Xlinker libgsm.so.$(SO_MAJOR) $(GSM_OBJECTS) -lc ++ ++$(LIBGSMSO).$(SO_MAJOR): $(LIBGSMSO).$(SO_VER) ++ ln -fs libgsm.so.$(SO_VER) lib/libgsm.so.$(SO_MAJOR) ++ ++$(LIBGSMSO): $(LIBGSMSO).$(SO_VER) ++ ln -fs libgsm.so.$(SO_VER) lib/libgsm.so ++ + $(LIBGSM): $(LIB) $(GSM_OBJECTS) + -rm $(RMFLAGS) $(LIBGSM) + $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) + $(RANLIB) $(LIBGSM) + +- + # Toast, Untoast and Tcat -- the compress-like frontends to gsm. + +-$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) +- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) ++$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSMSO) ++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB) + + $(UNTOAST): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(UNTOAST) +- $(LN) $(TOAST) $(UNTOAST) ++ $(LN) toast $(UNTOAST) + + $(TCAT): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(TCAT) +- $(LN) $(TOAST) $(TCAT) ++ $(LN) toast $(TCAT) + + + # The local bin and lib directories +@@ -352,8 +367,7 @@ toastuninstall: + + $(TOAST_INSTALL_BIN)/toast: $(TOAST) + -rm $@ +- cp $(TOAST) $@ +- chmod 755 $@ ++ install -pm755 $(TOAST) $@ + + $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast + -rm $@ +@@ -365,39 +379,43 @@ $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTA + + $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1 + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3 + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3 + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3 + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3 + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + + $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) + -rm $@ +- cp $? $@ +- chmod 444 $@ ++ install -pm644 $? $@ + ++$(GSM_INSTALL_LIB)/libgsm.so.$(SO_VER): $(LIBGSMSO).$(SO_VER) ++ -rm $@ ++ install -pm755 $? $@ ++ ++$(GSM_INSTALL_LIB)/libgsm.so.$(SO_MAJOR): $(LIBGSMSO).$(SO_MAJOR) ++ -rm $@ ++ ln -s libgsm.so.$(SO_VER) $@ ++ ++$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSMSO) ++ -rm $@ ++ ln -s libgsm.so.$(SO_VER) $@ + + # Distribution + diff --git a/gsm-warnings.patch b/gsm-warnings.patch new file mode 100644 index 0000000..6399279 --- /dev/null +++ b/gsm-warnings.patch @@ -0,0 +1,13 @@ +diff -up gsm-1.0-pl17/src/toast.c.warn gsm-1.0-pl17/src/toast.c +--- gsm-1.0-pl17/src/toast.c.warn 2017-06-28 02:09:38.000000000 +0200 ++++ gsm-1.0-pl17/src/toast.c 2017-06-29 11:44:43.979453734 +0200 +@@ -6,6 +6,9 @@ + + /* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast.c,v 1.8 1996/07/02 10:41:04 jutta Exp $ */ + ++#include ++#include ++#include + #include "toast.h" + + /* toast -- lossy sound compression using the gsm library. diff --git a/gsm.spec b/gsm.spec new file mode 100644 index 0000000..b23d01e --- /dev/null +++ b/gsm.spec @@ -0,0 +1,76 @@ +Name: gsm +Version: 1.0.18 +Release: 4 +Summary: GSM speech compressor Shared libraries and Utilities +License: MIT +URL: http://www.quut.com/gsm/ +Source0: http://www.quut.com/gsm/%{name}-%{version}.tar.gz + +# below patches are from redhat. +Patch0: gsm-makefile.patch +Patch1: gsm-warnings.patch + +Provides: gsm-tool +Obsoletes: gsm-tool + +%description +Contains the library for a GSM speech compressor, libgsm implements the European +GSM 06.10 provisional standard for full-rate speech transcoding, prI-ETS 300 036, +which uses RPE/LTP (residual pulse excitation/long term prediction) coding at 13 kbit/s. +GSM 06.10 compresses frames of 162 13-bit samples (8 kHz sampling rate) into 260 bits. + +%package devel +Summary: Development files for gsm +Requires: %{name}%{_isa} = %{version}-%{release} +%description devel +Contains header files and development libraries for libgsm. + +%package help +Summary: Help files for gsm +%description help +Contains documents and manuals files for gsm + +%prep +%autosetup -n %{name}-1.0-pl18 -p1 + + +%build +make LDFLAGS="%{?__global_ldflags}" %{?_smp_mflags} all + +%install +install -d %{buildroot}{%{_bindir},%{_includedir}/gsm,%{_libdir},%{_mandir}/{man1,man3}} + +make install INSTALL_ROOT=%{buildroot}%{_prefix} GSM_INSTALL_INC=%{buildroot}%{_includedir}/gsm \ + GSM_INSTALL_LIB=%{buildroot}%{_libdir} + +ln -s gsm/gsm.h %{buildroot}%{_includedir} + +echo ".so toast.1" > %{buildroot}%{_mandir}/man1/tcat.1 +echo ".so toast.1" > %{buildroot}%{_mandir}/man1/untoast.1 + +%check +[ -f %{buildroot}%{_libdir}/libgsm.so.%{version} ] +export LDFLAGS="%{?__global_ldflags}" +make addtst + +%ldconfig_post +%ldconfig_postun + +%files +%license COPYRIGHT +%{_libdir}/libgsm.so.* +%{_bindir}/tcat +%{_bindir}/*oast + +%files devel +%dir %{_includedir}/gsm +%{_includedir}/* +%{_libdir}/libgsm.so + +%files help +%doc ChangeLog MACHINES README +%{_mandir}/man*/* + +%changelog +* Wed Sep 18 2019 chenzhenyu - 1.0.8-4 +- Package init