File iouyap.spec of Package iouyap
#
# spec file for package iouyap
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: iouyap
Version: 0.95
Release: 0
Summary: Bridge IOU to TAP, UDP and Ethernet
License: GPL-3.0+
Group: System/Emulators/Other
Url: https://github.com/GNS3/iouyap
Source0: %{name}-%{version}.tar.gz
Patch0: %{name}-0.95_buff_overflow.patch
Patch1: %{name}-0.95_log_error.patch
Patch2: %{name}-0.95_fix_packet_mem_corruption.patch
Patch3: %{name}-0.95_fix_ownership.patch
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: libiniparser-devel
%if 0%{?suse_version}
Requires(pre): permissions
%endif
Requires(pre): %{_sbindir}/groupadd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Bridge IOU to TAP, UDP and Ethernet, mainly used by gns3server
In order to use iouyap as non-root user, the user needs to be member of the iouyap group!
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
bison --yacc -dv netmap_parse.y
flex netmap_scan.l
gcc -I -Wall -fPIE %optflags *.c -o %{name} -liniparser -lpthread -pie
%install
%__mkdir_p %{buildroot}/%{_libexecdir}
%__mkdir_p %{buildroot}/%{_bindir}
%__mv %{name} %{buildroot}/%{_libexecdir}
ln -sf %{_libexecdir}/%{name} %{buildroot}/%{_bindir}/%{name}
%pre
%{_sbindir}/groupadd -r iouyap 2> /dev/null || :
%if 0%{?suse_version}
%post
%set_permissions %{_libexecdir}/%{name}
%verifyscript
%verify_permissions -e %{_libexecdir}/%{name}
%endif
%files
%defattr(-,root,root)
%doc LICENSE README.md
%verify(not caps) %attr(0750,root,iouyap) %{_libexecdir}/%{name}
%{_bindir}/%{name}
%changelog