summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:10:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:10:00 +0000
commit4ba2b326284765e942044db13a7f0dae702bec93 (patch)
treecbdfaec33eed4f3a970c54cd10e8ddfe3003b3b1 /packaging
parentInitial commit. (diff)
downloadxdp-tools-upstream.tar.xz
xdp-tools-upstream.zip
Adding upstream version 1.3.1.upstream/1.3.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/rpm/README.org141
-rw-r--r--packaging/rpm/xdp-tools.spec164
2 files changed, 305 insertions, 0 deletions
diff --git a/packaging/rpm/README.org b/packaging/rpm/README.org
new file mode 100644
index 0000000..8a6561f
--- /dev/null
+++ b/packaging/rpm/README.org
@@ -0,0 +1,141 @@
+#+OPTIONS: ^:nil
+
+* Releasing and packaging a new version of xdp-tools
+
+These are the steps needed to release a new version of xdp-tools. If any of the
+steps fail, go back and fix the error, then start over from the appropriate
+step.
+
+If the fix requires changes to the sources, commit those, then rewrite the
+commit made in (1.) on top of this and start over from the beginning. This
+ensures that we don't end up with a whole series of package revisions just to
+fix minor errors.
+
+
+** Steps
+
+To release a new version of xdp-tools, follow these steps:
+
+1. Make sure you have valid Kerberos tickets exist for the Fedora and RHEL
+ infrastructure:
+
+ #+begin_src sh
+ kinit <username>@FEDORAPROJECT.ORG
+ kinit <username>@REDHAT.COM
+ #+end_src
+
+2. Checkout this git repository as well as the RHEL and Fedora dist-git's.
+ Also, make sure you move to the correct branch for RHEL and Fedora.
+ Below is an example of how you could do this:
+
+ #+begin_src sh
+ export VERSION="<version, for example 1.0.0~beta3>"
+ mkdir release_$VERSION
+ cd release_$VERSION
+ git clone git@github.com:xdp-project/xdp-tools.git
+ cd xdp-tools
+ export XDP_TOOLS_DIR=$(pwd)
+
+ rhpkg clone xdp-tools xdp-tools-RHEL
+ cd xdp-tools-RHEL
+ rhpkg switch-branch -l
+ rhpkg switch-branch rhel-8.3.0
+ export RHEL_DISTGIT_DIR=$(pwd)
+ cd ..
+
+ fedpkg clone xdp-tools xdp-tools-FEDORA
+ cd xdp-tools-FEDORA
+ fedpkg switch-branch -l
+ export FEDORA_DISTGIT_DIR=$(pwd)
+ cd ..
+ #+end_src
+
+3. Bump version in =version.mk= and =packacing/rpm/xdp-tools.spec= -- don't
+ forget a changelog entry in the latter.
+
+ Commit this, bug don't tag and push until the rest of the steps below
+ completed successfully.
+
+4. Run =make archive= to generate a source tarball (xdp-tools-$VERSION.tar.gz).
+ #+begin_src sh
+ cd $XDP_TOOLS_DIR
+ git submodule init
+ git submodule update
+ make archive
+ #+end_src
+
+5. Copy source tarball to =~/rpmbuild/SOURCES=.
+ #+begin_src sh
+ mkdir -p ~/rpmbuild/SOURCES/
+ cp ./xdp-tools-$VERSION.tar.gz ~/rpmbuild/SOURCES/
+ #+end_src
+
+6. Build local package using =rpmbuild -ba packaging/rpm/xdp-tools.spec=.
+
+7. Check that building a scratch build on Fedora infrastructure works:
+ =cd $FEDORA_DISTGIT_DIR && fedpkg scratch-build --srpm ~/rpmbuild/SRPMS/xdp-tools-$VERSION.fcXX.src.rpm=
+
+7. Sync the xdp-tools.spec file to dist-git (but don't commit anything yet):
+ - For both RHEL and Fedora, copy over the new version, then manually inspect
+ the git diff and revert any changes that undo previous modifications in
+ that distro. For Fedora, this is mainly changelog entries by rebuild bots,
+ and for RHEL it's mainly the changelog, the =__brp_strip= defines and the
+ symlinks to earlier .so versions for libxdp.
+ - For RHEL also manually create a new symlink entry to the previous .so-version
+ and add it to the file list.
+
+ Make sure to be on the right branch in each dist-git.
+
+8. Create an SRPM and scratch build for RHEL (in RHEL dist-git directory):
+ #+begin_src sh
+ cd $RHEL_DISTGIT_DIR
+ cp ~/rpmbuild/SOURCES/xdp-tools-$VERSION.tar.gz .
+ rhpkg srpm
+ rhpkg scratch-build --srpm xdp-tools-$VERSION.el8.src.rpm
+ #+end_src
+
+9. Upload new sources files to both Fedora and RHEL - this will also update
+ the 'sources' file in each directory, which is why we didn't commit
+ anything earlier:
+ #+begin_src sh
+ cd $FEDORA_DISTGIT_DIR
+ fedpkg new-sources ~/rpmbuild/SOURCES/xdp-tools-$VERSION.tar.gz
+ git add xdp-tools.spec
+ git commit
+
+ cd $RHEL_DISTGIT_DIR
+ rhpkg new-sources ~/rpmbuild/SOURCES/xdp-tools-$VERSION.tar.gz
+ git add xdp-tools.spec
+ git commit
+ #+end_src
+
+ For both, check the git history for commit message inspiration. In
+ particular, to be accepted into the RHEL dist-git, the commit message must
+ reference a valid Bugzilla ID. See the commit log for earlier commits for
+ syntax for this.
+
+10. Push the dist-git repositories and request builds for each:
+ #+begin_src sh
+ cd $FEDORA_DISTGIT_DIR
+ git push
+ fedpkg build
+
+ cd $RHEL_DISTGIT_DIR
+ git push
+ rhpkg build
+ #+end_src
+
+11. Tag the commit in the xdp-tools repo and push the branch and tags to github.
+ Tag syntax is =v$VERSION=, where =~betaX= becomes =-betaX= (git doesn't
+ allow tildes in tag names).
+
+12. Wait for the CI gating emails to tick in. Check any failures in the CI
+ dashboard and waive and/or fix as necessary. Then talk to QE to have them
+ run the =manual.sst_networking.xdp-tools.tier1= tests and mark it as
+ completed; this will cause the build to be tagged rhel-$VERSION-candidate (from
+ rhel-$VERSION-gate) and allow it to proceed.
+
+13. Add the new build to the errata; this may entail moving the errata status
+ back to =NEW_FILES=. After adding the new build, it should be moved to QE
+ state; if this is not immediately possible, just resolve any issues blocking
+ it.
diff --git a/packaging/rpm/xdp-tools.spec b/packaging/rpm/xdp-tools.spec
new file mode 100644
index 0000000..701c69f
--- /dev/null
+++ b/packaging/rpm/xdp-tools.spec
@@ -0,0 +1,164 @@
+Name: xdp-tools
+Version: 1.3.1
+Release: 1%{?dist}
+Summary: Utilities and example programs for use with XDP
+%global _soversion 1.3.0
+
+License: GPLv2
+URL: https://github.com/xdp-project/%{name}
+Source0: https://github.com/xdp-project/%{name}/releases/download/v%{version}/xdp-tools-%{version}.tar.gz
+
+BuildRequires: libbpf-devel
+BuildRequires: elfutils-libelf-devel
+BuildRequires: zlib-devel
+BuildRequires: libpcap-devel
+BuildRequires: clang >= 10.0.0
+BuildRequires: llvm >= 10.0.0
+BuildRequires: make
+BuildRequires: gcc
+BuildRequires: pkgconfig
+BuildRequires: m4
+BuildRequires: emacs-nox
+BuildRequires: wireshark-cli
+BuildRequires: bpftool
+
+ExcludeArch: i386 i686
+
+# Always keep xdp-tools and libxdp packages in sync
+Requires: libxdp = %{version}-%{release}
+
+# find-debuginfo produces empty debugsourcefiles.list
+# disable the debug package to avoid rpmbuild error'ing out because of this
+%global debug_package %{nil}
+%global _hardened_build 1
+
+%description
+Utilities and example programs for use with XDP
+
+%package -n libxdp
+Summary: XDP helper library
+Requires: kernel-headers
+
+%package -n libxdp-devel
+Summary: Development files for libxdp
+Requires: kernel-headers
+Requires: libxdp = %{version}-%{release}
+
+%package -n libxdp-static
+Summary: Static library files for libxdp
+Requires: kernel-headers
+Requires: libxdp-devel = %{version}-%{release}
+
+%description -n libxdp
+The libxdp package contains the libxdp library for managing XDP programs,
+used by the %{name} package
+
+%description -n libxdp-devel
+The libxdp-devel package contains headers used for building XDP programs using
+libxdp.
+
+%description -n libxdp-static
+The libxdp-static package contains the static library version of libxdp.
+
+%prep
+%autosetup -p1 -n %{name}-%{version}
+
+
+%build
+export CFLAGS='%{build_cflags}'
+export LDFLAGS='%{build_ldflags}'
+export LIBDIR='%{_libdir}'
+export RUNDIR='%{_rundir}'
+export CLANG=%{_bindir}/clang
+export LLC=%{_bindir}/llc
+export PRODUCTION=1
+export DYNAMIC_LIBXDP=1
+export FORCE_SYSTEM_LIBBPF=1
+export FORCE_EMACS=1
+./configure
+make %{?_smp_mflags} V=1
+
+%install
+export DESTDIR='%{buildroot}'
+export SBINDIR='%{_sbindir}'
+export LIBDIR='%{_libdir}'
+export RUNDIR='%{_rundir}'
+export MANDIR='%{_mandir}'
+export DATADIR='%{_datadir}'
+export HDRDIR='%{_includedir}/xdp'
+make install V=1
+
+%files
+%{_sbindir}/xdp-filter
+%{_sbindir}/xdp-loader
+%{_sbindir}/xdpdump
+%{_sbindir}/xdp-bench
+%{_sbindir}/xdp-monitor
+%{_sbindir}/xdp-trafficgen
+%{_mandir}/man8/*
+%{_libdir}/bpf/xdpfilt_*.o
+%{_libdir}/bpf/xdpdump_*.o
+%{_datadir}/xdp-tools/
+%license LICENSES/*
+
+%files -n libxdp
+%{_libdir}/libxdp.so.1
+%{_libdir}/libxdp.so.%{_soversion}
+%{_libdir}/bpf/xdp-dispatcher.o
+%{_libdir}/bpf/xsk_def_xdp_prog*.o
+%{_mandir}/man3/*
+%license LICENSES/*
+
+%files -n libxdp-static
+%{_libdir}/libxdp.a
+
+%files -n libxdp-devel
+%{_includedir}/xdp/*.h
+%{_libdir}/libxdp.so
+%{_libdir}/pkgconfig/libxdp.pc
+
+%changelog
+* Thu Feb 23 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.3.1-1
+- Upstream version bump
+
+* Tue Feb 7 2023 Toke Høiland-Jørgensen <toke@redhat.com> 1.3.0-1
+- Upstream version bump
+
+* Thu Jan 20 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.2-1
+- Upstream version bump
+
+* Thu Jan 13 2022 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.1-1
+- Upstream version bump
+
+* Wed Jul 7 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.2.0-1
+- Upstream version bump
+
+* Wed Feb 3 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.1-1
+- Upstream version bump
+
+* Mon Jan 4 2021 Toke Høiland-Jørgensen <toke@redhat.com> 1.1.0-1
+- Upstream version bump
+
+* Thu Aug 20 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.1-1
+- Upstream version bump
+
+* Tue Aug 18 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.0-1
+- Upstream version bump
+
+* Wed Jul 15 2020 Eelco Chaudron <echaudro@redhat.com> 1.0.0~beta3-0.1
+- Upstream version bump
+
+* Fri Jul 10 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.0~beta2-0.1
+- Upstream version bump
+
+* Mon Jun 15 2020 Toke Høiland-Jørgensen <toke@redhat.com> 1.0.0~beta1-0.1
+- Upstream version bump
+
+* Mon Apr 6 2020 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.3-1
+- Upstream update, add libxdp sub-packages
+
+* Thu Nov 21 2019 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.2-1
+- Upstream update
+
+* Fri Nov 8 2019 Toke Høiland-Jørgensen <toke@redhat.com> 0.0.1-1
+- Initial release