diff --git a/libnetfilter_queue-linuxtypes.patch b/libnetfilter_queue-linuxtypes.patch new file mode 100644 index 0000000..372b600 --- /dev/null +++ b/libnetfilter_queue-linuxtypes.patch @@ -0,0 +1,12 @@ +diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c +index af224de..be72974 100644 +--- a/utils/nfqnl_test.c ++++ b/utils/nfqnl_test.c +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + #include /* for NF_ACCEPT */ + + #include diff --git a/libnetfilter_queue-sysheader.patch b/libnetfilter_queue-sysheader.patch new file mode 100644 index 0000000..8951bd2 --- /dev/null +++ b/libnetfilter_queue-sysheader.patch @@ -0,0 +1,127 @@ +diff --git a/include/libnetfilter_queue/Makefile.am b/include/libnetfilter_queue/Makefile.am +index b0f214b..fc9a2f6 100644 +--- a/include/libnetfilter_queue/Makefile.am ++++ b/include/libnetfilter_queue/Makefile.am +@@ -1,3 +1,3 @@ + +-pkginclude_HEADERS = libnetfilter_queue.h libipq.h linux_nfnetlink_queue.h ++pkginclude_HEADERS = libnetfilter_queue.h libipq.h + +diff --git a/include/libnetfilter_queue/libnetfilter_queue.h b/include/libnetfilter_queue/libnetfilter_queue.h +index 6695c3d..fafcc18 100644 +--- a/include/libnetfilter_queue/libnetfilter_queue.h ++++ b/include/libnetfilter_queue/libnetfilter_queue.h +@@ -14,9 +14,12 @@ + #define __LIBCTNETLINK_H + + #include +-// #include + +-#include ++#ifndef aligned_be64 ++#define aligned_be64 __be64 __attribute__((aligned(8))) ++#endif ++ ++#include + + struct nfq_handle; + struct nfq_q_handle; +diff --git a/include/libnetfilter_queue/linux_nfnetlink_queue.h b/include/libnetfilter_queue/linux_nfnetlink_queue.h +deleted file mode 100644 +index 191b094..0000000 +--- a/include/libnetfilter_queue/linux_nfnetlink_queue.h ++++ /dev/null +@@ -1,93 +0,0 @@ +-#ifndef _NFNETLINK_QUEUE_H +-#define _NFNETLINK_QUEUE_H +- +-#ifndef aligned_u64 +-#define aligned_u64 unsigned long long __attribute__((aligned(8))) +-#endif +- +-#include +- +-enum nfqnl_msg_types { +- NFQNL_MSG_PACKET, /* packet from kernel to userspace */ +- NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ +- NFQNL_MSG_CONFIG, /* connect to a particular queue */ +- +- NFQNL_MSG_MAX +-}; +- +-struct nfqnl_msg_packet_hdr { +- u_int32_t packet_id; /* unique ID of packet in queue */ +- u_int16_t hw_protocol; /* hw protocol (network order) */ +- u_int8_t hook; /* netfilter hook */ +-} __attribute__ ((packed)); +- +-struct nfqnl_msg_packet_hw { +- u_int16_t hw_addrlen; +- u_int16_t _pad; +- u_int8_t hw_addr[8]; +-} __attribute__ ((packed)); +- +-struct nfqnl_msg_packet_timestamp { +- aligned_u64 sec; +- aligned_u64 usec; +-} __attribute__ ((packed)); +- +-enum nfqnl_attr_type { +- NFQA_UNSPEC, +- NFQA_PACKET_HDR, +- NFQA_VERDICT_HDR, /* nfqnl_msg_verdict_hrd */ +- NFQA_MARK, /* u_int32_t nfmark */ +- NFQA_TIMESTAMP, /* nfqnl_msg_packet_timestamp */ +- NFQA_IFINDEX_INDEV, /* u_int32_t ifindex */ +- NFQA_IFINDEX_OUTDEV, /* u_int32_t ifindex */ +- NFQA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */ +- NFQA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */ +- NFQA_HWADDR, /* nfqnl_msg_packet_hw */ +- NFQA_PAYLOAD, /* opaque data payload */ +- +- __NFQA_MAX +-}; +-#define NFQA_MAX (__NFQA_MAX - 1) +- +-struct nfqnl_msg_verdict_hdr { +- u_int32_t verdict; +- u_int32_t id; +-} __attribute__ ((packed)); +- +- +-enum nfqnl_msg_config_cmds { +- NFQNL_CFG_CMD_NONE, +- NFQNL_CFG_CMD_BIND, +- NFQNL_CFG_CMD_UNBIND, +- NFQNL_CFG_CMD_PF_BIND, +- NFQNL_CFG_CMD_PF_UNBIND, +-}; +- +-struct nfqnl_msg_config_cmd { +- u_int8_t command; /* nfqnl_msg_config_cmds */ +- u_int8_t _pad; +- u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ +-} __attribute__ ((packed)); +- +-enum nfqnl_config_mode { +- NFQNL_COPY_NONE, +- NFQNL_COPY_META, +- NFQNL_COPY_PACKET, +-}; +- +-struct nfqnl_msg_config_params { +- u_int32_t copy_range; +- u_int8_t copy_mode; /* enum nfqnl_config_mode */ +-} __attribute__ ((packed)); +- +- +-enum nfqnl_attr_config { +- NFQA_CFG_UNSPEC, +- NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ +- NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ +- NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */ +- __NFQA_CFG_MAX +-}; +-#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) +- +-#endif /* _NFNETLINK_QUEUE_H */ diff --git a/libnetfilter_queue.spec b/libnetfilter_queue.spec index 7d937ea..6618920 100644 --- a/libnetfilter_queue.spec +++ b/libnetfilter_queue.spec @@ -1,14 +1,17 @@ Name: libnetfilter_queue Version: 0.0.15 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Netfilter queue userspace library Group: System Environment/Libraries License: GPL URL: http://netfilter.org Source0: http://netfilter.org/projects/%{name}/files/%{name}-%{version}.tar.bz2 +Patch0: libnetfilter_queue-linuxtypes.patch +Patch1: libnetfilter_queue-sysheader.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: libnfnetlink-devel, pkgconfig +BuildRequires: libnfnetlink-devel, pkgconfig, kernel-headers +BuildRequires: autoconf, automake, libtool %description libnetfilter_queue is a userspace library providing an API to packets that have @@ -21,6 +24,7 @@ libnetfilter_queue has been previously known as libnfnetlink_queue. Summary: Netfilter queue userspace library Group: Development/Libraries Requires: %{name} = %{version}-%{release}, pkgconfig +Requires: libnfnetlink-devel, kernel-headers %description devel libnetfilter_queue is a userspace library providing an API to packets that have @@ -31,13 +35,17 @@ libnetfilter_queue has been previously known as libnfnetlink_queue. %prep %setup -q +%patch -p1 +%patch1 -p1 + +autoreconf -i --force %build %configure --disable-static --disable-rpath # kill the rpaths -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} @@ -65,6 +73,15 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/%{name}.pc %changelog +* Fri Feb 22 2008 Paul P Komkoff Jr - 0.0.15-4 +- use system header instead of bundled one + +* Fri Feb 22 2008 Paul P Komkoff Jr - 0.0.15-3 +- fix compilation with newer glibc/headers/whatever + +* Tue Feb 19 2008 Fedora Release Engineering - 0.0.15-2 +- Autorebuild for GCC 4.3 + * Tue Sep 18 2007 Paul P Komkoff Jr - 0.0.15-1 - new upstream version