]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
rpmbuild: Enable 'make rpm' to build rpm pkgs #408
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Mon, 4 Jul 2022 05:31:46 +0000 (14:31 +0900)
committerSteven Seungcheol Lee <sc108.lee@samsung.com>
Wed, 20 Jul 2022 04:27:15 +0000 (13:27 +0900)
- meson is needed higher version then what rpm repo offering (use pip install)
- Enable building static library (default: shared)
- Add gitignore since make rpm generates tar.gz (when it is failed)
- libuuid-devel dose not needed as rpm pkgs
    it could be installed as some files
    if it's not installed, will be downloaded from subprojects of meson
- gcc does not needed as rpm pkgs
    meson detect compiler with meson.get_compiler('c')

error: Failed build dependencies:
gcc is needed by libnvme-1.0-0.x86_64
libuuid-devel is needed by libnvme-1.0-0.x86_64
Makefile:43: recipe for target 'rpm' failed
make: *** [rpm] Error 1

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
.gitignore
Makefile
libnvme.spec.in

index 2b640a031674709c64c72bbf9c087802f1812a77..7266ed62b44ee399861be396d2e139bcf9a9c9a6 100644 (file)
@@ -6,7 +6,7 @@ a.out
 *.swp
 *.a
 *.so.*
-
+*.tar.gz
 cscope.*
 
 .build
index 3e0e157f70025c0f90b1fdfcd22bda84f66bcf3e..9e79fc2cab0c828d16525ceead72f0bd446ec438 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -39,5 +39,8 @@ test: ${BUILD-DIR}
        ninja -C ${BUILD-DIR} $@
 
 .PHONY: rpm
-rpm: dist
-       rpmbuild -ba ${BUILD-DIR}/libnvme.spec
+rpm: ${BUILD-DIR}
+       git archive --format=tar HEAD > libnvme.tar
+       tar rf libnvme.tar ${BUILD-DIR}/libnvme.spec
+       gzip -f -9 libnvme.tar
+       rpmbuild -ta libnvme.tar.gz -v
index 8a2e4e5375e123ff1502b179f358dbae7d79df00..ea263ce0c6fe78d03458105fd3bb392fe146b51d 100644 (file)
@@ -4,14 +4,10 @@ Release: 0
 Summary: Linux-native nvme device management library
 
 License: @LICENSE@
-Source: %{name}-%{version}.tar.gz
+Source: libnvme.tar.gz
 BuildRoot: %{_tmppath}/%{name}-root
 URL: http://github.com/linux-nvme/libnvme
 
-BuildRequires: libuuid-devel
-BuildRequires: meson
-BuildRequires: gcc
-
 %description
 Provides library functions for accessing and managing nvme devices on a Linux
 system.
@@ -29,29 +25,29 @@ for Linux-native nvme device maangement.
 %autosetup -c
 
 %build
-%meson
-%meson_build
+meson .build -Ddocs=man -Ddocs-build=true -Ddefault_library=both
 
 %install
-%meson_install
-
-%check
-%meson_test
+cd .build
+meson install --destdir %{buildroot} --skip-subprojects
 
 %files
 %defattr(-,root,root)
-%attr(0755,root,root) %{_libdir}/libnvme.so.*
+%attr(0755,root,root) %{_libdir}/libnvme*
 %doc COPYING
 
 %files devel
 %defattr(-,root,root)
 %attr(-,root,root) %{_includedir}/nvme/
-%attr(0644,root,root) %{_includedir}/libnvme.h
-%attr(0755,root,root) %{_libdir}/libnvme.so
-%attr(0644,root,root) %{_libdir}/libnvme.a
+%attr(0644,root,root) %{_includedir}/libnvme*
+%attr(0755,root,root) %{_libdir}/libnvme*
 %attr(0644,root,root) %{_libdir}/pkgconfig/*
 %attr(0644,root,root) %{_mandir}/man2/*
 
 %changelog
+* Wed Jul 13 2022 Steven Seungcheol Lee <sc108.lee@samsung.com>
+- Enable building rpm
+- meson is needed higher version then what rpm repo offering (use pip install)
+
 * Thu Dec 12 2019 Keith Busch <kbusch@kernel.org> - 0.1
 - Initial version