SHA256
1
0
forked from pool/ldc

Accepting request 347824 from home:susnux:branches:devel:languages:D

Build libraries as shared libraries, therefor split sub-packages to fulfill openSUSE shared library policy.

OBS-URL: https://build.opensuse.org/request/show/347824
OBS-URL: https://build.opensuse.org/package/show/devel:languages:D/ldc?expand=0&rev=5
This commit is contained in:
Matthias Mailänder 2015-12-07 19:41:40 +00:00 committed by Git OBS Bridge
parent 7b0ca54757
commit 4d150d31f0
3 changed files with 94 additions and 31 deletions

3
ldc-rpmlintrc Normal file
View File

@ -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*")

View File

@ -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

113
ldc.spec
View File

@ -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