From 2ced14fd9114c2c12c7639e7eda7451f2919034795791cbfe076f735da71a6e6 Mon Sep 17 00:00:00 2001 From: Pascal Bleser Date: Mon, 31 Oct 2011 11:07:03 +0000 Subject: [PATCH] - moved binary to %{_bindir} instead of %{_prefix}/games - patched ltris to prevent it from trying to save the highscores to a system-wide file - ltris no longer runs as SUID/GUID games, but as the regular user, as highscores are now only stored in the home directory OBS-URL: https://build.opensuse.org/package/show/games/ltris?expand=0&rev=11 --- ltris-no_system_wide_hiscore_file.patch | 44 +++++++++++++++++++++++++ ltris-rpmlintrc | 1 - ltris.changes | 9 +++++ ltris.desktop | 11 +++++-- ltris.spec | 24 +++++--------- 5 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 ltris-no_system_wide_hiscore_file.patch delete mode 100644 ltris-rpmlintrc diff --git a/ltris-no_system_wide_hiscore_file.patch b/ltris-no_system_wide_hiscore_file.patch new file mode 100644 index 0000000..8a5676a --- /dev/null +++ b/ltris-no_system_wide_hiscore_file.patch @@ -0,0 +1,44 @@ +--- src/chart.c.orig 2011-03-02 11:10:19.000000000 +0100 ++++ src/chart.c 2011-10-31 12:00:50.608000463 +0100 +@@ -189,14 +189,10 @@ + if ( charts ) list_delete( charts ); charts = 0; + charts = list_create( LIST_AUTO_DELETE, chart_set_delete ); + /* load highscore */ +- if ( !chart_load_from_path( HI_DIR ) ) { +- fprintf( stderr, "Unable to access highscore chart in '%s'.\n", HI_DIR ); +- fprintf( stderr, "Trying to use config directory '%s'.\n", config.dir_name ); +- if ( !chart_load_from_path( config.dir_name ) ) { ++ if ( !chart_load_from_path( config.dir_name ) ) { + fprintf( stderr, "Unable to access highscore chart in config directory... won't be " + "able to save any results. Sorry.\n" ); + return; +- } + } + printf( "Saving highscore chart in: %s\n", chart_path ); + /* load resources */ +--- src/Makefile.in.orig 2011-10-31 12:00:55.535000463 +0100 ++++ src/Makefile.in 2011-10-31 12:01:03.235000463 +0100 +@@ -610,10 +610,6 @@ + install-data-local: + $(mkinstalldirs) $(DESTDIR)$(inst_dir) + $(INSTALL_DATA) figures $(DESTDIR)$(inst_dir)/figures +- $(mkinstalldirs) $(DESTDIR)$(hi_dir) +- if ! test -f $(DESTDIR)$(hi_dir)/ltris.hscr; then \ +- $(INSTALL_DATA) --mode=666 empty.hscr $(DESTDIR)$(hi_dir)/ltris.hscr; \ +- fi; + + uninstall-local: + -rm -fr $(DESTDIR)$(inst_dir) +--- src/Makefile.am.orig 2011-03-02 11:10:19.000000000 +0100 ++++ src/Makefile.am 2011-10-31 12:00:50.627000462 +0100 +@@ -18,10 +18,6 @@ + install-data-local: + $(mkinstalldirs) $(DESTDIR)$(inst_dir) + $(INSTALL_DATA) figures $(DESTDIR)$(inst_dir)/figures +- $(mkinstalldirs) $(DESTDIR)$(hi_dir) +- if ! test -f $(DESTDIR)$(hi_dir)/ltris.hscr; then \ +- $(INSTALL_DATA) --mode=666 empty.hscr $(DESTDIR)$(hi_dir)/ltris.hscr; \ +- fi; + + uninstall-local: + -rm -fr $(DESTDIR)$(inst_dir) diff --git a/ltris-rpmlintrc b/ltris-rpmlintrc deleted file mode 100644 index 4766f6d..0000000 --- a/ltris-rpmlintrc +++ /dev/null @@ -1 +0,0 @@ -setBadness('permissions-file-setuid-bit', 0) diff --git a/ltris.changes b/ltris.changes index f4af1c7..1cf8e47 100644 --- a/ltris.changes +++ b/ltris.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 31 11:06:53 UTC 2011 - pascal.bleser@opensuse.org + +- moved binary to %{_bindir} instead of %{_prefix}/games +- patched ltris to prevent it from trying to save the highscores to a + system-wide file +- ltris no longer runs as SUID/GUID games, but as the regular user, as + highscores are now only stored in the home directory + ------------------------------------------------------------------- Mon Oct 31 10:12:17 UTC 2011 - pascal.bleser@opensuse.org diff --git a/ltris.desktop b/ltris.desktop index 8edded3..3ae04ab 100644 --- a/ltris.desktop +++ b/ltris.desktop @@ -1,5 +1,10 @@ [Desktop Entry] -Type=Application -Name=LTris -Exec=ltris +Version=1.0 +Terminal=false Icon=ltris.xpm +Type=Application +Categories= +Exec=ltris +Name=LTris +GenericName=Falling Bricks Arcade Game +Comment=LTris is an arcade game in the style of T*tr*s diff --git a/ltris.spec b/ltris.spec index fd58e0a..3c7f243 100644 --- a/ltris.spec +++ b/ltris.spec @@ -31,9 +31,8 @@ Url: http://lgames.sourceforge.net/index.php?project=LTris # http://prdownloads.sourceforge.net/lgames/ltris-%{version}.tar.gz Source: ltris-%{version}.tar.bz2 Source1: %{name}.desktop -Source99: ltris-rpmlintrc +Patch1: ltris-no_system_wide_hiscore_file.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build -PreReq: permissions %description LTris is a very polished Tetris clone. It is highly configurable due to @@ -44,13 +43,17 @@ controlled. %prep %setup -q +%patch1 +# we patch both Makefile.am and Makefile.in; touch Makefile.in here again +# to make sure configure won't run autoreconf (which it does if the .am file +# is newer than the .in file): +touch src/Makefile.in %build export CFLAGS="%{optflags} -fPIC -fPIE" export CXXFLAGS="$CFLAGS" %configure \ --datadir=%{_datadir}/games \ - --bindir=%{_prefix}/games \ --localstatedir=%{_localstatedir}/games make %{?_smp_mflags} @@ -73,23 +76,12 @@ mv $RPM_BUILD_ROOT%{_datadir}/games/locale $RPM_BUILD_ROOT%{_datadir}/locale %fdupes -s "%{buildroot}%{_datadir}/games/ltris" %endif -%post -%if 0%{?suse_version} < 1140 -%run_permissions -%else -%set_permissions %{_prefix}/games/ltris -%endif - -%verifyscript -%verify_permissions -e %{_prefix}/games/ltris - %files -f %{name}.lang -%defattr(644,root,root,755) +%defattr(-,root,root) %doc AUTHORS COPYING ChangeLog README -%attr(2755,games,games) %{_prefix}/games/ltris +%{_bindir}/ltris %dir %{_datadir}/games/ltris %{_datadir}/games/ltris/* -%attr(664,games,games) /var/games/ltris.hscr %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/ltris.xpm