[projects/template-specs] modernize template

glen glen at pld-linux.org
Sun Nov 24 02:45:19 CET 2013


commit 846e7db49a1bd87ec7cc71ca400c8c62a4cbfd66
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Nov 24 03:45:12 2013 +0200

    modernize template

 ocaml.spec | 73 ++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 35 insertions(+), 38 deletions(-)
---
diff --git a/ocaml.spec b/ocaml.spec
index 46d6bb6..0d91f8b 100644
--- a/ocaml.spec
+++ b/ocaml.spec
@@ -1,30 +1,25 @@
-# TODO
-
-#%define _use_internal_dependency_generator 0
-#%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
-#%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
-# disable debug - not useful?
-%define debug_package %{nil}
-
 #
 # Conditional build:
 %bcond_without	opt		# build opt
 
-Summary:	TEMPLATE binding for OCaml
-Summary(pl.UTF-8):	Wiązania TEMPLATE dla OCamla
-Name:		ocaml-template
+%define		module	%{module}
+Summary:	%{module} binding for OCaml
+Summary(pl.UTF-8):	Wiązania %{module} dla OCamla
+Name:		ocaml-%{module}
 Version:	-
 Release:	1
 License:	- (enter GPL/LGPL/BSD/BSD-like/other license name here)
 Group:		Libraries
-Source0:	template-%{version}.tar.gz
+Source0:	%{module}-%{version}.tar.gz
 URL:		-
 # Source0-md5:	-
-BuildRequires:	-devel
+#BuildRequires:	-devel
 BuildRequires:	ocaml >= 3.04-7
 %requires_eq	ocaml-runtime
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define		debug_package	%{nil}
+
 %description
 This package contains files needed to run bytecode executables using
 this library.
@@ -34,8 +29,8 @@ Pakiet ten zawiera binaria potrzebne do uruchamiania programów
 używających tej biblioteki.
 
 %package devel
-Summary:	TEMPLATE binding for OCaml - development part
-Summary(pl.UTF-8):	Wiązania TEMPLATE dla OCamla - cześć programistyczna
+Summary:	%{module} binding for OCaml - development part
+Summary(pl.UTF-8):	Wiązania %{module} dla OCamla - cześć programistyczna
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
 %requires_eq	ocaml
@@ -49,30 +44,28 @@ Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
 tej biblioteki.
 
 %prep
-%setup -q -n template-%{version}
+%setup -q -n %{module}-%{version}
 
 %build
-%{__make} all %{?with_opt:opt} \
+%{__make} -j1 all %{?with_opt:opt} \
 	CC="%{__cc} %{rpmcflags} -fPIC"
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/{template,stublibs}
-install *.cm[ixa]* *.a dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/template
-install dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
-
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/template
-cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/template/META <<EOF
-requires = ""
-version = "%{version}"
-directory = "+template"
-archive(byte) = "template.cma"
-archive(native) = "template.cmxa"
-linkopts = ""
+export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
+install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+#install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+#cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+# move to dir pld ocamlfind looks
+install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
+mv $OCAMLFIND_DESTDIR/%{module}/META \
+	$RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
+cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
+directory="+%{module}"
 EOF
 
 %clean
@@ -84,9 +77,13 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%doc LICENSE *.mli
-%dir %{_libdir}/ocaml/template
-%{_libdir}/ocaml/template/*.cm[ixa]*
-%{_libdir}/ocaml/template/*.a
+%doc LICENSE
+%{_libdir}/ocaml/%{module}/*.cm[xi]
+%{_libdir}/ocaml/%{module}/*.cmo
+%{_libdir}/ocaml/%{module}/*.mli
+%if %{with opt}
+%{_libdir}/ocaml/%{module}/*.[ao]
+%{_libdir}/ocaml/%{module}/*.cmxa
+%endif
+%{_libdir}/ocaml/site-lib/%{module}
 %{_examplesdir}/%{name}-%{version}
-%{_libdir}/ocaml/site-lib/template
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/template-specs.git/commitdiff/846e7db49a1bd87ec7cc71ca400c8c62a4cbfd66



More information about the pld-cvs-commit mailing list