Author: musuruan
Update of /cvs/free/rpms/xbill/F-9
In directory se02.es.rpmfusion.net:/tmp/cvs-serv1237/F-9
Modified Files:
.cvsignore sources
Added Files:
xbill-2.1-dropsgid.patch xbill-2.1-gtk2.patch
xbill-2.1-hurd_logos.patch xbill-2.1-score.patch xbill.desktop
xbill.spec
Log Message:
* Thu Feb 26 2009 Andrea Musuruane <musuruan(a)gmail.com> 2.1-2
- Updated icon cache scriptlets to be compliant to new guidelines
* Sat Dec 27 2008 Andrea Musuruane <musuruan(a)gmail.com> 2.1-1
- Reworked to meet Fedora guidelines
- Used a patch to use gtk-2 (Gentoo BZ #201214)
- Used a patch to use an updated hurd logo (Debian)
- Made a patch to fix highscore view when compiling with FORTIFY_SOURCE=2
- Made a patch to drop setgid privileges after opening the score file
xbill-2.1-dropsgid.patch:
--- NEW FILE xbill-2.1-dropsgid.patch ---
diff -dur xbill-2.1.orig/Game.c xbill-2.1/Game.c
--- xbill-2.1.orig/Game.c 2001-10-30 19:28:27.000000000 +0100
+++ xbill-2.1/Game.c 2008-12-26 10:08:56.000000000 +0100
@@ -304,6 +304,7 @@
int
main(int argc, char **argv) {
+ Scorelist_open();
srand(time(NULL));
parse_args(argc, argv);
UI_initialize(gui, &argc, argv);
diff -dur xbill-2.1.orig/Scorelist.c xbill-2.1/Scorelist.c
--- xbill-2.1.orig/Scorelist.c 2001-10-21 10:39:47.000000000 +0200
+++ xbill-2.1/Scorelist.c 2008-12-26 19:51:20.000000000 +0100
@@ -1,6 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
#include "Scorelist.h"
#include "UI.h"
@@ -16,16 +18,33 @@
static Score scores[SCORES];
+FILE *scorefile;
+
+void
+Scorelist_open() {
+ gid_t realgid;
+
+ /* Open the scoreboard file. */
+ scorefile = fopen(SCOREFILE, "r+");
+
+ /* Figure out who we really are. */
+ realgid = getgid();
+
+ /* This is where we drop our setuid/setgid privileges. */
+ if (setresgid(-1, realgid, realgid) != 0) {
+ perror("Could not drop setgid privileges. Aborting.");
+ exit(1);
+ }
+}
+
void
Scorelist_read() {
- FILE *scorefile = fopen(SCOREFILE, "r");
int i;
if (scorefile != NULL) {
for (i = 0; i < SCORES; i++)
fscanf(scorefile, "%20s%d%d\n", scores[i].name,
&scores[i].level, &scores[i].score);
- fclose(scorefile);
}
else {
for (i = 0; i < SCORES; i++) {
@@ -38,10 +57,10 @@
void
Scorelist_write() {
- FILE *scorefile = fopen(SCOREFILE, "w");
int i;
if (scorefile == NULL)
return;
+ rewind(scorefile);
for (i = 0; i < SCORES; i++)
fprintf(scorefile, "%-*s %d %d\n", NAMELEN,
scores[i].name, scores[i].level, scores[i].score);
diff -dur xbill-2.1.orig/Scorelist.h xbill-2.1/Scorelist.h
--- xbill-2.1.orig/Scorelist.h 2001-10-21 10:39:47.000000000 +0200
+++ xbill-2.1/Scorelist.h 2008-12-26 19:11:22.000000000 +0100
@@ -1,6 +1,7 @@
#ifndef SCORELIST_H
#define SCORELIST_H
+void Scorelist_open(void);
void Scorelist_read(void);
void Scorelist_write(void);
void Scorelist_recalc(const char *str, int level, int score);
xbill-2.1-gtk2.patch:
--- NEW FILE xbill-2.1-gtk2.patch ---
--- configure.in.old 2007-12-05 22:37:57.000000000 +0100
+++ configure.in 2007-12-05 22:54:57.000000000 +0100
@@ -88,12 +88,11 @@
[ --enable-gtk build with the GTK widget set])
if test "$enable_gtk" != "no"; then
- AC_CHECK_PROG(GTKCONFIG, gtk-config, yes, no)
+ PKG_CHECK_MODULES(GTK, gtk+-2.0)
- if test "X$GTKCONFIG" = X"yes"; then
+ if test $pkg_failed = no; then
AC_DEFINE(USE_GTK)
- GTK_CFLAGS="`gtk-config --cflags`"
- WIDGET_LIBS="$WIDGET_LIBS `gtk-config --libs`"
+ WIDGET_LIBS="$WIDGET_LIBS $GTK_LIBS"
WIDGET_OBJS="$WIDGET_OBJS gtk.o"
fi
fi
xbill-2.1-hurd_logos.patch:
--- NEW FILE xbill-2.1-hurd_logos.patch ---
--- xbill-2.1.orig/bitmaps/hurd.xbm
+++ xbill-2.1/bitmaps/hurd.xbm
@@ -1,10 +1,11 @@
#define hurd_width 28
#define hurd_height 24
-static char hurd_bits[] = {
- 0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
- 0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,
- 0x00,0xf0,0xc4,0x22,0xef,0xf1,0xc4,0x22,0x2d,0xf3,0xc4,0x22,0x29,0xf3,0xc4,
- 0x22,0x2d,0xf2,0xfc,0x22,0x27,0xf2,0xc4,0x22,0x27,0xf2,0xc4,0x22,0x25,0xf3,
- 0xc4,0x36,0x2d,0xf3,0x04,0x1c,0xe9,0xf1,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,
- 0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,
- 0x00,0xf0,0x00,0x00,0x00,0xf0};
+static unsigned char hurd_bits[] = {
+ 0x00, 0xfe, 0x00, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0xc7, 0x07, 0x00,
+ 0xc0, 0xc7, 0x1f, 0x00, 0x60, 0xc6, 0x79, 0x00, 0x30, 0xfe, 0xe0, 0x00,
+ 0x78, 0x7c, 0xc0, 0x01, 0xfc, 0x10, 0xfe, 0x01, 0xfe, 0x30, 0x7f, 0x03,
+ 0xc6, 0xb0, 0x43, 0x03, 0xc6, 0xe0, 0x43, 0x03, 0xc6, 0x80, 0x43, 0x03,
+ 0xfe, 0x00, 0x7f, 0x03, 0xfe, 0x00, 0xfe, 0x01, 0x78, 0x00, 0x98, 0x01,
+ 0x30, 0xfe, 0xf8, 0x00, 0x30, 0xfe, 0x78, 0x00, 0x30, 0xc6, 0x3f, 0x00,
+ 0x60, 0xc6, 0x0f, 0x00, 0x60, 0xc6, 0x06, 0x00, 0xc0, 0xfe, 0x06, 0x00,
+ 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0xfe, 0x00, 0x00 };
--- xbill-2.1.orig/pixmaps/hurd.xpm
+++ xbill-2.1/pixmaps/hurd.xpm
@@ -1,44 +1,176 @@
/* XPM */
static char * hurd_xpm[] = {
-"28 24 16 1",
-" c #aaaaaa",
-". c #71b6d6",
-"X c #5da4f1",
-"o c #5e91d7",
-"O c #3171c5",
-"+ c #3487ca",
-"@ c #2750a0",
-"# c #29d176",
-"$ c #77d8d9",
-"% c #21bf77",
-"& c #00ff00",
-"* c #10e13c",
-"= c #183571",
-"- c #16ef1a",
-"; c #25639c",
-": c #1f418a",
-/* pixels */
-" ",
-" ",
-" ",
-" .XXXo ",
-" XXXXXXOo ",
-" XXXXXXX+O ",
-" XXXXXXXX+O@ ",
-" # .#XX$#XX%%+@o### ",
-" & &&.&X$$&**&&&&=&&&&#
",
-" & &&.&$$$&**&O&&=& && ",
-" & &&.&$$$&**&O*&=& && ",
-" &---&&.&X$X&**&O&&=& & ",
-" &&&&&&.&XXX&**&&&-=& &
",
-" & &&.&XXX&%*&&&==& & ",
-" & &&X&*X%&+*&;&-;& && ",
-" & &&X&&%&&O*&@&&;&--&&
",
-" & --+%&&&+O*&:*&+&&&& ",
-" O+O+OO@@:=:O+ ",
-" oOOOO@@:==@$o ",
-" @@@@::==:XX ",
-" @::::==:@XX ",
-" ;=====:@o ",
-" @==:O ",
-" "};
+"28 24 149 2",
+" c #FFFFFF",
+". c #9C9C9C",
+"+ c #505050",
+"@ c #575757",
+"# c #464646",
+"$ c #D7D7D7",
+"% c #FEFEFE",
+"& c #7E7E7E",
+"* c #BDBDBD",
+"= c #EFEFEF",
+"- c #F0F0F0",
+"; c #7B7B7B",
+"> c #A5A5A5",
+", c #CCCCCC",
+"' c #F3F3F3",
+") c #D9D9D9",
+"! c #616161",
+"~ c #C8C8C8",
+"{ c #828282",
+"] c #161616",
+"^ c #9B9B9B",
+"/ c #D2D2D2",
+"( c #E8E8E8",
+"_ c #FBFBFB",
+": c #F8F8F8",
+"< c #979797",
+"[ c #535353",
+"} c #676767",
+"| c #474747",
+"1 c #C9C9C9",
+"2 c #818181",
+"3 c #111111",
+"4 c #808080",
+"5 c #6F6F6F",
+"6 c #5E5E5E",
+"7 c #595959",
+"8 c #ADADAD",
+"9 c #F9F9F9",
+"0 c #FCFCFC",
+"a c #707070",
+"b c #878787",
+"c c #7F7F7F",
+"d c #767676",
+"e c #BBBBBB",
+"f c #E4E4E4",
+"g c #515151",
+"h c #D4D4D4",
+"i c #B8B8B8",
+"j c #777777",
+"k c #FDFDFD",
+"l c #898989",
+"m c #4C4C4C",
+"n c #5A5A5A",
+"o c #5C5C5C",
+"p c #373737",
+"q c #CECECE",
+"r c #D5D5D5",
+"s c #4E4E4E",
+"t c #C4C4C4",
+"u c #BFBFBF",
+"v c #696969",
+"w c #AEAEAE",
+"x c #DADADA",
+"y c #F6F6F6",
+"z c #EBEBEB",
+"A c #D8D8D8",
+"B c #545454",
+"C c #E3E3E3",
+"D c #4D4D4D",
+"E c #E9E9E9",
+"F c #CFCFCF",
+"G c #6D6D6D",
+"H c #0D0D0D",
+"I c #242424",
+"J c #A4A4A4",
+"K c #E0E0E0",
+"L c #F4F4F4",
+"M c #585858",
+"N c #F2F2F2",
+"O c #D1D1D1",
+"P c #C0C0C0",
+"Q c #6E6E6E",
+"R c #DCDCDC",
+"S c #434343",
+"T c #7C7C7C",
+"U c #757575",
+"V c #717171",
+"W c #646464",
+"X c #6A6A6A",
+"Y c #CACACA",
+"Z c #404040",
+"` c #7D7D7D",
+" . c #7A7A7A",
+".. c #E6E6E6",
+"+. c #626262",
+"@. c #D3D3D3",
+"#. c #F1F1F1",
+"$. c #DDDDDD",
+"%. c #565656",
+"&. c #C5C5C5",
+"*. c #E7E7E7",
+"=. c #A9A9A9",
+"-. c #1C1C1C",
+";. c #454545",
+">. c #959595",
+",. c #B1B1B1",
+"'. c #D0D0D0",
+"). c #363636",
+"!. c #555555",
+"~. c #DEDEDE",
+"{. c #5B5B5B",
+"]. c #484848",
+"^. c #050505",
+"/. c #131313",
+"(. c #F7F7F7",
+"_. c #747474",
+":. c #393939",
+"<. c #888888",
+"[. c #606060",
+"}. c #3C3C3C",
+"|. c #DBDBDB",
+"1. c #797979",
+"2. c #DFDFDF",
+"3. c #AAAAAA",
+"4. c #A0A0A0",
+"5. c #C6C6C6",
+"6. c #3F3F3F",
+"7. c #4B4B4B",
+"8. c #B9B9B9",
+"9. c #CDCDCD",
+"0. c #6B6B6B",
+"a. c #B6B6B6",
+"b. c #BABABA",
+"c. c #252525",
+"d. c #8B8B8B",
+"e. c #EAEAEA",
+"f. c #4A4A4A",
+"g. c #9F9F9F",
+"h. c #8E8E8E",
+"i. c #F5F5F5",
+"j. c #8A8A8A",
+"k. c #E1E1E1",
+"l. c #BCBCBC",
+"m. c #E5E5E5",
+"n. c #A3A3A3",
+"o. c #CBCBCB",
+"p. c #EDEDED",
+"q. c #9A9A9A",
+"r. c #B4B4B4",
+" . + @ @ @ # $ % % ",
+" % & * = = - ; > , % % ",
+" % % % ' ) ! ~ % % % { ] ^ / ( _ % % % % % ",
+" % % : < [ } | 1 % % 2 3 4 5 6 7 8 9 % % % ",
+" % 0 a b ' % c 1 % % % { d e _ f 4 g h % ",
+" % i j k % l m n g o p q % % % % r s t % ",
+" % % u v w x % % y z A B ( z 0 % % % % % C D E ",
+" 9 F G H I J K % % % L M N % k O 1 1 1 1 ) P Q % ",
+" R S T U j V W % % X Y % z Z ` ` ` .m 0 B .. ",
+" ) 5 ..+.% @.o #.$.} %.% 9 + % .&. ",
+" ) 5 *.+.% =.# 6 -.;.% 9 + % >.,. ",
+" ) 5 % % ..+.% _ '.).m : + % 4 P ",
+" ) W f f f q ! % #.&.!.C f f ~.s k {.K ",
+" z G ].^./.o ^ % (._.+.:.].+.<.O [.k ",
+" % % 4 }.G * % % % % % & t % N [ |. ",
+" _ U , 0 % % * ; ` T T 1...% % % ! 2.( {.w % ",
+" % >.3.% % % ` 4.1 1 1 } 5.% 9 6.4.7.8.k % ",
+" % 9.0.% % % c 1 % % { a.2.b.5 c.d.e.% % ",
+" k f.z % % c 1 % % % { ].W b | u % ",
+" % % g.h.% % c 1 % % { 5.% $.@ (.% % ",
+" % i.o 9.% & Q j.j.j.| ~ L o F % % ",
+" k.7.~ k.l.l.l.l.l.m.! n.% ",
+" % C {.U o.z p.x q.7.r.% ",
+" % % : * U 7 M v g.E % % "};
xbill-2.1-score.patch:
--- NEW FILE xbill-2.1-score.patch ---
diff -dur xbill-2.1.orig/Scorelist.c xbill-2.1.score/Scorelist.c
--- xbill-2.1.orig/Scorelist.c 2001-10-21 10:39:47.000000000 +0200
+++ xbill-2.1.score/Scorelist.c 2008-12-27 15:06:14.000000000 +0100
@@ -83,13 +83,15 @@
void
Scorelist_update() {
char str[500];
+ char temp[40];
int i;
- sprintf(str, "%s\n\n", "High Scores:");
- sprintf(str, "%s%-*s %6s %7s\n", str, NAMELEN,
- "Name", "Level", "Score");
+ strcpy(str, "High Scores:\n\n");
+ sprintf(temp, "%-*s %6s %7s\n", NAMELEN, "Name", "Level",
"Score");
+ strcat(str, temp);
for (i = 0; i < SCORES; i++) {
- sprintf(str, "%s%-*s %6d %7d\n", str, NAMELEN,
+ sprintf(temp, "%-*s %6d %7d\n", NAMELEN,
scores[i].name, scores[i].level, scores[i].score);
+ strcat(str, temp);
}
UI_update_dialog(DIALOG_HIGHSCORE, str);
}
--- NEW FILE xbill.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=xBill
Comment=Stop Bill from loading his OS into all the computers
Exec=xbill
Icon=xbill
Terminal=false
Type=Application
Categories=Game;ActionGame
--- NEW FILE xbill.spec ---
Name: xbill
Version: 2.1
Release: 2%{?dist}
Summary: Stop Bill from loading his OS into all the computers
Group: Amusements/Games
License: GPL+
URL:
http://www.xbill.org/
Source0:
http://www.xbill.org/download/%{name}-%{version}.tar.gz
Source1: %{name}.desktop
# Gentoo 201214
Patch0: %{name}-2.1-gtk2.patch
# Debian
Patch1: %{name}-2.1-hurd_logos.patch
# Andrea Musuruane
Patch2: %{name}-2.1-score.patch
Patch3: %{name}-2.1-dropsgid.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gtk2-devel
BuildRequires: desktop-file-utils
BuildRequires: ImageMagick
Requires: hicolor-icon-theme
%description
The xbill game tests your reflexes as you seek out and destroy all
forms of Bill, establish a new operating system throughout the
universe, and boldly go where no geek has gone before. Xbill has
become an increasingly attractive option as the Linux Age progresses,
and it is very popular at Red Hat.
%prep
%setup -q
%patch0 -p0
%patch1 -p1
# Patch2 must be applied before patch3
%patch2 -p1
%patch3 -p1
%build
autoreconf
%configure --disable-motif \
--localstatedir=%{_localstatedir}/games
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
#install man page
install -d %{buildroot}%_mandir/man6
install -m 644 %{name}.6 %{buildroot}%{_mandir}/man6
# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --vendor '' \
--dir %{buildroot}%{_datadir}/applications \
%{SOURCE1}
# install icon
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
convert -resize x48 %{name}.gif \
%{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%clean
rm -rf $RPM_BUILD_ROOT
%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%defattr(-,root,root,-)
%attr(2755,root,games) %{_bindir}/%{name}
%{_localstatedir}/games/%{name}
%attr(0664,root,games) %config(noreplace) %{_localstatedir}/games/%{name}/scores
%{_datadir}/%{name}
%{_mandir}/man6/%{name}.6*
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%doc ChangeLog README
%changelog
* Thu Feb 26 2009 Andrea Musuruane <musuruan(a)gmail.com> 2.1-2
- Updated icon cache scriptlets to be compliant to new guidelines
* Sat Dec 27 2008 Andrea Musuruane <musuruan(a)gmail.com> 2.1-1
- Reworked to meet Fedora guidelines
- Used a patch to use gtk-2 (Gentoo BZ #201214)
- Used a patch to use an updated hurd logo (Debian)
- Made a patch to fix highscore view when compiling with FORTIFY_SOURCE=2
- Made a patch to drop setgid privileges after opening the score file
* Sun Oct 28 2001 Brian Wellington <bwelling(a)xbill.org>
- Updated to 2.1
* Sun Jun 24 2001 Elliot Lee <sopwith(a)redhat.com>
- Bump release + rebuild.
* Fri Apr 27 2001 Bill Nottingham <notting(a)redhat.com>
- rebuild for C++ exception handling on ia64
* Wed Oct 18 2000 Than Ngo <than(a)redhat.com>
- rebuilt against gcc-2.96-60
* Tue Jul 18 2000 Than Ngo <than(a)redhat.de>
- rebuilt with gcc-2.96-4.0
* Thu Jul 13 2000 Prospector <bugzilla(a)redhat.com>
- automatic rebuild
* Tue Jul 2 2000 Jakub Jelinek <jakub(a)redhat.com>
- Rebuild with new C++
* Sun Jun 18 2000 Than Ngo <than(a)redhat.de>
- rebuilt in the new build environment
- use RPM maccros
* Mon May 08 2000 Preston Brown <pbrown(a)redhat.com>
- fix for gcc 2.95 from t-matsuu(a)protein.osaka-u.ac.jp.
* Mon Feb 07 2000 Preston Brown <pbrown(a)redhat.com>
- rebuild with config(noreplace) score file, new description
- replace wmconfig with desktop file
* Sun Mar 21 1999 Cristian Gafton <gafton(a)redhat.com>
- auto rebuild in the new build environment (release 6)
* Thu Dec 17 1998 Michael Maher <mike(a)redhat.com>
- built pacakge for 6.0
* Fri May 01 1998 Prospector System <bugs(a)redhat.com>
- translations modified for de, fr, tr
* Fri Aug 22 1997 Erik Troan <ewt(a)redhat.com>
- built against glibc
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/xbill/F-9/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 23 Feb 2009 20:34:44 -0000 1.1
+++ .cvsignore 26 Feb 2009 18:40:10 -0000 1.2
@@ -0,0 +1 @@
+xbill-2.1.tar.gz
Index: sources
===================================================================
RCS file: /cvs/free/rpms/xbill/F-9/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 23 Feb 2009 20:34:44 -0000 1.1
+++ sources 26 Feb 2009 18:40:10 -0000 1.2
@@ -0,0 +1 @@
+585e4866b15255a24203db9959407b2f xbill-2.1.tar.gz