From 77f4e35b8124f7acfd0b77cfd7a24f6612fdd5596a71520a935c9beaf58ff9f2 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 1 Nov 2019 22:39:13 +0000 Subject: [PATCH 1/3] - Require current dune macros - Use _service file - Remove obsolete calendar-2.04-enable-debug.patch and ocaml-calendar-buildcompare.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-calendar?expand=0&rev=18 --- _service | 15 +++++++ calendar-2.04-enable-debug.patch | 11 ----- calendar-2.04.tar.gz | 3 -- ocaml-calendar-2.04.tar.xz | 3 ++ ocaml-calendar-buildcompare.patch | 15 ------- ocaml-calendar.changes | 8 ++++ ocaml-calendar.spec | 73 +++++++++---------------------- 7 files changed, 46 insertions(+), 82 deletions(-) create mode 100644 _service delete mode 100644 calendar-2.04-enable-debug.patch delete mode 100644 calendar-2.04.tar.gz create mode 100644 ocaml-calendar-2.04.tar.xz delete mode 100644 ocaml-calendar-buildcompare.patch diff --git a/_service b/_service new file mode 100644 index 0000000..b8d7e61 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + https://github.com/anuragsoni/calendar.git + git + 2.04 + + pervasives-deprecated-408 + ocaml-calendar + + + *.tar + xz + + + diff --git a/calendar-2.04-enable-debug.patch b/calendar-2.04-enable-debug.patch deleted file mode 100644 index dae5783..0000000 --- a/calendar-2.04-enable-debug.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- calendar-2.04/Makefile.in.old 2013-09-14 16:15:43.760253519 +0100 -+++ calendar-2.04/Makefile.in 2013-09-14 16:16:03.233279962 +0100 -@@ -86,7 +86,7 @@ - - CAMLIBS = $(addprefix -I , $(DIRS)) - --CAMLFLAGS= $(CAMLIBS) -+CAMLFLAGS= -g $(CAMLIBS) - BYTEFLAGS= $(CAMLFLAGS) - LINK_OPTFLAGS = $(CAMLFLAGS) -noassert - OPTFLAGS = $(LINK_OPTFLAGS) -for-pack CalendarLib diff --git a/calendar-2.04.tar.gz b/calendar-2.04.tar.gz deleted file mode 100644 index 6fc2aa3..0000000 --- a/calendar-2.04.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bea6faa0337a1c54b0f3c2b9b45c9eb90e2b2747406e6f0b841e1fd20fd4d9f7 -size 271522 diff --git a/ocaml-calendar-2.04.tar.xz b/ocaml-calendar-2.04.tar.xz new file mode 100644 index 0000000..b37d7ca --- /dev/null +++ b/ocaml-calendar-2.04.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48db0ea40ae83fca502435f71eb2276e9c21e945e18bb697e5b84578ef31cae6 +size 76496 diff --git a/ocaml-calendar-buildcompare.patch b/ocaml-calendar-buildcompare.patch deleted file mode 100644 index f770c60..0000000 --- a/ocaml-calendar-buildcompare.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/Makefile.in -+++ b/Makefile.in -@@ -117,7 +117,7 @@ $(LIBDIR)/$(NAMELIB).cmxs: $(LIBDIR)/$(N - - src/version.ml: Makefile - echo "let version = \"$(VERSION)\"" > $@ -- echo "let date = \"`date`\"" >> $@ -+ echo "let date = \"`date --reference=CHANGES`\"" >> $@ - - META: Makefile - echo "name = \"$(NAME)\"" > $@ diff --git a/ocaml-calendar.changes b/ocaml-calendar.changes index 74c7cb7..93a2fa4 100644 --- a/ocaml-calendar.changes +++ b/ocaml-calendar.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Nov 1 12:34:56 UTC 2019 - ohering@suse.de + +- Require current dune macros +- Use _service file +- Remove obsolete calendar-2.04-enable-debug.patch and + ocaml-calendar-buildcompare.patch + ------------------------------------------------------------------- Tue Jul 25 13:04:54 UTC 2017 - ohering@suse.de diff --git a/ocaml-calendar.spec b/ocaml-calendar.spec index 42e46ad..135351a 100644 --- a/ocaml-calendar.spec +++ b/ocaml-calendar.spec @@ -12,15 +12,10 @@ # 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/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# Ignore all generated modules *except* CalendarLib, since everything -# now appears in that namespace. -%global __ocaml_requires_opts -i Calendar_builder -i Calendar_sig -i Date -i Date_sig -i Fcalendar -i Ftime -i Period -i Printer -i Time -i Time_sig -i Time_Zone -i Utils -i Version -%global __ocaml_provides_opts -i Calendar_builder -i Calendar_sig -i Date -i Date_sig -i Fcalendar -i Ftime -i Period -i Printer -i Time -i Time_sig -i Time_Zone -i Utils -i Version - Name: ocaml-calendar Version: 2.04 Release: 0 @@ -28,16 +23,14 @@ Release: 0 Summary: Objective Caml library for managing dates and times License: LGPL-2.0 Group: Development/Languages/OCaml -Url: http://calendar.forge.ocamlcore.org/ -Source0: http://forge.ocamlcore.org/frs/download.php/1481/calendar-2.04.tar.gz -Patch1: calendar-2.04-enable-debug.patch -Patch2: ocaml-calendar-buildcompare.patch -BuildRequires: gawk -BuildRequires: ocaml >= 4.00.1 -BuildRequires: ocaml-findlib-devel >= 1.3.3-3 -BuildRequires: ocaml-ocamldoc -BuildRequires: ocaml-rpm-macros >= 4.02.1 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Url: https://github.com/ocaml-community/calendar +Source0: %{name}-%{version}.tar.xz +BuildRequires: ocaml +BuildRequires: ocaml-dune +BuildRequires: ocaml-rpm-macros >= 20191101 +BuildRequires: ocamlfind(alcotest) +BuildRequires: ocamlfind(re) +BuildRequires: ocamlfind(unix) %description Objective Caml library for managing dates and times. @@ -52,48 +45,22 @@ The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. %prep -%setup -q -n calendar-%{version} -%patch1 -p1 -%patch2 -p1 +%autosetup -p1 %build -./configure --libdir=%{_libdir} -make %{?_smp_mflags} -make %{?_smp_mflags} doc - -mv TODO TODO.old -iconv -f iso-8859-1 -t utf-8 < TODO.old > TODO +dune_release_pkgs='calendar' +%ocaml_dune_setup +%ocaml_dune_build %install -export DESTDIR=%{buildroot} -export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml -mkdir -p $OCAMLFIND_DESTDIR -make DESTDIR=%{buildroot} install %{?_smp_mflags} +%ocaml_dune_install +%ocaml_create_file_list -%files -%defattr(-,root,root,-) -%doc CHANGES README TODO LGPL COPYING -%dir %{_libdir}/ocaml -%dir %{_libdir}/ocaml/* -%if 0%{?ocaml_native_compiler} -%{_libdir}/ocaml/*/*.cmxs -%endif +%check +%ocaml_dune_test -%files devel -%defattr(-,root,root,-) -%doc CHANGES README TODO LGPL COPYING doc/* -%dir %{_libdir}/ocaml -%dir %{_libdir}/ocaml/* -%if 0%{?ocaml_native_compiler} -%{_libdir}/ocaml/*/*.a -%{_libdir}/ocaml/*/*.cmx -%{_libdir}/ocaml/*/*.cmxa -%{_libdir}/ocaml/*/*.o -%endif -%{_libdir}/ocaml/*/*.cma -%{_libdir}/ocaml/*/*.cmi -%{_libdir}/ocaml/*/*.cmo -%{_libdir}/ocaml/*/*.mli -%{_libdir}/ocaml/*/META +%files -f %{name}.files + +%files devel -f %{name}.files.devel %changelog From c207f79bf39213afee9f2db77acfc41201eaefc1b675b8375449a861a581a4b3 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Sun, 3 Nov 2019 10:23:06 +0000 Subject: [PATCH 2/3] remove usage of date(1). #27 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-calendar?expand=0&rev=19 --- ocaml-calendar.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocaml-calendar.spec b/ocaml-calendar.spec index 135351a..0ac8d07 100644 --- a/ocaml-calendar.spec +++ b/ocaml-calendar.spec @@ -48,6 +48,8 @@ developing applications that use %{name}. %autosetup -p1 %build +sed -i~ '/system date/d' src/dune +diff -u "$_"~ "$_" && exit 1 dune_release_pkgs='calendar' %ocaml_dune_setup %ocaml_dune_build From 3a6786ea8a68d75abbe44865d2feec58e9ba1e15f95b4264912547f9abd10e4a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 13 Nov 2019 14:57:41 +0000 Subject: [PATCH 3/3] wrap runtest in ocaml_do_dune_runtest OBS-URL: https://build.opensuse.org/package/show/devel:languages:ocaml/ocaml-calendar?expand=0&rev=20 --- ocaml-calendar.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocaml-calendar.spec b/ocaml-calendar.spec index 0ac8d07..6d07dab 100644 --- a/ocaml-calendar.spec +++ b/ocaml-calendar.spec @@ -16,6 +16,7 @@ # +%bcond_with ocaml_do_dune_runtest Name: ocaml-calendar Version: 2.04 Release: 0 @@ -28,9 +29,11 @@ Source0: %{name}-%{version}.tar.xz BuildRequires: ocaml BuildRequires: ocaml-dune BuildRequires: ocaml-rpm-macros >= 20191101 -BuildRequires: ocamlfind(alcotest) BuildRequires: ocamlfind(re) BuildRequires: ocamlfind(unix) +%if %{with ocaml_do_dune_runtest} +BuildRequires: ocamlfind(alcotest) +%endif %description Objective Caml library for managing dates and times. @@ -58,8 +61,10 @@ dune_release_pkgs='calendar' %ocaml_dune_install %ocaml_create_file_list +%if %{with ocaml_do_dune_runtest} %check %ocaml_dune_test +%endif %files -f %{name}.files