diff --git a/bzflag-2.0.2-lookup.patch b/bzflag-2.0.2-lookup.patch deleted file mode 100644 index 6deb97c..0000000 --- a/bzflag-2.0.2-lookup.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- bzflag-2.0.2.20050318/src/net/Address.cxx.lookup 2005-04-07 15:59:16.352779078 +0200 -+++ bzflag-2.0.2.20050318/src/net/Address.cxx 2005-04-07 16:18:15.328900190 +0200 -@@ -152,6 +152,8 @@ - int j; - - struct hostent* hent; -+ struct hostent myhostent; -+ - if (hname == "") { // local address - char hostname[MAXHOSTNAMELEN+1]; - if (gethostname(hostname, sizeof(hostname)) >= 0) -@@ -181,7 +183,23 @@ - } - #endif - -- hent = gethostbyname(hname.c_str()); -+ // hent = gethostbyname(hname.c_str()); -+ { -+ const char *hn = hname.c_str() ; -+ char buf[1024] ; -+ int my_herrno = 0; -+ -+ memset(&myhostent, 0, sizeof(myhostent)) ; -+ hent = 0 ; -+ -+ if(gethostbyname2_r (hn, AF_INET, &myhostent, buf,sizeof(buf), -+ &hent, &my_herrno) != 0) { -+ sprintf(buf,"gethostbyname2_r failed %d", my_herrno) ; -+ printError(buf) ; -+ } -+ } -+ -+ // hent = gethostbyname2(hname.c_str(), AF_INET); - - #if !defined(_WIN32) - if (oldAlarm != SIG_ERR) { diff --git a/bzflag-2.0.4-lookup.patch b/bzflag-2.0.4-lookup.patch new file mode 100644 index 0000000..53444d2 --- /dev/null +++ b/bzflag-2.0.4-lookup.patch @@ -0,0 +1,34 @@ +--- bzflag-2.0.4.20050930/src/net/Address.cxx.lookup 2005-09-07 23:57:38.000000000 +0200 ++++ bzflag-2.0.4.20050930/src/net/Address.cxx 2005-11-21 16:49:23.000000000 +0100 +@@ -136,6 +136,8 @@ + int j; + + struct hostent* hent; ++ struct hostent myhostent; ++ + if (hname == "") { // local address + char hostname[MAXHOSTNAMELEN+1]; + if (gethostname(hostname, sizeof(hostname)) >= 0) +@@ -147,7 +149,21 @@ + a.addr.push_back(tempAddr); + return a; + } else { // non-local address +- hent = gethostbyname(hname.c_str()); ++ // hent = gethostbyname(hname.c_str()); ++ { ++ const char *hn = hname.c_str() ; ++ char buf[1024] ; ++ int my_herrno = 0; ++ ++ memset(&myhostent, 0, sizeof(myhostent)) ; ++ hent = 0 ; ++ ++ if(gethostbyname2_r (hn, AF_INET, &myhostent, buf,sizeof(buf), ++ &hent, &my_herrno) != 0) { ++ sprintf(buf,"gethostbyname2_r failed %d", my_herrno) ; ++ printError(buf) ; ++ } ++ } + } + + if (!hent) { diff --git a/bzflag.spec b/bzflag.spec index 539984d..934b591 100644 --- a/bzflag.spec +++ b/bzflag.spec @@ -1,18 +1,19 @@ -%define _modular_X %{?modular_X:%modular_X}%{?!modular_X:1} +# Use --without modular_X to rebuild withour modular X deps +%define _modular_X 0%{!?_without_modular_x:1} %define desktop_vendor fedora -%define date 20050318 +%define date 20050930 Summary: 3D multi-player tank battle game Name: bzflag -Version: 2.0.2 -Release: 5 +Version: 2.0.4 +Release: 1 License: GPL Group: Amusements/Games URL: http://bzflag.org Source0: http://ftp.bzflag.org/bzflag/bzflag-%{version}%{?date:.%{date}}.tar.bz2 Source1: bzflag.desktop -Patch0: bzflag-2.0.2-lookup.patch +Patch0: bzflag-2.0.4-lookup.patch Patch1: bzflag-2.0.2-isoc++.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) %if %_modular_X @@ -32,7 +33,7 @@ BuildRequires: desktop-file-utils BuildRequires: SDL-devel BuildRequires: ncurses-devel BuildRequires: curl-devel -BuildRequires: adns-devel +BuildRequires: c-ares-devel # for curl version checking in configure. ugh. BuildRequires: bc @@ -47,24 +48,28 @@ There are two main styles of play: capture-the-flag and free-for-all. %prep %setup -q -n %{name}-%{version}%{?date:.%{date}} -%patch0 -p1 -b .lookup -%patch1 -p1 -b .isoc++ +%patch0 -p1 -b .isoc++ %build # Use PIE because bzflag/bzfs are networked server applications -CFLAGS='-fPIE -pie %optflags -fno-strict-aliasing' -CXXFLAGS='-fPIE -pie %optflags -fno-strict-aliasing' -%configure +CFLAGS='-fPIE -pie %{optflags} -fno-strict-aliasing' +CXXFLAGS='-fPIE -pie %{optflags} -fno-strict-aliasing' +%configure \ + --libdir=%{_libdir}/bzflag \ + --includedir=%{_includedir}/bzflag make %{?_smp_mflags} %install rm -rf %{buildroot} -%makeinstall +%makeinstall \ + libdir=%{buildroot}%{_libdir}/bzflag \ + includedir=%{buildroot}%{_includedir}/bzflag install -D -m 644 package/rpm/bzflag-m.xpm \ %{buildroot}%{_datadir}/pixmaps/bzflag.xpm mkdir -p %{buildroot}%{_datadir}/applications -desktop-file-install --vendor %{desktop_vendor} --dir %{buildroot}%{_datadir}/applications \ +desktop-file-install --vendor %{desktop_vendor} \ + --dir %{buildroot}%{_datadir}/applications \ %{SOURCE1} %clean @@ -75,14 +80,25 @@ rm -rf %{buildroot} %doc AUTHORS BUGS COPYING ChangeLog NEWS README README.Linux %{_bindir}/bzadmin %{_bindir}/bzflag -#%{_bindir}/bzfrelay %{_bindir}/bzfs +%exclude %{_includedir}/bzflag/ +%dir %{_libdir}/bzflag/ +%exclude %{_libdir}/bzflag/*.a +%exclude %{_libdir}/bzflag/*.la +%{_libdir}/bzflag/*.so %{_datadir}/applications/%{desktop_vendor}-%{name}.desktop %{_datadir}/bzflag %{_datadir}/pixmaps/bzflag.xpm %{_mandir}/man*/* %changelog +* Mon Nov 21 2005 Nils Philippsen 2.0.4-1 +- version 2.0.4 +- update lookup patch +- build require c-ares-devel instead of adns-devel +- add newly introduced libs and includes (but exclude headers and static libs, + courtesy of Matthias Saou) + * Thu Nov 17 2005 Nils Philippsen 2.0.2-5 - rebuild to pick up new openssl version - prepare for modular X