diff mbox

ndctl: sles spec file updates

Message ID 20150910231224.33942.63148.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit ad0ff1cdc1fb
Headers show

Commit Message

Dan Williams Sept. 10, 2015, 11:12 p.m. UTC
Include copyright header, license files as %doc

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 contrib/Makefile      |    5 +++--
 contrib/genspec.c     |    2 +-
 contrib/ndctl.spec.in |   38 +++++++++++++++++++++-----------------
 contrib/sles/header   |   18 ++++++++++++++++++
 4 files changed, 43 insertions(+), 20 deletions(-)
 create mode 100644 contrib/sles/header
diff mbox

Patch

diff --git a/contrib/Makefile b/contrib/Makefile
index 958281765b9b..766e186d0389 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -7,6 +7,7 @@  PROG=genspec
 SPEC_IN=ndctl.spec.in
 RHEL_SPEC=rhel/$(SPEC_IN:.in=)
 SLES_SPEC=sles/$(SPEC_IN:.in=)
+SLES_IN=sles/header
 COMMIT_ID=git log --pretty=format:"%h" -n 1
 
 all: $(RHEL_SPEC) $(SLES_SPEC)
@@ -15,9 +16,9 @@  $(RHEL_SPEC) : $(SPEC_IN) $(PROG)
 	@mkdir -p rhel
 	cat $(SPEC_IN) | $(dir $(PROG))$(PROG) `$(COMMIT_ID)` rhel > $@
 
-$(SLES_SPEC) : $(SPEC_IN) $(PROG)
+$(SLES_SPEC) : $(SLES_IN) $(SPEC_IN) $(PROG)
 	@mkdir -p sles
-	cat $(SPEC_IN) | $(dir $(PROG))$(PROG) `$(COMMIT_ID)` sles > $@
+	cat $(SLES_IN) $(SPEC_IN) | $(dir $(PROG))$(PROG) `$(COMMIT_ID)` sles > $@
 
 $(PROG) : $(OBJS) Makefile
 	$(CC) $(LDFLAGS) $(OBJS) -o $@
diff --git a/contrib/genspec.c b/contrib/genspec.c
index b3e85da3c9ff..829f648f0a2f 100644
--- a/contrib/genspec.c
+++ b/contrib/genspec.c
@@ -42,7 +42,7 @@  int main(int argc, char **argv)
 		else if (strncmp("%define dname", buf, 12) == 0)
 			fprintf(stdout, "%%define dname %s\n", dname[os]);
 		else if (strncmp("%license", buf, 8) == 0 && !license[os])
-			/* skip */;
+			fprintf(stdout, "%%doc %s", &buf[8]);
 		else if (strncmp("echo \"\" > version", buf, 17) == 0)
 			fprintf(stdout, "echo \"%s\" > version\n", VERSION);
 		else
diff --git a/contrib/ndctl.spec.in b/contrib/ndctl.spec.in
index 61fa525d1e87..3d0687ebdc47 100644
--- a/contrib/ndctl.spec.in
+++ b/contrib/ndctl.spec.in
@@ -7,22 +7,18 @@  Version:
 Release:        1%{?dist}
 Summary:	Manage "libnvdimm" subsystem devices (Non-volatile Memory)
 License:        GPL-2.0
-URL:            https://github.com/pmem/ndctl
-
-%if %{defined gitcommit}
+Group:          Hardware/Other
+Url:            https://github.com/pmem/ndctl
 # Snapshot tarball can be created using: ./make-git-shapshot.sh [gitcommit]
 Source0:        %{name}-git%{gitcommit}.tar.xz
-%else
-Source0:        https://github.com/pmem/ndctl/archive/%{name}-%{version}.tar.gz
-%endif
-
-BuildRequires: libtool
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: pkgconfig
-BuildRequires: pkgconfig(libudev)
-BuildRequires: pkgconfig(uuid)
-BuildRequires: pkgconfig(libkmod)
+
+BuildRequires:  autoconf
+BuildRequires:  automake
+BuildRequires:  libtool
+BuildRequires:  pkgconfig
+BuildRequires:  pkgconfig(libkmod)
+BuildRequires:  pkgconfig(libudev)
+BuildRequires:  pkgconfig(uuid)
 
 %description
 Utility library for managing the "libnvdimm" subsystem.  The "libnvdimm"
@@ -34,6 +30,7 @@  Firmware Interface Table).
 %package -n %dname
 Summary:        Development files for libndctl
 License:        LGPL-2.1+
+Group:          Development/Libraries/Other
 Requires:       %{lname}%{?_isa} = %{version}-%{release}
 
 %description -n %dname
@@ -44,10 +41,10 @@  developing applications that use %{name}.
 %package -n %lname
 Summary:        Management library for "libnvdimm" subsystem devices (Non-volatile Memory)
 License:        LGPL-2.1+
+Group:          System/Libraries
 
 %description -n %lname
-Libraries for %{name}
-
+Libraries for %{name}.
 
 %prep
 %setup -q %{?gitcommit:-n %{name}-git%{gitcommit}}
@@ -58,31 +55,38 @@  echo "" > version
 %configure --disable-static
 make %{?_smp_mflags}
 
-
 %install
 %make_install
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
+%check
+make check
 
 %post -n %lname -p /sbin/ldconfig
 
 %postun -n %lname -p /sbin/ldconfig
 
 %files
+%defattr(-,root,root)
 %license licenses/GPLv2 licenses/BSD-MIT licenses/CC0
 %{_bindir}/ndctl
 
 %files -n %lname
+%defattr(-,root,root)
 %doc README.md
 %license COPYING licenses/BSD-MIT licenses/CC0
 %{_libdir}/libndctl.so.*
 
 %files -n %dname
+%defattr(-,root,root)
 %license COPYING
 %{_includedir}/ndctl/
 %{_libdir}/libndctl.so
 %{_libdir}/pkgconfig/libndctl.pc
 
 %changelog
+* Wed Sep 09 2015 dan.j.williams@intel.com
+- Stop emitting git commit info by default
+
 * Mon Aug 03 2015 dan.j.williams@intel.com
 - Initial rpm release
diff --git a/contrib/sles/header b/contrib/sles/header
new file mode 100644
index 000000000000..18efb453f705
--- /dev/null
+++ b/contrib/sles/header
@@ -0,0 +1,18 @@ 
+#
+# spec file for package ndctl
+#
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 Intel Corporation
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+