Skip to content

Commit b6d515f

Browse files
odivladalon-grinshpoon
authored andcommitted
RPM packaging and DESTDIR fix
update README with rpm build instructions specfile exhacements fixed DESTDIR in kernel mode installation Initial RPM spec for libxio Change-Id: Id6499be813e15f384c5cfc281a8792dd6b91471d
1 parent 15eecf8 commit b6d515f

File tree

3 files changed

+130
-5
lines changed

3 files changed

+130
-5
lines changed

README

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ to build the library follow the following steps:
6464
- run make
6565
- follow examples in ./examples/
6666

67+
to build rpm package, execute:
68+
$ ACCELIO_VERSION=1.6 #if version if higher, change the value
69+
$ git archive --format=tar --prefix=accelio-$ACCELIO_VERSION/ HEAD > ~/rpmbuild/SOURCES/v$ACCELIO_VERSION.tar.gz
70+
$ rpmbuild -ba libxio.spec
71+
72+
- you can add flags to rpmbuild command:
73+
--with devel_mode # it will remove ./configure flags `--enable-stat-counters=no` and `--enable-extra-checks=no`.
74+
--without kmod # it will not build libxio as a kernel module
75+
6776
Examples
6877
--------
6978

libxio.spec

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
%bcond_with devel_mode
2+
%bcond_without kmod
3+
%define debug_package %{nil}
4+
5+
Name: libxio
6+
Version: 1.6
7+
Release: 2%{?dist}
8+
Summary: Accelio - The Open Source I/O, Message, and RPC Acceleration Library
9+
10+
Group: System Environment/Libraries
11+
License: GPLv2 or BSD
12+
Url: http://www.accelio.org/
13+
Source: http://github.com/accelio/accelio/archive/v%{version}.tar.gz
14+
15+
BuildRequires: autoconf, libtool
16+
BuildRequires: numactl-devel, libaio-devel, libibverbs-devel, librdmacm-devel
17+
%if %{with kmod}
18+
BuildRequires: kernel-devel
19+
%endif
20+
21+
%description
22+
Accelio provides an easy-to-use, reliable, scalable,
23+
and high performance data/message delivery middleware
24+
that maximizes the efficiency of modern CPU and NIC hardware
25+
and that reduces time-to-market of new scale-out applications.
26+
27+
28+
%package devel
29+
Summary: Development files for the libxio library
30+
Group: System Environment/Libraries
31+
Requires: %{name} = %{version}-%{release} libibverbs-devel%{?_isa}
32+
33+
%description devel
34+
Development files for the libxio library.
35+
36+
%if 0%{with kmod}
37+
%package kmod
38+
Summary: Accelio Kernel Modules
39+
Group: System Environment/Libraries
40+
41+
%description kmod
42+
Accelio Kernel Modules
43+
%endif
44+
45+
46+
%prep
47+
%setup -q -n accelio-%{version}
48+
49+
%build
50+
./autogen.sh
51+
52+
%configure \
53+
--disable-static \
54+
%if 0%{with kmod}
55+
--enable-kernel-module \
56+
%endif
57+
%if 0%{without devel_mode}
58+
--enable-stat-counters=no \
59+
--enable-extra-checks=no \
60+
%endif
61+
62+
make %{?_smp_mflags}
63+
64+
65+
%install
66+
make DESTDIR=%{buildroot} install
67+
68+
# remove unpackaged files from the buildroot
69+
find %{buildroot} -name '*.la' -exec rm -f {} ';'
70+
71+
72+
%files
73+
%if 0%{without kmod}
74+
%{_bindir}/*
75+
%{_libdir}/libxio.so*
76+
%{_libdir}/libraio.so*
77+
%endif
78+
%doc AUTHORS COPYING README
79+
80+
%files devel
81+
%if 0%{with kmod}
82+
/opt/*
83+
%else
84+
%{_includedir}/*
85+
%endif
86+
87+
%if 0%{with kmod}
88+
%files kmod
89+
/lib/modules/*
90+
%endif
91+
92+
%post -p /sbin/ldconfig
93+
94+
%postun -p /sbin/ldconfig
95+
96+
%if 0%{with kmod}
97+
%post kmod
98+
depmod -a
99+
100+
%postun kmod
101+
depmod -a
102+
%endif
103+
104+
105+
%changelog
106+
* Fri Jan 15 2016 Vladislav Odintsov <[email protected]> 1.6-2
107+
- Added devel mode build (enabled perfcounters and extra checks)
108+
- Added support for kernel module build
109+
110+
* Tue Nov 17 2015 Mikhail Ushanov <[email protected]> 1.6-1
111+
- Bump version accelio to 1.6
112+
113+
* Tue Nov 17 2015 Mikhail Ushanov <[email protected]> 1.5-1
114+
- Initial spec file

src/kernel/xio/Makefile.in

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ DISTFILES = Makefile.in configure.ac configure ../install-sh \
3535
../../common/xio_utils.c \
3636
../transport/xio_ktransport.c
3737

38+
#TODO: add prefix here to manage directory, where to place headers
39+
includedir = /opt/xio/include
3840
xiomoduledir = @kmoduledir@/extra/net/xio
3941

4042
xiomodule := xio_core.ko
@@ -53,12 +55,12 @@ SUBDIRS ?=`pwd`
5355

5456
install-y: all
5557
$(mkdir_p) $(DESTDIR)$(xiomoduledir)
56-
$(mkdir_p) /opt/xio/include
58+
$(mkdir_p) $(DESTDIR)$(includedir)
5759
$(INSTALL) -m 644 $(xiomodule) $(DESTDIR)$(xiomoduledir)/$(xiomodule)
58-
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/libxio.h /opt/xio/include
59-
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/xio_base.h /opt/xio/include
60-
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/xio_kernel.h /opt/xio/include
61-
$(INSTALL) -m 644 Module.symvers /opt/xio/include
60+
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/libxio.h $(DESTDIR)$(includedir)
61+
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/xio_base.h $(DESTDIR)$(includedir)
62+
$(INSTALL) -m 644 $(SUBDIRS)/../../../include/xio_kernel.h $(DESTDIR)$(includedir)
63+
$(INSTALL) -m 644 Module.symvers $(DESTDIR)$(includedir)
6264
-/sbin/depmod -a
6365

6466
uninstall-y:

0 commit comments

Comments
 (0)