[packages/CUnit] - updated to 2.1 - updated curses,libs,FHS patches - separated -libs, -static (base is the developme
qboosh
qboosh at pld-linux.org
Wed Oct 16 16:25:14 CEST 2013
commit bab9183b2e79ad50d62a572722e4285e1a08d7b7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Oct 16 16:24:30 2013 +0200
- updated to 2.1
- updated curses,libs,FHS patches
- separated -libs, -static (base is the development package)
CUnit-FHS.patch | 88 +++++++++++++++++++++++++++++--------------------
CUnit-curses.patch | 8 ++---
CUnit-libs.patch | 82 ++++++++++++++++++++++++++++++++--------------
CUnit.spec | 96 +++++++++++++++++++++++++++++++++++++++++-------------
4 files changed, 187 insertions(+), 87 deletions(-)
---
diff --git a/CUnit.spec b/CUnit.spec
index bfdfaae..abf907c 100644
--- a/CUnit.spec
+++ b/CUnit.spec
@@ -1,19 +1,26 @@
+# NOTE: due to its nature, base package is development tool, so there is no separate -devel
+#
+# Conditional build:
+%bcond_with examples # build examples (seems broken)
+#
Summary: Automated testing framework for C
Summary(pl.UTF-8): Szkielet automatycznych testów dla C
Name: CUnit
-Version: 2.0
-Release: 0.5
-License: LGPL
+Version: 2.1
+Release: 1
+License: LGPL v2+
Group: Development/Tools
-Source0: http://dl.sourceforge.net/cunit/%{name}-%{version}-2.tar.gz
-# Source0-md5: d493ba42f06bf9156225f5026ff65f86
+Source0: http://downloads.sourceforge.net/cunit/%{name}-%{version}-2-src.tar.bz2
+# Source0-md5: 31c62bd7a65007737ba28b7aafc44d3a
Patch0: %{name}-curses.patch
Patch1: %{name}-libs.patch
Patch2: %{name}-FHS.patch
URL: http://cunit.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: libtool
BuildRequires: ncurses-devel
+Requires: %{name}-libs = %{version}-%{release}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -38,6 +45,41 @@ kodem testowym użytkownika. Używa prostego szkieletu do tworzenia
struktur testowych i udostępnia bogaty zbiór zapewnień (assertions)
do testowania popularnych typów danych.
+%package libs
+Summary: Shared CUnit library
+Summary(pl.UTF-8): Biblioteka współdzielona CUnit
+Group: Libraries
+
+%description libs
+Shared CUnit library.
+
+%description libs -l pl.UTF-8
+Biblioteka współdzielona CUnit.
+
+%package static
+Summary: Static CUnit library
+Summary(pl.UTF-8): Biblioteka statyczna CUnit
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description static
+Static CUnit library.
+
+%description static -l pl.UTF-8
+Biblioteka statyczna CUnit.
+
+%package examples
+Summary: CUnit examples
+Summary(pl.UTF-8): Przykłady do CUnita
+Group: Development/Tools
+Requires: %{name} = %{version}-%{release}
+
+%description examples
+CUnit examples.
+
+%description examples -l pl.UTF-8
+Przykłady do CUnita.
+
%prep
%setup -q -n %{name}-%{version}-2
%patch0 -p1
@@ -45,13 +87,15 @@ do testowania popularnych typów danych.
%patch2 -p1
%build
+%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
+ --enable-curses \
%{?debug:--enable-debug} \
- --enable-curses
+ %{?with_examples:--enable-examples --enable-test}
%{__make}
%install
@@ -60,45 +104,51 @@ rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-rm -rf html headers
-# can't package %doc %{_docdir}/%{name}-%{version} as rpm fails:
-# error: magic_file(ms, "/home/builder/tmp/cunit-2.0-root-builder/usr/share/doc/cunit-2.0/headers")
-# failed: mode 040755 cannot open `/home/builder/tmp/cunit-2.0-root-builder/usr/share/doc/cunit-2.0/headers' (No such file or directory)
-# rpmbuild: rpmfc.c:1564: rpmfcClassify: Assertion `ftype != ((void *)0)' failed.
-mv -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{html,headers} .
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcunit.la
+
+rm -rf docs
+%{__mv} $RPM_BUILD_ROOT%{_docdir}/CUnit docs
%clean
rm -rf $RPM_BUILD_ROOT
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog NEWS README TODO
-%doc html headers
+%doc AUTHORS ChangeLog NEWS README TODO docs
+%attr(755,root,root) %{_libdir}/libcunit.so
%{_includedir}/CUnit
-# maybe attempt to make .so too?
-%{_libdir}/libcunit.a
%{_datadir}/CUnit
+%{_pkgconfigdir}/cunit.pc
+%{_mandir}/man3/CUnit.3*
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libcunit.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcunit.so.1
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libcunit.a
-# dunno, worth to package these at all?
+%if %{with examples}
+%files examples
%dir %{_libdir}/CUnit
%dir %{_libdir}/CUnit/Examples
%dir %{_libdir}/CUnit/Examples/Automated
%attr(755,root,root) %{_libdir}/CUnit/Examples/Automated/AutomatedTest
%{_libdir}/CUnit/Examples/Automated/README
-
%dir %{_libdir}/CUnit/Examples/Basic
%attr(755,root,root) %{_libdir}/CUnit/Examples/Basic/BasicTest
%{_libdir}/CUnit/Examples/Basic/README
-
%dir %{_libdir}/CUnit/Examples/Console
%attr(755,root,root) %{_libdir}/CUnit/Examples/Console/ConsoleTest
%{_libdir}/CUnit/Examples/Console/README
-
%dir %{_libdir}/CUnit/Examples/Curses
%attr(755,root,root) %{_libdir}/CUnit/Examples/Curses/CursesTest
%{_libdir}/CUnit/Examples/Curses/README
-
%dir %{_libdir}/CUnit/Test
%attr(755,root,root) %{_libdir}/CUnit/Test/test_cunit
-
-%{_mandir}/man3/CUnit.3*
+%endif
diff --git a/CUnit-FHS.patch b/CUnit-FHS.patch
index 0d193fc..903bd33 100644
--- a/CUnit-FHS.patch
+++ b/CUnit-FHS.patch
@@ -1,56 +1,74 @@
---- ./doc/Makefile.am~ 2004-10-01 00:38:27.000000000 +0300
-+++ ./doc/Makefile.am 2005-11-30 00:06:17.000000000 +0200
-@@ -1,4 +1,4 @@
--docdir = $(prefix)/doc/@PACKAGE@
-+docdir = $(datadir)/doc/@PACKAGE at -@VERSION@/html
+--- CUnit-2.1-2/doc/headers/Makefile.am.orig 2010-10-14 11:22:01.000000000 +0200
++++ CUnit-2.1-2/doc/headers/Makefile.am 2013-10-15 20:29:25.894114411 +0200
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
- doc_DATA = \
- CUnit_doc.css \
---- ./doc/headers/Makefile.am~ 2005-04-28 00:56:16.000000000 +0300
-+++ ./doc/headers/Makefile.am 2005-11-30 00:10:47.000000000 +0200
-@@ -1,4 +1,4 @@
-dochdrdir = $(prefix)/doc/@PACKAGE@/headers
-+dochdrdir = $(datadir)/doc/@PACKAGE at -@VERSION@/headers
++dochdrdir = $(datarootdir)/doc/@PACKAGE@/headers
INCLUDE_FILES = \
Automated.h \
---- ./Examples/AutomatedTest/Makefile.am~ 2005-11-30 00:15:58.000000000 +0200
-+++ ./Examples/AutomatedTest/Makefile.am 2005-11-30 00:19:16.000000000 +0200
-@@ -1,4 +1,4 @@
+--- CUnit-2.1-2/doc/Makefile.am.orig 2006-03-21 02:30:57.000000000 +0100
++++ CUnit-2.1-2/doc/Makefile.am 2013-10-15 20:29:02.207448739 +0200
+@@ -1,8 +1,8 @@
+ ## Process this file with automake to produce Makefile.in
+
+-docdir = $(prefix)/doc/@PACKAGE@
++pkgdocdir = $(datarootdir)/doc/@PACKAGE@
+
+-doc_DATA = \
++pkgdoc_DATA = \
+ CUnit_doc.css \
+ error_handling.html \
+ fdl.html \
+--- CUnit-2.1-2/Examples/AutomatedTest/Makefile.am.orig 2013-10-15 20:25:15.024124939 +0200
++++ CUnit-2.1-2/Examples/AutomatedTest/Makefile.am 2013-10-15 20:33:42.807436964 +0200
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+
-exampledir=${datadir}/@PACKAGE@/Examples/Automated
-+exampledir=$(libdir)/@PACKAGE@/Examples/Automated
++exampledir=$(pkglibdir)/Examples/Automated
- example_PROGRAMS = AutomatedTest
+ if ENABLE_EXAMPLES
+ if ENABLE_AUTOMATED
+--- CUnit-2.1-2/Examples/BasicTest/Makefile.am.orig 2013-10-15 20:25:15.027458272 +0200
++++ CUnit-2.1-2/Examples/BasicTest/Makefile.am 2013-10-15 20:34:01.270769520 +0200
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
---- ./Examples/BasicTest/Makefile.am~ 2005-11-30 00:15:58.000000000 +0200
-+++ ./Examples/BasicTest/Makefile.am 2005-11-30 00:20:07.000000000 +0200
-@@ -1,4 +1,4 @@
-exampledir=${datadir}/@PACKAGE@/Examples/Basic
-+exampledir=$(libdir)/@PACKAGE@/Examples/Basic
++exampledir=$(pkglibdir)/Examples/Basic
- example_PROGRAMS = BasicTest
+ if ENABLE_EXAMPLES
+ if ENABLE_BASIC
+--- CUnit-2.1-2/Examples/ConsoleTest/Makefile.am.orig 2013-10-15 20:25:15.027458272 +0200
++++ CUnit-2.1-2/Examples/ConsoleTest/Makefile.am 2013-10-15 20:34:19.040768775 +0200
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
---- ./Examples/ConsoleTest/Makefile.am~ 2005-11-30 00:15:58.000000000 +0200
-+++ ./Examples/ConsoleTest/Makefile.am 2005-11-30 00:20:17.000000000 +0200
-@@ -1,4 +1,4 @@
-exampledir=${datadir}/@PACKAGE@/Examples/Console
-+exampledir=$(libdir)/@PACKAGE@/Examples/Console
++exampledir=$(pkglibdir)/Examples/Console
- example_PROGRAMS = ConsoleTest
+ if ENABLE_EXAMPLES
+ if ENABLE_CONSOLE
+--- CUnit-2.1-2/Examples/CursesTest/Makefile.am.orig 2013-10-15 20:25:15.027458272 +0200
++++ CUnit-2.1-2/Examples/CursesTest/Makefile.am 2013-10-15 20:34:37.674101327 +0200
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
---- ./Examples/CursesTest/Makefile.am~ 2005-11-30 00:15:58.000000000 +0200
-+++ ./Examples/CursesTest/Makefile.am 2005-11-30 00:20:27.000000000 +0200
-@@ -1,4 +1,4 @@
-exampledir=${datadir}/@PACKAGE@/Examples/Curses
-+exampledir=$(libdir)/@PACKAGE@/Examples/Curses
++exampledir=$(pkglibdir)/Examples/Curses
- example_PROGRAMS = CursesTest
+ if ENABLE_EXAMPLES
+ if ENABLE_CURSES
+--- CUnit-2.1-2/CUnit/Sources/Test/Makefile.am.orig 2013-10-15 20:41:40.950750230 +0200
++++ CUnit-2.1-2/CUnit/Sources/Test/Makefile.am 2013-10-15 20:42:06.947415805 +0200
+@@ -1,7 +1,7 @@
+ ## Process this file with automake to produce Makefile.in
---- ./CUnit/Sources/Test/Makefile.am~ 2004-10-01 00:38:10.000000000 +0300
-+++ ./CUnit/Sources/Test/Makefile.am 2005-11-30 00:25:09.000000000 +0200
-@@ -1,4 +1,4 @@
+ if ENABLE_TEST
-testdir=${datadir}/@PACKAGE@/Test
-+testdir=$(libdir)/@PACKAGE@/Test
++testdir=$(pkglibdir)/Test
test_PROGRAMS = test_cunit
test_cunit_SOURCES = test_cunit.c
diff --git a/CUnit-curses.patch b/CUnit-curses.patch
index d5d0057..876b45c 100644
--- a/CUnit-curses.patch
+++ b/CUnit-curses.patch
@@ -1,9 +1,9 @@
---- ./CUnit/Sources/Curses/Curses.c~ 2005-04-26 02:27:32.000000000 +0300
-+++ ./CUnit/Sources/Curses/Curses.c 2005-11-29 23:54:44.000000000 +0200
-@@ -53,7 +53,7 @@
+--- CUnit-2.1-2/CUnit/Sources/Curses/Curses.c.orig 2013-10-15 19:17:17.997629368 +0200
++++ CUnit-2.1-2/CUnit/Sources/Curses/Curses.c 2013-10-15 19:30:33.654262646 +0200
+@@ -51,7 +51,7 @@
+ #include <ctype.h>
#include <assert.h>
#include <string.h>
- #include <math.h>
-#include <curses.h>
+#include <ncurses/curses.h>
diff --git a/CUnit-libs.patch b/CUnit-libs.patch
index ce05e1c..c71eb89 100644
--- a/CUnit-libs.patch
+++ b/CUnit-libs.patch
@@ -1,44 +1,76 @@
---- ./Examples/AutomatedTest/Makefile.am~ 2004-10-01 00:38:25.000000000 +0300
-+++ ./Examples/AutomatedTest/Makefile.am 2005-11-29 23:56:29.000000000 +0200
-@@ -3,7 +3,7 @@
+--- CUnit-2.1-2/Examples/AutomatedTest/Makefile.am.orig 2010-10-14 10:43:09.000000000 +0200
++++ CUnit-2.1-2/Examples/AutomatedTest/Makefile.am 2013-10-15 20:21:48.537466937 +0200
+@@ -8,8 +8,8 @@ if ENABLE_AUTOMATED
example_PROGRAMS = AutomatedTest
- AutomatedTest_SOURCES = AutomatedTest.c AutomatedTest.h
+ AutomatedTest_SOURCES = AutomatedTest.c
-AutomatedTest_LDADD = -lcunit -lcunitexamples
-+AutomatedTest_LDADD = -lcunit -lcunitexamples -lm
- AutomatedTest_LDFLAGS = -L..
+-AutomatedTest_LDFLAGS = -L.. -lm
++AutomatedTest_LDADD = $(top_builddir)/CUnit/Sources/libcunit.la $(top_builddir)/Examples/libcunitexamples.a
++AutomatedTest_LDFLAGS = -lm
INCLUDES = -I..
---- ./Examples/BasicTest/Makefile.am~ 2004-10-01 00:38:25.000000000 +0300
-+++ ./Examples/BasicTest/Makefile.am 2005-11-29 23:59:50.000000000 +0200
-@@ -3,7 +3,7 @@
+ if ENABLE_CURSES
+--- CUnit-2.1-2/Examples/BasicTest/Makefile.am.orig 2010-10-14 10:39:59.000000000 +0200
++++ CUnit-2.1-2/Examples/BasicTest/Makefile.am 2013-10-15 20:22:26.284132020 +0200
+@@ -8,8 +8,8 @@ if ENABLE_BASIC
example_PROGRAMS = BasicTest
- BasicTest_SOURCES = BasicTest.c BasicTest.h
+ BasicTest_SOURCES = BasicTest.c
-BasicTest_LDADD = -lcunit -lcunitexamples
-+BasicTest_LDADD = -lcunit -lcunitexamples -lm
- BasicTest_LDFLAGS = -L..
+-BasicTest_LDFLAGS = -L.. -lm
++BasicTest_LDADD = $(top_builddir)/CUnit/Sources/libcunit.la $(top_builddir)/Examples/libcunitexamples.a
++BasicTest_LDFLAGS = -lm
INCLUDES = -I..
---- ./Examples/ConsoleTest/Makefile.am~ 2004-10-01 00:38:25.000000000 +0300
-+++ ./Examples/ConsoleTest/Makefile.am 2005-11-30 00:00:33.000000000 +0200
-@@ -3,7 +3,7 @@
+ if ENABLE_CURSES
+--- CUnit-2.1-2/Examples/ConsoleTest/Makefile.am.orig 2010-10-14 10:42:08.000000000 +0200
++++ CUnit-2.1-2/Examples/ConsoleTest/Makefile.am 2013-10-15 20:23:13.677463364 +0200
+@@ -8,8 +8,8 @@ if ENABLE_CONSOLE
example_PROGRAMS = ConsoleTest
- ConsoleTest_SOURCES = ConsoleTest.c ConsoleTest.h
+ ConsoleTest_SOURCES = ConsoleTest.c
-ConsoleTest_LDADD = -lcunit -lcunitexamples
-+ConsoleTest_LDADD = -lcunit -lcunitexamples -lm
- ConsoleTest_LDFLAGS = -L..
+-ConsoleTest_LDFLAGS = -L.. -lm
++ConsoleTest_LDADD = $(top_builddir)/CUnit/Sources/libcunit.la $(top_builddir)/Examples/libcunitexamples.a
++ConsoleTest_LDFLAGS = -lm
INCLUDES = -I..
---- ./Examples/CursesTest/Makefile.am~ 2004-10-01 00:38:25.000000000 +0300
-+++ ./Examples/CursesTest/Makefile.am 2005-11-30 00:01:27.000000000 +0200
-@@ -3,7 +3,7 @@
+ if ENABLE_CURSES
+--- CUnit-2.1-2/Examples/CursesTest/Makefile.am.orig 2010-10-14 10:42:37.000000000 +0200
++++ CUnit-2.1-2/Examples/CursesTest/Makefile.am 2013-10-15 20:23:46.394128658 +0200
+@@ -8,8 +8,8 @@ if ENABLE_CURSES
example_PROGRAMS = CursesTest
- CursesTest_SOURCES = CursesTest.c CursesTest.h
--CursesTest_LDADD = -lcunit -lcunitexamples -lncurses
-+CursesTest_LDADD = -lcunit -lcunitexamples -lncurses -lm
- CursesTest_LDFLAGS = -L..
+ CursesTest_SOURCES = CursesTest.c
+-CursesTest_LDADD = -lcunit -lcunitexamples
+-CursesTest_LDFLAGS = -L.. -lm
++CursesTest_LDADD = $(top_builddir)/CUnit/Sources/libcunit.la $(top_builddir)/Examples/libcunitexamples.a
++CursesTest_LDFLAGS = -lm
INCLUDES = -I..
+ if ENABLE_CURSES
+--- CUnit-2.1-2/CUnit/Sources/Test/Makefile.am.orig 2006-03-21 02:30:54.000000000 +0100
++++ CUnit-2.1-2/CUnit/Sources/Test/Makefile.am 2013-10-15 20:41:40.950750230 +0200
+@@ -5,8 +5,7 @@
+
+ test_PROGRAMS = test_cunit
+ test_cunit_SOURCES = test_cunit.c
+-test_cunit_LDADD = ../libcunit_test.a
+-test_cunit_LDFLAGS = -L..
++test_cunit_LDADD = $(top_builddir)/CUnit/Sources/libcunit_test.a
+
+ INCLUDES = -I../../Headers -DMEMTRACE -DCUNIT_BUILD_TESTS -DCUNIT_DO_NOT_DEFINE_UNLESS_BUILDING_TESTS
+ endif
+--- CUnit-2.1-2/CUnit/Sources/Makefile.am.orig 2006-03-21 02:30:53.000000000 +0100
++++ CUnit-2.1-2/CUnit/Sources/Makefile.am 2013-10-16 16:20:48.227781246 +0200
+@@ -69,6 +69,9 @@
+ libcunit_la_LIBADD = $(OBJECT_FILES_SHARED)
+ libcunit_la_LDFLAGS = -version-info @LIBTOOL_CURRENT@:@LIBTOOL_REVISION@:@LIBTOOL_AGE@
+
++if ENABLE_CURSES
++libcunit_la_LIBADD += -l$(CURSES_LIB)
++endif
+
+ if ENABLE_TEST
+ noinst_LIBRARIES = libcunit_test.a
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/CUnit.git/commitdiff/bab9183b2e79ad50d62a572722e4285e1a08d7b7
More information about the pld-cvs-commit
mailing list