Make non-gtk version of mtr buildable

Signed-off-by: Adam Tkac <atkac@redhat.com>
This commit is contained in:
Adam Tkac 2013-02-18 20:27:16 +01:00
parent d6f53aea73
commit 0fcca6ea1d
2 changed files with 35 additions and 1 deletions

26
mtr-glib2.patch Normal file
View File

@ -0,0 +1,26 @@
diff -up mtr-0.83/configure.in.glib2 mtr-0.83/configure.in
--- mtr-0.83/configure.in.glib2 2013-02-18 20:10:00.767417356 +0100
+++ mtr-0.83/configure.in 2013-02-18 20:10:53.549513018 +0100
@@ -59,6 +59,8 @@ else
GTK_OBJ=""
fi
+PKG_CHECK_MODULES([GLIB2], [glib-2.0])
+
AC_CHECK_FUNC(socket, ,
AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(No socket library found)))
diff -up mtr-0.83/Makefile.am.glib2 mtr-0.83/Makefile.am
--- mtr-0.83/Makefile.am.glib2 2013-02-18 20:13:54.635841512 +0100
+++ mtr-0.83/Makefile.am 2013-02-18 20:16:17.877101679 +0100
@@ -19,8 +19,9 @@ mtr_SOURCES = mtr.c \
mtr-gtk.h
EXTRA_mtr_SOURCES = curses.c \
gtk.c
+AM_CFLAGS = $(GLIB2_CFLAGS)
mtr_DEPENDENCIES = $(GTK_OBJ) $(CURSES_OBJ)
-mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ)
+mtr_LDFLAGS = $(GTK_OBJ) $(GLIB2_LIBS) $(CURSES_OBJ)
EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist
distclean-local:

View File

@ -1,7 +1,7 @@
Summary: A network diagnostic tool Summary: A network diagnostic tool
Name: mtr Name: mtr
Version: 0.83 Version: 0.83
Release: 1%{?dist} Release: 2%{?dist}
Epoch: 2 Epoch: 2
Group: Applications/Internet Group: Applications/Internet
License: GPLv2+ License: GPLv2+
@ -13,8 +13,10 @@ Source3: net-x%{name}.desktop
Patch1: mtr-crash-in-xml-mode.patch Patch1: mtr-crash-in-xml-mode.patch
Patch2: mtr-xml-format-fixes.patch Patch2: mtr-xml-format-fixes.patch
Patch3: mtr-glib2.patch
BuildRequires: ncurses-devel gtk2-devel desktop-file-utils BuildRequires: ncurses-devel gtk2-devel desktop-file-utils
BuildRequires: autoconf automake libtool
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -39,8 +41,11 @@ diagnostic tool.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
touch ChangeLog
%patch3 -p1 -b .glib2
%build %build
autoreconf -fiv
%configure --enable-gtk2 %configure --enable-gtk2
make %{?_smp_mflags} && mv mtr xmtr && make distclean make %{?_smp_mflags} && mv mtr xmtr && make distclean
%configure --without-gtk %configure --without-gtk
@ -96,6 +101,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/pixmaps/mtr_icon.xpm %{_datadir}/pixmaps/mtr_icon.xpm
%changelog %changelog
* Mon Feb 18 2013 Adam Tkac <atkac redhat com> - 2:0.83-2
- make non-gtk version of mtr buildable
* Mon Feb 18 2013 Adam Tkac <atkac redhat com> - 2:0.83-1 * Mon Feb 18 2013 Adam Tkac <atkac redhat com> - 2:0.83-1
- update to 0.83 - update to 0.83
- patches merged - patches merged