Skip to content

Commit

Permalink
Oracle changes #1421
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Sacco committed Mar 19, 2024
1 parent a6590b6 commit 2105d61
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 1 deletion.
1 change: 1 addition & 0 deletions libtins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.cmake
5 changes: 5 additions & 0 deletions libtins/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile for Any Package
#

include unibuild/unibuild.make
Binary file added libtins/libtins-4.2.tar.gz
Binary file not shown.
94 changes: 94 additions & 0 deletions libtins/unibuild-packaging/rpm/libtins.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# RPM Spec for libtins
#

%define short tins

Name: lib%{short}
Version: 4.2
Release: 1%{?dist}
Summary: C++ library for manipulating raw network packets
License: BSD-2-Clause

BuildArch: %(uname -m)
Group: System/Libraries
Provides: %{name} = %{version}-%{release}
Prefix: %{_prefix}

# Whoever produces this does a good job staying anonymous
# Vendor:
URL: http://libtins.github.io/
Source: %{name}-%{version}.tar.gz

Requires: libpcap
Requires: openssl

BuildRequires: cmake
BuildRequires: pkgconfig
BuildRequires: gcc-c++
BuildRequires: libpcap-devel
BuildRequires: openssl-devel


%description
The library's main purpose is to provide the C++ developer an easy,
efficient, platform and endianess-independent way to create tools which
need to send, receive and manipulate specially crafted packets.


# Don't need this.
%global debug_package %{nil}


%prep
%setup -q


%build
mkdir build
cd build
cmake ../ \
-DLIBTINS_ENABLE_CXX11=1 \
"-DCMAKE_INSTALL_PREFIX=${RPM_BUILD_ROOT}/%{_usr}"
make


%install
cd build
%makeinstall

# This is unneeded
rm -rf "${RPM_BUILD_ROOT}/%{_usr}/lib/cmake"

# RPM wants it elsewhere.
mv "${RPM_BUILD_ROOT}/%{_usr}/lib" "${RPM_BUILD_ROOT}/%{_libdir}"

# The build process leaves some paths from the build around.
fgrep -lr "${RPM_BUILD_ROOT}" "${RPM_BUILD_ROOT}" \
| xargs sed -i -e "s|${RPM_BUILD_ROOT}||g"



%files
%defattr(-,root,root)
%license LICENSE
%{_libdir}/%{name}.so*
%{_libdir}/pkgconfig/*


#
# Development Subpackage
#

%package -n %{name}-devel
Summary: Header files for %{name} development
Group: Development/Libraries
Provides: %{name}-devel = %{version}-%{release}
Requires: %{name} = %{version}-%{release}

%description -n %{name}-devel
Header files for %{name} development

%files -n %{name}-devel
%defattr(-,root,root)
%{_includedir}/%{short}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ make CLASSES="%{_pscheduler_classes}"


%install
python setup.py install --root=$RPM_BUILD_ROOT -O1 --record=INSTALLED_FILES
%{_pscheduler_python} setup.py install --root=$RPM_BUILD_ROOT -O1 --record=INSTALLED_FILES

mkdir -p $RPM_BUILD_ROOT/%{logrotate_d}
cat > $RPM_BUILD_ROOT/%{logrotate_d}/%{name} <<EOF
Expand Down

0 comments on commit 2105d61

Please sign in to comment.