[sidplayfp] Initial RPM packaging for Fedora

Hans de Goede jwrdegoede at fedoraproject.org
Mon Apr 22 21:03:56 UTC 2013


commit 5733fb070407df67e6e6564d3d71736d1e9c6165
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Mon Apr 22 23:07:40 2013 +0200

    Initial RPM packaging for Fedora

 .gitignore                        |    1 +
 sidplayfp-1.0.1-datadir.patch     |   52 +++++++++++++++++++++++++++++++++++++
 sidplayfp-1.0.1-songlengths.patch |   48 ++++++++++++++++++++++++++++++++++
 sidplayfp.spec                    |   49 ++++++++++++++++++++++++++++++++++
 sources                           |    1 +
 5 files changed, 151 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..19808ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sidplayfp-1.0.1.tar.gz
diff --git a/sidplayfp-1.0.1-datadir.patch b/sidplayfp-1.0.1-datadir.patch
new file mode 100644
index 0000000..53aa068
--- /dev/null
+++ b/sidplayfp-1.0.1-datadir.patch
@@ -0,0 +1,52 @@
+--- sidplayfp-1.0.1.orig/src/Makefile.am	2012-09-29 14:40:01.000000000 +0200
++++ sidplayfp-1.0.1/src/Makefile.am	2013-04-13 12:06:29.537027102 +0200
+@@ -1,7 +1,7 @@
+ 
+ SUBDIRS = audio
+ 
+-AM_CPPFLAGS = -I $(top_builddir) \
++AM_CPPFLAGS = -I $(top_builddir) -DPKGDATADIR="\"$(pkgdatadir)/\"" \
+ $(SIDPLAYFP_CFLAGS) \
+ $(STILVIEW_CFLAGS)
+ 
+diff -ur sidplayfp-1.0.1.orig/src/player.cpp sidplayfp-1.0.1/src/player.cpp
+--- sidplayfp-1.0.1.orig/src/player.cpp	2013-03-06 20:43:25.000000000 +0100
++++ sidplayfp-1.0.1/src/player.cpp	2013-04-13 12:05:31.111026877 +0200
+@@ -25,6 +25,10 @@
+ 
+ #include "config.h"
+ 
++#ifdef HAVE_UNISTD_H
++#   include <unistd.h>
++#endif
++
+ #ifdef HAVE_EXCEPTIONS
+ #   include <new>
+ #endif
+@@ -166,6 +170,14 @@
+ #endif
+     dataPath.append("/sidplayfp/").append(defaultRom);
+ 
++#if !defined _WIN32 && defined HAVE_UNISTD_H
++    if (::access(dataPath.c_str(), R_OK) != 0)
++    {
++        dataPath = PKGDATADIR;
++        dataPath.append(defaultRom);
++    }
++#endif
++
+     std::ifstream is((romPath)?romPath:dataPath.c_str(), std::ios::binary);
+ 
+     if (is.fail())
+--- sidplayfp-1.0.1/doc/en/sidplayfp.ini.5~	2013-03-10 11:35:40.000000000 +0100
++++ sidplayfp-1.0.1/doc/en/sidplayfp.ini.5	2013-04-13 12:16:39.775029444 +0200
+@@ -56,6 +56,9 @@ on *NIX systems where XDG_DATA_HOME is d
+ $HOME/.local/share/sidplayfp/
+ on *NIX systems where XDG_DATA_HOME is not defined.
+ .IP \[bu]
++$PREFIX/share/sidplayfp
++on *NIX systems when not found in the above directories.
++.IP \[bu]
+ %CSIDL_APPDATA%\\sidplayfp\\
+ on Windows systems where CSIDL_APPDATA is defined.
+ .IP \[bu]
diff --git a/sidplayfp-1.0.1-songlengths.patch b/sidplayfp-1.0.1-songlengths.patch
new file mode 100644
index 0000000..ecce612
--- /dev/null
+++ b/sidplayfp-1.0.1-songlengths.patch
@@ -0,0 +1,48 @@
+--- sidplayfp-1.0.1.orig/src/args.cpp	2012-12-16 20:31:47.000000000 +0100
++++ sidplayfp-1.0.1/src/args.cpp	2013-04-13 12:08:07.937027479 +0200
+@@ -25,6 +25,10 @@
+ using std::endl;
+ #include "player.h"
+ 
++#ifdef HAVE_UNISTD_H
++#   include <unistd.h>
++#endif
++
+ #ifdef HAVE_SIDPLAYFP_BUILDERS_HARDSID_H
+ #   include <sidplayfp/builders/hardsid.h>
+ #endif
+@@ -418,10 +422,20 @@
+         }
+         if (!m_timer.valid)
+         {
++#if !defined _WIN32 && defined HAVE_UNISTD_H
++            char buffer[PATH_MAX];
++#endif
+             const char *database = (m_iniCfg.sidplay2()).database;
+             m_timer.length = (m_iniCfg.sidplay2()).playLength;
+             if (m_driver.file)
+                 m_timer.length = (m_iniCfg.sidplay2()).recordLength;
++#if !defined _WIN32 && defined HAVE_UNISTD_H
++            if (!database || *database == '\0') {
++                snprintf(buffer, PATH_MAX, "%sSonglengths.txt", PKGDATADIR);
++                if (::access(buffer, R_OK) == 0)
++                   database = buffer;
++            }
++#endif
+             if (database && (*database != '\0'))
+             {   // Try loading the database specificed by the user
+                 if (!m_database.open (database))
+--- sidplayfp-1.0.1/doc/en/sidplayfp.ini.5~	2013-04-13 12:16:39.000000000 +0200
++++ sidplayfp-1.0.1/doc/en/sidplayfp.ini.5	2013-04-13 12:22:09.317030709 +0200
+@@ -33,6 +33,11 @@ Configuration version
+ .TP
+ \fBSonglength Database\fR=\fI<path>\fR
+ Full path for the Songlength DB. Should point to the DOCUMENTS/Songlengths.txt file under the HVSC collection path.
++.P
++.RS
++On *NIX systems if this value is not set, sidplayfp will try
++$PREFIX/share/sidplayfp/Songlengths.txt .
++.RE
+ .br
+ 
+ .TP
diff --git a/sidplayfp.spec b/sidplayfp.spec
new file mode 100644
index 0000000..cc272ff
--- /dev/null
+++ b/sidplayfp.spec
@@ -0,0 +1,49 @@
+Name:           sidplayfp
+Version:        1.0.1
+Release:        1%{?dist}
+Summary:        SID chip music module player
+License:        GPLv2+
+URL:            http://sourceforge.net/projects/sidplay-residfp/
+Source0:        http://downloads.sourceforge.net/sidplay-residfp/%{name}-%{version}.tar.gz
+Patch0:         sidplayfp-1.0.1-datadir.patch
+Patch1:         sidplayfp-1.0.1-songlengths.patch
+BuildRequires:  libsidplayfp-devel alsa-lib-devel pulseaudio-libs-devel
+BuildRequires:  libtool
+%if 0%{?fedora} >= 19
+# Obsolete old sidplay2 based sidplay (sidplayfp is a continuation of sidplay2)
+Obsoletes:      sidplay < 2.0.9-14
+Provides:       sidplay = 2.0.9-14
+%endif
+
+%description
+A player for playing SID music modules originally created on the Commodore 64
+and compatibles.
+
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+autoreconf -i -f
+
+
+%build
+%configure
+make %{?_smp_mflags}
+
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+
+%files
+%doc AUTHORS COPYING README
+%{_bindir}/sidplayfp
+%{_bindir}/stilview
+%{_mandir}/man?/sidplayfp.*
+%{_mandir}/man1/stilview.1*
+
+
+%changelog
+* Thu Apr 11 2013 Hans de Goede <hdegoede at redhat.com> - 1.0.1-1
+- Initial RPM packaging for Fedora
diff --git a/sources b/sources
index e69de29..7bb557f 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+f3554e49eef10aab64491c5e524e5411  sidplayfp-1.0.1.tar.gz


More information about the scm-commits mailing list