Packaging bsnes for Fedora

Announce new emulators, discuss which games run best under each emulator, and much much more.

Moderator: General Mods

Post Reply
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Packaging bsnes for Fedora

Post by belegdol »

Hi,

I have recently started working on packaging bsnes, so that users will be able to install it more easily. Two questions came up so far:
1. Where to put cart.db? Is there a specific relative path where the emulator looks for it?
2. Is support for some sort of system-wide configuration available? Say, having an /etc/bsnes.conf file with some sane defaults would be really appreciated.

Thanks in advance.

ETA: OK, although cart.db is not installed ATM, I have submitted my package for review [1]. Comments are of course more than welcome.

[1] https://bugzilla.rpmfusion.org/show_bug.cgi?id=15
byuu

Post by byuu »

Hi.
I have recently started working on packaging bsnes, so that users will be able to install it more easily.
While I do appreciate the effort, and give you permission to make the RPM so long as source code itself remains unmodified, Fedora won't approve your submission, because the license is not GPL compatible. Same reason I can't get a deb into Ubuntu / multiverse, sadly. And yet they have the closed source Flash / nvidia stuff available ...
1. Where to put cart.db? Is there a specific relative path where the emulator looks for it?
For v0.025, it needs to be in the same folder as the binary. But thanks to Nach, the file will no longer be needed as of v0.026. It has been removed in the private WIPs.

I should also note that there's an install target in the new unreleased version, which should make this easier in the future.
2. Is support for some sort of system-wide configuration available? Say, having an /etc/bsnes.conf file with some sane defaults would be really appreciated.
Unfortunately, no. The config file resides at ~/.bsnes/bsnes.cfg. I asked everyone which path would be preferred, and everyone preferred the local path to a global one. Also, a file in /etc would not be editable without root privileges (or make the installer chmod the file, which would also be unusual); bsnes needs to be able to edit this file.
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Post by belegdol »

byuu wrote:Hi.
I have recently started working on packaging bsnes, so that users will be able to install it more easily.
While I do appreciate the effort, and give you permission to make the RPM so long as source code itself remains unmodified, Fedora won't approve your submission, because the license is not GPL compatible. Same reason I can't get a deb into Ubuntu / multiverse, sadly. And yet they have the closed source Flash / nvidia stuff available ...
I know of this limitation, hence I have submitted the package to rpmfusion repository. The non-free part of the repo allows for more strict licenses. Source code is of course intact, as required by the license. I was thinking about patching the makefile to use system-wide optimisation flags, but I suppose this requires your permission. I have converted the icon to png to allow a menu entry, as well as fixed permissions and line endings on license.txt, readme.txt and cart.db, hopefully that's OK with the license. If not, I can revert that, please let me know.
byuu wrote:
1. Where to put cart.db? Is there a specific relative path where the emulator looks for it?
For v0.025, it needs to be in the same folder as the binary. But thanks to Nach, the file will no longer be needed as of v0.026. It has been removed in the private WIPs.
Thanks for the info, I'll put the database into bindir for now then.
byuu wrote:I should also note that there's an install target in the new unreleased version, which should make this easier in the future.
There aren't that many files to install so doing it the hard way wasn't that painful ;)
byuu wrote:
2. Is support for some sort of system-wide configuration available? Say, having an /etc/bsnes.conf file with some sane defaults would be really appreciated.
Unfortunately, no. The config file resides at ~/.bsnes/bsnes.cfg. I asked everyone which path would be preferred, and everyone preferred the local path to a global one. Also, a file in /etc would not be editable without root privileges (or make the installer chmod the file, which would also be unusual); bsnes needs to be able to edit this file.
OK, no problem. Thanks for all the info again.
byuu

Post by byuu »

I was thinking about patching the makefile to use system-wide optimisation flags, but I suppose this requires your permission.
Sure, go for it.
I have converted the icon to png to allow a menu entry, as well as fixed permissions and line endings on license.txt, readme.txt and cart.db, hopefully that's OK with the license.
If you mean \r\n -> \n, that's fine. I also made a 48x48 PNG of the icon in the current WIP. I copy it to /usr/local/share/icons with make install, not sure how correct that is, but it gets the icon onto the binary, so I'm guessing it's good enough.

I don't mind these kinds of changes, the only reason I add a "no modifications" clause is because if I try and define a "level of acceptable changes", it would be too vague and open to abuse.

Thanks again for making the RPM :)
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Post by belegdol »

I updated the package to reflect the comments, feel free to take a look.
belegdol
Hazed
Posts: 68
Joined: Tue Dec 07, 2004 10:24 am

Post by belegdol »

I missed that before, but it looks like source files are installed as a part of debuginfo package, and thus rpmlint complains about permissions and end-of-line encoding. Can I fix that? Summing up, the changes required would be the following:

Code: Select all

#fix permissions and line endings
chmod 644 license.txt readme.txt cart.db
sed -i 's/\r//' license.txt readme.txt
find src -type f \( -name \*.cpp -or -name \*.h -or -name \*.c \) -exec chmod 644 {} \;
find src -type f \( -name \*.cpp -or -name \*.h -or -name \*.c \) -exec sed -i 's/\r//' {} \;

#use system optflags
sed -i "s#CFLAGS = -O3 -fomit-frame-pointer#CFLAGS = %{optflags}#" src/Makefile

#convert the icon to PNG
convert src/data/bsnes.ico bsnes.png
Post Reply