Fedora packaging preparation
Subsystems (2)
cover Fedora packaging preparation
This patch series includes further steps towards Fedora packaging. The most notable one is moving private headers into <liburing/*.h> to prevent naming collisions with other software. Existing applications are unaffected because the public <liburing.h> header remains in its old location.
Stefan Hajnoczi (4):
pkgconfig: add missing config-host.mak dependency
spec: invoke ./configure with arguments src/Makefile: honor the caller's includedir and libdir src/Makefile: keep private headers in <liburing/*.h>
Makefile | 2 +-
examples/Makefile | 2 +-
src/Makefile | 18 +++++++++---------
test/Makefile | 2 +-
src/{ => include}/liburing.h | 6 +++---
src/{ => include/liburing}/barrier.h | 0
src/{ => include/liburing}/compat.h | 0
src/{ => include/liburing}/io_uring.h | 0
examples/io_uring-cp.c | 2 +-
examples/io_uring-test.c | 2 +-
examples/link-cp.c | 2 +-
src/queue.c | 6 +++---
src/register.c | 4 ++--
src/setup.c | 4 ++--
src/syscall.c | 4 ++--
test/cq-full.c | 2 +-
test/eeed8b54e0df-test.c | 2 +-
test/fsync.c | 2 +-
test/io_uring_enter.c | 4 ++--
test/io_uring_register.c | 2 +-
test/io_uring_setup.c | 2 +-
test/link.c | 2 +-
test/nop.c | 2 +-
test/poll-cancel.c | 2 +-
test/poll.c | 2 +-
test/ring-leak.c | 2 +-
test/send_recvmsg.c | 2 +-
test/sq-full.c | 2 +-
liburing.spec | 6 ++++--
29 files changed, 45 insertions(+), 43 deletions(-)
rename src/{ => include}/liburing.h (98%)
rename src/{ => include/liburing}/barrier.h (100%)
rename src/{ => include/liburing}/compat.h (100%)
rename src/{ => include/liburing}/io_uring.h (100%)Signature · 1 line
2.21.0
PATCH 1/4 pkgconfig: add missing config-host.mak dependency
Rebuild the .pc file when config-host.mak changes since @prefix@, @libdir@, etc could have changed.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -29,7 +29,7 @@ ifneq ($(MAKECMDGOALS),clean) include config-host.mak endif -%.pc: %.pc.in +%.pc: %.pc.in config-host.mak sed -e "s%@prefix@%$(prefix)%g" \ -e "s%@libdir@%$(libdir)%g" \ -e "s%@includedir@%$(includedir)%g" \
Signature · 1 line
2.21.0
PATCH 2/4 spec: invoke ./configure with arguments
In reply to Stefan HajnocziCommit fd26c1a2f0eb ("configure: move directory options to ./configure") moved --prefix=PREFIX and other directory options to ./configure. Invoke ./configure with these options instead of passing them to the makefile.
--- liburing.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
liburing.spec +2 -1
@@ -25,12 +25,13 @@ for the Linux-native io_uring. %setup %build +./configure --prefix=/usr --libdir=/%{_libdir} --mandir=/usr/share/man make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT prefix=/usr libdir=/%{_libdir} mandir=/usr/share/man +make install DESTDIR=$RPM_BUILD_ROOT %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
Signature · 1 line
2.21.0
PATCH 3/4 src/Makefile: honor the caller's includedir and libdir
In reply to Stefan HajnocziThe top-level makefile passes in includedir and libdir so we should not override them.
--- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/Makefile +2 -2
@@ -1,6 +1,6 @@ prefix ?= /usr -includedir=$(prefix)/include -libdir=$(prefix)/lib +includedir ?= $(prefix)/include +libdir ?= $(prefix)/lib CFLAGS ?= -g -fomit-frame-pointer -O2 override CFLAGS += -Wall -I.
Signature · 1 line
2.21.0
PATCH 4/4 src/Makefile: keep private headers in <liburing/*.h>
In reply to Stefan HajnocziIt is not possible to install barrier.h and compat.h into the top-level /usr/include directly since they are likely to conflict with other software. io_uring.h could be confused with the system's kernel header file.
Put liburing headers into <liburing/*.h> so there is no chance of conflicts or confusion.
Existing applications continue to build successfully since the location of <liburing.h> is unchanged. In-tree examples and tests require modification because src/liburing.h is moved to src/include/liburing.h.
---
examples/Makefile | 2 +-
src/Makefile | 14 +++++++-------
test/Makefile | 2 +-
src/{ => include}/liburing.h | 6 +++---
src/{ => include/liburing}/barrier.h | 0
src/{ => include/liburing}/compat.h | 0
src/{ => include/liburing}/io_uring.h | 0
examples/io_uring-cp.c | 2 +-
examples/io_uring-test.c | 2 +-
examples/link-cp.c | 2 +-
src/queue.c | 6 +++---
src/register.c | 4 ++--
src/setup.c | 4 ++--
src/syscall.c | 4 ++--
test/cq-full.c | 2 +-
test/eeed8b54e0df-test.c | 2 +-
test/fsync.c | 2 +-
test/io_uring_enter.c | 4 ++--
test/io_uring_register.c | 2 +-
test/io_uring_setup.c | 2 +-
test/link.c | 2 +-
test/nop.c | 2 +-
test/poll-cancel.c | 2 +-
test/poll.c | 2 +-
test/ring-leak.c | 2 +-
test/send_recvmsg.c | 2 +-
test/sq-full.c | 2 +-
liburing.spec | 3 ++-
28 files changed, 40 insertions(+), 39 deletions(-)
rename src/{ => include}/liburing.h (98%)
rename src/{ => include/liburing}/barrier.h (100%)
rename src/{ => include/liburing}/compat.h (100%)
rename src/{ => include/liburing}/io_uring.h (100%)examples/Makefile +1 -1
@@ -1,5 +1,5 @@ CFLAGS ?= -g -O2 -override CFLAGS += -Wall -D_GNU_SOURCE -L../src/ +override CFLAGS += -Wall -D_GNU_SOURCE -L../src/ -I../src/include/ all_targets += io_uring-test io_uring-cp link-cp
src/Makefile +7 -7
@@ -3,7 +3,7 @@ includedir ?= $(prefix)/include libdir ?= $(prefix)/lib CFLAGS ?= -g -fomit-frame-pointer -O2 -override CFLAGS += -Wall -I. +override CFLAGS += -Wall -Iinclude/ SO_CFLAGS=-shared -fPIC $(CFLAGS) L_CFLAGS=$(CFLAGS) LINK_FLAGS=
@@ -27,7 +27,7 @@ liburing_srcs := setup.c queue.c syscall.c register.c liburing_objs := $(patsubst %.c,%.ol,$(liburing_srcs)) liburing_sobjs := $(patsubst %.c,%.os,$(liburing_srcs)) -$(liburing_objs) $(liburing_sobjs): io_uring.h +$(liburing_objs) $(liburing_sobjs): include/liburing/io_uring.h %.os: %.c $(CC) $(SO_CFLAGS) -c -o $@ $<
@@ -46,10 +46,10 @@ $(libname): $(liburing_sobjs) liburing.map $(CC) $(SO_CFLAGS) -Wl,--version-script=liburing.map -Wl,-soname=$(soname) -o $@ $(liburing_sobjs) $(LINK_FLAGS) install: $(all_targets) - install -D -m 644 io_uring.h $(includedir)/io_uring.h - install -D -m 644 liburing.h $(includedir)/liburing.h - install -D -m 644 compat.h $(includedir)/compat.h - install -D -m 644 barrier.h $(includedir)/barrier.h + install -D -m 644 include/liburing/io_uring.h $(includedir)/liburing/io_uring.h + install -D -m 644 include/liburing.h $(includedir)/liburing.h + install -D -m 644 include/liburing/compat.h $(includedir)/liburing/compat.h + install -D -m 644 include/liburing/barrier.h $(includedir)/liburing/barrier.h install -D -m 644 liburing.a $(libdir)/liburing.a ifeq ($(ENABLE_SHARED),1) install -D -m 755 $(libname) $(libdir)/$(libname)
@@ -57,7 +57,7 @@ ifeq ($(ENABLE_SHARED),1) ln -sf $(libname) $(libdir)/liburing.so endif -$(liburing_objs): liburing.h +$(liburing_objs): include/liburing.h clean: rm -f $(all_targets) $(liburing_objs) $(liburing_sobjs) $(soname).new
test/Makefile +1 -1
@@ -1,5 +1,5 @@ CFLAGS ?= -g -O2 -override CFLAGS += -Wall -D_GNU_SOURCE -L../src/ +override CFLAGS += -Wall -D_GNU_SOURCE -L../src/ -I../src/include/ all_targets += poll poll-cancel ring-leak fsync io_uring_setup io_uring_register \ io_uring_enter nop sq-full cq-full 35fa71a030ca-test \
src/include/liburing.h renamed from src/liburing.h +3 -3
@@ -9,9 +9,9 @@ extern "C" {#include <signal.h> #include <string.h> #include <inttypes.h> -#include "compat.h" -#include "io_uring.h" -#include "barrier.h" +#include "liburing/compat.h" +#include "liburing/io_uring.h" +#include "liburing/barrier.h" /* * Library interface to io_uring
src/include/liburing/barrier.h renamed from src/barrier.h +0 -0
src/include/liburing/compat.h renamed from src/compat.h +0 -0
src/include/liburing/io_uring.h renamed from src/io_uring.h +0 -0
examples/io_uring-cp.c +1 -1
@@ -12,7 +12,7 @@#include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "../src/liburing.h" +#include "liburing.h" #define QD 64#define BS (32*1024)
examples/io_uring-test.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <stdlib.h> #include <unistd.h> -#include "../src/liburing.h" +#include "liburing.h" #define QD 4
examples/link-cp.c +1 -1
@@ -13,7 +13,7 @@#include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> -#include "../src/liburing.h" +#include "liburing.h" #define QD 64#define BS (32*1024)
src/queue.c +3 -3
@@ -6,10 +6,10 @@#include <string.h> #include <stdbool.h> -#include "compat.h" -#include "io_uring.h" +#include "liburing/compat.h" +#include "liburing/io_uring.h" #include "liburing.h" -#include "barrier.h" +#include "liburing/barrier.h" static int __io_uring_get_cqe (struct io_uring *ring,struct io_uring_cqe **cqe_ptr,int wait)
src/register.c +2 -2
@@ -5,8 +5,8 @@#include <errno.h> #include <string.h> -#include "compat.h" -#include "io_uring.h" +#include "liburing/compat.h" +#include "liburing/io_uring.h" #include "liburing.h" int io_uring_register_buffers(struct io_uring *ring, const struct iovec *iovecs,
src/setup.c +2 -2
@@ -5,8 +5,8 @@#include <errno.h> #include <string.h> -#include "compat.h" -#include "io_uring.h" +#include "liburing/compat.h" +#include "liburing/io_uring.h" #include "liburing.h" static int io_uring_mmap(int fd, struct io_uring_params *p,
src/syscall.c +2 -2
@@ -5,8 +5,8 @@#include <sys/syscall.h> #include <sys/uio.h> #include <signal.h> -#include "compat.h" -#include "io_uring.h" +#include "liburing/compat.h" +#include "liburing/io_uring.h" #ifdef __alpha__/*
test/cq-full.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" static int queue_n_nops (struct io_uring *ring,int n) {
test/eeed8b54e0df-test.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" #define BLOCK 4096
test/fsync.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" static int test_single_fsync (struct io_uring *ring) {
test/io_uring_enter.c +2 -2
@@ -22,8 +22,8 @@#include <sys/resource.h> #include <limits.h> #include <sys/time.h> -#include "../src/liburing.h" -#include "../src/barrier.h" +#include "liburing.h" +#include "liburing/barrier.h" #define IORING_MAX_ENTRIES 4096
test/io_uring_register.c +1 -1
@@ -21,7 +21,7 @@#include <sys/time.h> #include <sys/resource.h> #include <limits.h> -#include "../src/liburing.h" +#include "liburing.h" static int pagesize;static rlim_t mlock_limit;
test/io_uring_setup.c +1 -1
@@ -13,7 +13,7 @@#include <unistd.h> #include <errno.h> #include <sys/sysinfo.h> -#include "../src/liburing.h" +#include "liburing.h" /* * Attempt the call with the given args. Return 0 when expect matches
test/link.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" /* * Test failing head of chain, and dependent getting -ECANCELED
test/nop.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" static int test_single_nop (struct io_uring *ring) {
test/poll-cancel.c +1 -1
@@ -12,7 +12,7 @@#include <sys/wait.h> #include <sys/signal.h> -#include "../src/liburing.h" +#include "liburing.h" struct poll_data {unsigned is_poll;
test/poll.c +1 -1
@@ -11,7 +11,7 @@#include <sys/poll.h> #include <sys/wait.h> -#include "../src/liburing.h" +#include "liburing.h" static void sig_alrm (int sig) {
test/ring-leak.c +1 -1
@@ -21,7 +21,7 @@#include <string.h> #include <linux/fs.h> -#include "../src/liburing.h" +#include "liburing.h" static int __io_uring_register_files (int ring_fd,int fd1,int fd2) {
test/send_recvmsg.c +1 -1
@@ -9,7 +9,7 @@#include <sys/types.h> #include <sys/socket.h> -#include "../src/liburing.h" +#include "liburing.h" static char str[] ="This is a test of sendmsg and recvmsg over io_uring!" ;
test/sq-full.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <fcntl.h> -#include "../src/liburing.h" +#include "liburing.h" int main (int argc,char *argv[]) {
liburing.spec +2 -1
@@ -47,7 +47,8 @@ make install DESTDIR=$RPM_BUILD_ROOT %files devel %defattr(-,root,root) -%attr(0644,root,root) %{_includedir}/* +%attr(0755,root,root) %{_includedir}/liburing/* +%attr(0644,root,root) %{_includedir}/liburing.h %attr(0755,root,root) %{_libdir}/liburing.so %attr(0644,root,root) %{_libdir}/liburing.a %attr(0644,root,root) %{_libdir}/pkgconfig/*
Signature · 1 line
2.21.0
Quoted 4 lines · Stefan Hajnoczi
This patch series includes further steps towards Fedora packaging. The most notable one is moving private headers into <liburing/*.h> to prevent naming collisions with other software. Existing applications are unaffected because the public <
liburing.h> header remains in its old location.
Applied, thanks.
Signature · 1 line
Jens Axboe