[shunit2] Install docs to %{_pkgdocdir} where available (#994092).

Ville Skyttä scop at fedoraproject.org
Sat Dec 14 19:58:33 UTC 2013


commit 61966448136ff788f00fdf4de87d64f96e11d291
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Dec 14 21:58:35 2013 +0200

    Install docs to %{_pkgdocdir} where available (#994092).

 add_makefiles.patch |   16 ++++++++++------
 shunit2.spec        |   12 ++++++++----
 2 files changed, 18 insertions(+), 10 deletions(-)
---
diff --git a/add_makefiles.patch b/add_makefiles.patch
index 22ea0be..4103429 100644
--- a/add_makefiles.patch
+++ b/add_makefiles.patch
@@ -1,7 +1,7 @@
 diff -Nurp shunit2-2.1.6.orig/doc/Makefile shunit2-2.1.6/doc/Makefile
 --- shunit2-2.1.6.orig/doc/Makefile	1970-01-01 08:00:00.000000000 +0800
 +++ shunit2-2.1.6/doc/Makefile	2011-05-04 11:19:48.149344760 +0800
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,33 @@
 +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 +#
 +#   Name: Makefile
@@ -21,14 +21,16 @@ diff -Nurp shunit2-2.1.6.orig/doc/Makefile shunit2-2.1.6/doc/Makefile
 +      shunit2.txt\
 +      TODO.txt
 +
++DOCDIR=/usr/share/doc/$(PKGNAME)-$(PKGVERSION)
++
 +.PHONY: clean
 +
 +build:
 +	@echo "Nothing to build"
 +
 +install: $(FILES)
-+	mkdir -p $(DESTDIR)/usr/share/doc/$(PKGNAME)-$(PKGVERSION)
-+	install -p -m 644 $(FILES) $(DESTDIR)/usr/share/doc/$(PKGNAME)-$(PKGVERSION)/
++	mkdir -p $(DESTDIR)$(DOCDIR)
++	install -p -m 644 $(FILES) $(DESTDIR)$(DOCDIR)/
 +
 +clean:
 +	rm -f *.tar.gz *.tgz
@@ -36,7 +38,7 @@ diff -Nurp shunit2-2.1.6.orig/doc/Makefile shunit2-2.1.6/doc/Makefile
 diff -Nurp shunit2-2.1.6.orig/examples/Makefile shunit2-2.1.6/examples/Makefile
 --- shunit2-2.1.6.orig/examples/Makefile	1970-01-01 08:00:00.000000000 +0800
 +++ shunit2-2.1.6/examples/Makefile	2011-05-04 11:19:48.149344760 +0800
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,30 @@
 +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 +#
 +#   Name: Makefile
@@ -53,14 +55,16 @@ diff -Nurp shunit2-2.1.6.orig/examples/Makefile shunit2-2.1.6/examples/Makefile
 +	math.inc\
 +	mkdir_test.sh
 +
++DOCDIR=/usr/share/doc/$(PKGNAME)-$(PKGVERSION)
++
 +.PHONY: clean
 +
 +build:
 +	@echo "Nothing to build"
 +
 +install: $(FILES)
-+	mkdir -p $(DESTDIR)/usr/share/doc/$(PKGNAME)-$(PKGVERSION)/examples
-+	install -p -m 644 $(FILES) $(DESTDIR)/usr/share/doc/$(PKGNAME)-$(PKGVERSION)/examples/
++	mkdir -p $(DESTDIR)$(DOCDIR)/examples
++	install -p -m 644 $(FILES) $(DESTDIR)$(DOCDIR)/examples/
 +
 +clean:
 +	rm -f *.tar.gz *.tgz
diff --git a/shunit2.spec b/shunit2.spec
index 620f941..c98c97f 100644
--- a/shunit2.spec
+++ b/shunit2.spec
@@ -1,6 +1,8 @@
+%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
+
 Name:           shunit2
 Version:        2.1.6
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        A xUnit based unit testing for Unix shell scripts
 
 Group:          Development/Languages
@@ -34,7 +36,7 @@ cp -p %{SOURCE1} doc/
 
 %install
 rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}
+make install DESTDIR=%{buildroot} DOCDIR=%{_pkgdocdir}
 
 
 %clean
@@ -45,11 +47,13 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/*
-%doc %{_docdir}/%{name}-%{version}
-
+%{_pkgdocdir}
 
 
 %changelog
+* Sat Dec 14 2013 Ville Skyttä <ville.skytta at iki.fi> - 2.1.6-8
+- Install docs to %%{_pkgdocdir} where available (#994092).
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.1.6-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list