diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c8745f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +adplug-2.1.tar.bz2 +adplugdb-2006-07-07.tar.gz +/adplug-2.2.1.tar.gz +/adplug-2.2.1.tar.bz2 diff --git a/Makefile b/Makefile deleted file mode 100644 index 8972c36..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: adplug -# $Id$ -NAME := adplug -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/adplug-2.2.1-inline.patch b/adplug-2.2.1-inline.patch new file mode 100644 index 0000000..aaf142b --- /dev/null +++ b/adplug-2.2.1-inline.patch @@ -0,0 +1,17 @@ +Patch by Robert Scheck for adplug >= 2.2.1, which +works around undefined reference linking error when using GCC >= 9.1 (while +it works with GCC 9.0.x and older): + +/usr/bin/ld: ../src/.libs/libadplug.so: undefined reference to `OPL_CALC_RH' + +--- adplug-2.2.1/src/fmopl.c 2003-11-03 16:41:33.000000000 +0100 ++++ adplug-2.2.1/src/fmopl.c.inline 2019-07-31 19:57:40.925132660 +0200 +@@ -31,7 +31,7 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#define INLINE __inline ++#define INLINE + #define HAS_YM3812 1 + + #include diff --git a/adplug-2.2.1-signed-char.patch b/adplug-2.2.1-signed-char.patch new file mode 100644 index 0000000..ec3baf0 --- /dev/null +++ b/adplug-2.2.1-signed-char.patch @@ -0,0 +1,24 @@ +diff -ur adplug-2.2.1-orig/src/s3m.cpp adplug-2.2.1/src/s3m.cpp +--- adplug-2.2.1-orig/src/s3m.cpp 2016-06-12 17:19:33.369934280 +0200 ++++ adplug-2.2.1/src/s3m.cpp 2016-06-12 17:32:36.190932642 +0200 +@@ -25,7 +25,7 @@ + #include + #include "s3m.h" + +-const char Cs3mPlayer::chnresolv[] = // S3M -> adlib channel conversion ++const signed char Cs3mPlayer::chnresolv[] = // S3M -> adlib channel conversion + {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1}; + + const unsigned short Cs3mPlayer::notetable[12] = // S3M adlib note table +diff -ur adplug-2.2.1-orig/src/s3m.h adplug-2.2.1/src/s3m.h +--- adplug-2.2.1-orig/src/s3m.h 2016-06-12 17:19:33.367934293 +0200 ++++ adplug-2.2.1/src/s3m.h 2016-06-12 17:37:14.538154102 +0200 +@@ -90,7 +90,7 @@ + unsigned char crow,ord,speed,tempo,del,songend,loopstart,loopcnt; + + private: +- static const char chnresolv[]; ++ static const signed char chnresolv[]; + static const unsigned short notetable[12]; + static const unsigned char vibratotab[32]; + diff --git a/adplug-2.3.1-cve-2018-17825.patch b/adplug-2.3.1-cve-2018-17825.patch new file mode 100644 index 0000000..bbf7701 --- /dev/null +++ b/adplug-2.3.1-cve-2018-17825.patch @@ -0,0 +1,25 @@ +From 19ebb61bf92262dc1868de10ba5a211db249ce76 Mon Sep 17 00:00:00 2001 +From: Stas'M +Date: Thu, 4 Oct 2018 00:18:32 +0300 +Subject: [PATCH] FMOPL: Avoid double-free by checking OPL pointer (fix #67) + +Fixes CVE-2018-17825. +--- + src/fmopl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/fmopl.c b/src/fmopl.c +index 0cd1d69..1c4485e 100644 +--- a/src/fmopl.c ++++ b/src/fmopl.c +@@ -1269,6 +1269,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) + /* ---------- Destroy one of vietual YM3812 ---------- */ + void OPLDestroy(FM_OPL *OPL) + { ++ if(!OPL) ++ { ++ return; ++ } + #ifdef OPL_OUTPUT_LOG + if(opl_dbg_fp) + { diff --git a/adplug.spec b/adplug.spec new file mode 100644 index 0000000..9ca0712 --- /dev/null +++ b/adplug.spec @@ -0,0 +1,238 @@ +# SPEC file for AdPlug, primary target is the Fedora Extras +# RPM repository. + +%define adplugdbver 2006-07-07 +Name: adplug +Version: 2.2.1 +Release: 10%{?dist} +Summary: A software library for AdLib (OPL2) emulation +URL: http://adplug.github.io/ +Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 +Source1: http://download.sourceforge.net/%{name}/adplugdb-%{adplugdbver}.tar.gz +Patch0: adplug-2.2.1-signed-char.patch +Patch1: adplug-2.3.1-cve-2018-17825.patch +Patch2: adplug-2.2.1-inline.patch +License: LGPLv2+ +BuildRequires: gcc-c++ +BuildRequires: libbinio-devel >= 1.4 +BuildRequires: pkgconfig +BuildRequires: texinfo +BuildRequires: libtool +BuildRequires: autoconf +BuildRequires: automake +# This is to resolve the endless disputes of the shared data for this +# package. Whenever _sharedstatedir contains something acceptable to +# Fedora that can be used instead. +%define shareddata %{_localstatedir}/lib + +%description +AdPlug is a free software, cross-platform, hardware independent AdLib +sound player library, mainly written in C++ and released under the +LGPL. AdPlug plays sound data, originally created for the AdLib (OPL2) +audio board, directly from its original format on top of an OPL2 +emulator or by using the real hardware. No OPL chip is required for +playback. It supports various audio formats from MS-DOS AdLib trackers. + +%package devel +Summary: Development files for AdPlug +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: libbinio-devel + +%description devel +This package contains development files for the AdPlug AdLib +(OPL2) emulator. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +tar xvfz %{SOURCE1} +# Include these by different name +mv %{adplugdbver}/README README.adplugdb +mv %{adplugdbver}/NEWS NEWS.adplugdb + +%build +rm -f ltmain.sh config.guess config.sub +libtoolize --copy --force || fail +rm -f aclocal.m4 +aclocal $ACLOCAL_FLAGS || fail +rm -f depcomp install-sh missing +touch config.rpath +automake --add-missing --gnu || fail +rm -f configure +autoconf +%configure --disable-static --sharedstatedir=%{shareddata} --disable-rpath +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +rm -f $RPM_BUILD_ROOT%{_infodir}/dir +mkdir -p $RPM_BUILD_ROOT%{shareddata}/%{name} +install -p -m 644 %{adplugdbver}/adplug.db $RPM_BUILD_ROOT%{shareddata}/%{name} + +%ldconfig_scriptlets + +%files +%{_libdir}/*.so.* +%dir %{shareddata}/%{name}/ +%config(noreplace) %{shareddata}/%{name}/adplug.db +%{_bindir}/adplugdb +%{_mandir}/man1/adplugdb.1* +%doc AUTHORS BUGS ChangeLog COPYING INSTALL NEWS README TODO +%doc NEWS.adplugdb README.adplugdb + +%files devel +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%dir %{_includedir}/%{name} +%{_includedir}/%{name}/*.h +%{_infodir}/*.gz + +%changelog +* Wed Jul 24 2019 Fedora Release Engineering - 2.2.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Apr 24 2019 Björn Esser - 2.2.1-9 +- Remove hardcoded gzip suffix from GNU info pages + +* Thu Jan 31 2019 Fedora Release Engineering - 2.2.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Dec 15 2018 Robert Scheck - 2.2.1-7 +- Fix double-free in CEmuopl::~CEmuopl() (#1635881, CVE-2018-17825) + +* Thu Jul 12 2018 Fedora Release Engineering - 2.2.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 2.2.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 2.2.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 2.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sun Jun 12 2016 Linus Walleij - 2.2.1-1 +- New upstream version +- Run libtoolize, aclocal, automake and autoconf on build to avoid + rpath problems +- Builds without patches + +* Tue Mar 08 2016 Yaakov Selkowitz - 2.1-21 +- Fix FTBFS with GCC 6 (#1307307) + +* Wed Feb 03 2016 Fedora Release Engineering - 2.1-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jun 16 2015 Fedora Release Engineering - 2.1-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - 2.1-18 +- Rebuilt for GCC 5 C++11 ABI change + +* Thu Feb 19 2015 Michael Schwendt - 2.1-17 +- Drop buildroot tag, %%defattr, %%clean. +- Fix -devel group tag. +- Add %%_isa to -devel base package dep. +- Rebuild for libbinio (GCC 5 C++ ABI change), so deps can compile/link with this. + +* Fri Aug 15 2014 Fedora Release Engineering - 2.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 2.1-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 2.1-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 2.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jul 18 2012 Fedora Release Engineering - 2.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Feb 28 2012 Fedora Release Engineering - 2.1-11 +- Rebuilt for c++ ABI breakage + +* Thu Jan 12 2012 Fedora Release Engineering - 2.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Feb 07 2011 Fedora Release Engineering - 2.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Jul 24 2009 Fedora Release Engineering - 2.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Feb 23 2009 Fedora Release Engineering - 2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 11 2008 Linus Walleij 2.1-6 +- Nailed the GCC build problems to numerous include . + +* Mon Feb 11 2008 Linus Walleij 2.1-5 +- Patch include directives with a patch derived from Debian. + +* Mon Feb 11 2008 Linus Walleij 2.1-4 +- Rebuild for GCC 4.3. + +* Fri Jan 18 2008 Linus Walleij 2.1-3 +- New glibc ABI needs rebuild. + +* Fri Aug 17 2007 Linus Walleij 2.1-2 +- License field update LGPL to LGPLv2+ + +* Wed Apr 11 2007 Linus Walleij 2.1-1 +- New upstream version. + +* Tue Aug 29 2006 Linus Walleij 2.0.1-2 +- Rebuild for Fedora Extras 6. + +* Tue Jul 25 2006 Linus Walleij 2.0.1-1 +- New upstream version, including several security fixes. + +* Mon May 15 2006 Linus Walleij 2.0-2 +- Tell package to avoid rpath, import to FE after review by John Mahowald. + +* Sat May 6 2006 Linus Walleij 2.0-1 +- Upstream release the stuff they've been working on for some time now! + +* Thu Apr 6 2006 Linus Walleij 1.5.1-8.20060323cvs +- Realize that /var/adplug/adplug.db is a real nice place to keep + the database actually. And it is obviously OK to create and own + directories under /var/lib as opposed to /var. + +* Thu Mar 30 2006 Linus Walleij 1.5.1-7.20060323cvs +- Patching to move database from /var/adplug to just /var since + FHS does not like creation of directories under /var. + +* Thu Mar 23 2006 Linus Walleij 1.5.1-6.20060323cvs +- Hardcoding the place to store adplugdb since the dispute regarding + its location never seem to resolve. /var/adplug should be acceptable + for this package atleast. Also getting a bugfix from CVS. + +* Sat Mar 4 2006 Linus Walleij 1.5.1-5.20060228cvs +- Include adplug.db too, everyone will want it anyway + +* Tue Feb 28 2006 Linus Walleij 1.5.1-4.20060228cvs +- Pushed upstream to move adplugdb to sharedstatedir /usr/com + +* Sun Jan 15 2006 Linus Walleij 1.5.1-3.20060101cvs +- Fixed scriptlet problems under non-shell environments. +- Make adplug-devel require libbinio-devel. + +* Sun Jan 08 2006 Linus Walleij 1.5.1-2.20060101cvs +- Did a clean-up rollercoaster ride. + +* Sun Jan 01 2006 Linus Walleij 1.5.1-1.20060101cvs +- We need the CVS version to get going (fixes were initialized in + upstream by ourselves so we should eat our own dogfood). + +* Tue Oct 11 2005 Linus Walleij 1.5.1-1 +- First try at an AdPlug RPM. diff --git a/sources b/sources index e69de29..3a8cf58 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +8f815fd5d254de0fe5df818df9d1d8af adplug-2.2.1.tar.bz2 +40a1cc1222c7318172ee3740c4269df3 adplugdb-2006-07-07.tar.gz