diff --git a/ldc-rpmlintrc b/ldc-rpmlintrc new file mode 100644 index 0000000..136a597 --- /dev/null +++ b/ldc-rpmlintrc @@ -0,0 +1,3 @@ +# library has a slightly other name, ignore this false positiv +addFilter("W: no-dependency-on ldc-runtime*") +addFilter("W: no-dependency-on ldc-phobos*") diff --git a/ldc.changes b/ldc.changes index 885d5c5..af111bb 100644 --- a/ldc.changes +++ b/ldc.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Dec 6 20:08:34 UTC 2015 - rpm@fthiessen.de + +- Build runtime and phobos libraries as shared libraries, therefore + refactored spec file: + * Basic cleanup + * Split lib* packages, see openSUSE shared library policy + * Added ldc-rpmlintrc for false positiv. + ------------------------------------------------------------------- Wed Oct 28 11:02:24 UTC 2015 - schuetzm@gmx.net diff --git a/ldc.spec b/ldc.spec index ab79b8b..b3e5701 100644 --- a/ldc.spec +++ b/ldc.spec @@ -1,7 +1,7 @@ # -# spec file for package +# spec file for package ldc # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,25 +15,32 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: ldc -Version: 0.16.1 -Release: 0 -License: BSD-3-Clause and Artistic-1.0 -Summary: The LLVM D Compiler -Url: https://github.com/ldc-developers/ldc -Group: Development/Languages/Other -Source0: ldc-%{version}-src.tar.gz +Version: 0.16.1 +Release: 0 +Summary: The LLVM D Compiler +License: BSD-3-Clause and Artistic-1.0 +Group: Development/Languages/Other +Url: https://github.com/ldc-developers/ldc +Source0: ldc-%{version}-src.tar.gz +Source1: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE workaround-buggy-llvm-config.patch bnc#856691 -Patch1: workaround-buggy-llvm-config.patch -BuildRequires: libconfig++-devel -BuildRequires: llvm-devel >= 3.0 +Patch1: workaround-buggy-llvm-config.patch BuildRequires: cmake +BuildRequires: help2man +BuildRequires: libconfig++-devel BuildRequires: llvm-clang -BuildRequires: zlib-devel +BuildRequires: llvm-devel >= 3.0 BuildRequires: ncurses-devel -Recommends: ldc-runtime-devel = %{version} -Recommends: ldc-phobos-devel = %{version} +BuildRequires: zlib-devel +# Should be installed, at least runtime +Recommends: ldc-phobos-devel = %{version} +Recommends: ldc-runtime-devel = %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build +%define so_ver 67 +%define lname_runtime libdruntime-%{name} +%define lname_phobos libphobos2-%{name} %description LDC is an LLVM based compiler for the D programming language. It uses the @@ -41,15 +48,31 @@ frontend of the reference compiler (DMD), thereby supporting the same language features, but profits from LLVM's superior optimizing and code generation capabilities. +%package -n %{lname_runtime}%{so_ver} +Summary: Minimal D runtime library + +%description -n %{lname_runtime}%{so_ver} +The minimal runtime library required to support the D programming language. + %package runtime-devel -Summary: Development files for the D runtime library +Summary: Development files for the D runtime library +Requires: %{lname_runtime}%{so_ver} = %{version} +Recommends: ldc-phobos-devel = %{version} %description runtime-devel This package contains the druntime development files necessary for developing with LDC. +%package -n %{lname_phobos}%{so_ver} +Summary: The D standard library + +%description -n %{lname_phobos}%{so_ver} +This package includes ldc's phobos library - The D standard library. + %package phobos-devel -Summary: Development files for the D standard library +Summary: Development files for the D standard library +Requires: %{lname_phobos}%{so_ver} = %{version} +Requires: %{name}-runtime-devel = %{version} %description phobos-devel This package contains the Phobos development files necessary for developing @@ -60,36 +83,64 @@ with LDC. %patch1 -p1 %build -mkdir build -pushd build -cmake -DD_VERSION=2 \ - -DSYSCONF_INSTALL_DIR=%{_sysconfdir} \ - -DCMAKE_CXX_FLAGS=-std=c++11 \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} .. +#Needs to be compiled with clang, but opensuse_rules.cmake forces gcc so disable rule +touch no-suse-rules +%cmake \ + -DCMAKE_USER_MAKE_RULES_OVERRIDE=./no-suse-rules \ + -DCMAKE_C_COMPILER="%{_bindir}/clang" \ + -DCMKAE_CXX_COMPILER="%{_bindir}/clang++" \ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/d \ + -DCMAKE_CXX_FLAGS="-std=c++11" make %{?_smp_mflags} -popd %install -pushd build -%make_install -popd +%cmake_install +# Build man pages +help2man %{buildroot}%{_bindir}/ldc2 > ldc2.1 && gzip ldc2.1 +help2man %{buildroot}%{_bindir}/ldmd2 > ldmd2.1 && gzip ldmd2.1 +install -d %{buildroot}%{_mandir}/man1 +install -m 644 -t %{buildroot}%{_mandir}/man1/ ldmd2.1.gz ldc2.1.gz + +%post -n %{lname_runtime}%{so_ver} -p /sbin/ldconfig + +%post -n %{lname_phobos}%{so_ver} -p /sbin/ldconfig + +%postun -n %{lname_runtime}%{so_ver} -p /sbin/ldconfig + +%postun -n %{lname_phobos}%{so_ver} -p /sbin/ldconfig %files %defattr(-,root,root) %doc LICENSE README.md +%doc %{_mandir}/man1/*.1.gz %config %{_sysconfdir}/bash_completion.d/ldc2 %config %{_sysconfdir}/ldc2.conf %{_bindir}/ldc2 %{_bindir}/ldmd2 +%files -n %{lname_runtime}%{so_ver} +%defattr(-,root,root) +%{_libdir}/%{lname_runtime}.so.* +%{_libdir}/%{lname_runtime}-debug.so.* + %files runtime-devel %defattr(-,root,root) -%{_prefix}/lib/libdruntime-ldc*.a* -%{_includedir}/d +%{_libdir}/%{lname_runtime}.so +%{_libdir}/%{lname_runtime}-debug.so +%dir %{_includedir}/d +%{_includedir}/d/ldc +%{_includedir}/d/core + +%files -n %{lname_phobos}%{so_ver} +%defattr(-,root,root) +%{_libdir}/%{lname_phobos}.so.* +%{_libdir}/%{lname_phobos}-debug.so.* %files phobos-devel %defattr(-,root,root) -%{_prefix}/lib/libphobos2-ldc*.a* +%{_libdir}/%{lname_phobos}.so +%{_libdir}/%{lname_phobos}-debug.so +%{_includedir}/d/std +%{_includedir}/d/etc %changelog -