Skip to content

Commit 920c3fc

Browse files
authored
Merge pull request #414 from sc108-lee/rpm
rpmbuild: Enable 'make rpm' to build rpm pkgs #408
2 parents f4ebcff + f4aac94 commit 920c3fc

3 files changed

Lines changed: 17 additions & 18 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ a.out
66
*.swp
77
*.a
88
*.so.*
9-
9+
*.tar.gz
1010
cscope.*
1111

1212
.build

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ test: ${BUILD-DIR}
3939
ninja -C ${BUILD-DIR} $@
4040

4141
.PHONY: rpm
42-
rpm: dist
43-
rpmbuild -ba ${BUILD-DIR}/libnvme.spec
42+
rpm: ${BUILD-DIR}
43+
git archive --format=tar HEAD > libnvme.tar
44+
tar rf libnvme.tar ${BUILD-DIR}/libnvme.spec
45+
gzip -f -9 libnvme.tar
46+
rpmbuild -ta libnvme.tar.gz -v

libnvme.spec.in

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ Release: 0
44
Summary: Linux-native nvme device management library
55

66
License: @LICENSE@
7-
Source: %{name}-%{version}.tar.gz
7+
Source: libnvme.tar.gz
88
BuildRoot: %{_tmppath}/%{name}-root
99
URL: http://github.com/linux-nvme/libnvme
1010

11-
BuildRequires: libuuid-devel
12-
BuildRequires: meson
13-
BuildRequires: gcc
14-
1511
%description
1612
Provides library functions for accessing and managing nvme devices on a Linux
1713
system.
@@ -29,29 +25,29 @@ for Linux-native nvme device maangement.
2925
%autosetup -c
3026

3127
%build
32-
%meson
33-
%meson_build
28+
meson .build -Ddocs=man -Ddocs-build=true -Ddefault_library=both
3429

3530
%install
36-
%meson_install
37-
38-
%check
39-
%meson_test
31+
cd .build
32+
meson install --destdir %{buildroot} --skip-subprojects
4033

4134
%files
4235
%defattr(-,root,root)
43-
%attr(0755,root,root) %{_libdir}/libnvme.so.*
36+
%attr(0755,root,root) %{_libdir}/libnvme*
4437
%doc COPYING
4538

4639
%files devel
4740
%defattr(-,root,root)
4841
%attr(-,root,root) %{_includedir}/nvme/
49-
%attr(0644,root,root) %{_includedir}/libnvme.h
50-
%attr(0755,root,root) %{_libdir}/libnvme.so
51-
%attr(0644,root,root) %{_libdir}/libnvme.a
42+
%attr(0644,root,root) %{_includedir}/libnvme*
43+
%attr(0755,root,root) %{_libdir}/libnvme*
5244
%attr(0644,root,root) %{_libdir}/pkgconfig/*
5345
%attr(0644,root,root) %{_mandir}/man2/*
5446

5547
%changelog
48+
* Wed Jul 13 2022 Steven Seungcheol Lee <[email protected]>
49+
- Enable building rpm
50+
- meson is needed higher version then what rpm repo offering (use pip install)
51+
5652
* Thu Dec 12 2019 Keith Busch <[email protected]> - 0.1
5753
- Initial version

0 commit comments

Comments
 (0)