3 %bcond_with dynamic # dynamic linking with libphobos (doesn't work properly as of 2.065.0)
5 Summary: Digital Mars D compiler
6 Summary(pl.UTF-8): Digital Mars D - kompilator języka D
10 # Digital Mars is proprietary license (not redistributable)
11 License: Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (compiler frontend), Digital Mars (the rest)
12 Group: Development/Languages
13 Source0: http://downloads.dlang.org/releases/2014/%{name}.%{version}.zip
14 # NoSource0-md5: a17a699a7e4715658393819e9dc1814a
15 Source1: https://github.com/D-Programming-Language/tools/archive/v%{version}/d-tools-%{version}.tar.gz
16 # Source1-md5: d6b0b7a2a6b90a1374202c7582fc38e7
17 Patch0: %{name}-system-zlib.patch
18 Patch1: %{name}-shared.patch
20 URL: http://dlang.org/dmd-linux.html
21 BuildRequires: curl-devel
22 BuildRequires: libstdc++-devel
23 BuildRequires: zlib-devel
25 Requires: %{name}-libs = %{version}-%{release}
29 ExclusiveArch: %{ix86} %{x8664}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Digital Mars D compiler.
41 %description -l pl.UTF-8
42 Digital Mars D - kompilator języka D.
45 Summary: Phobos runtime library for D language
46 Summary(pl.UTF-8): Biblioteka uruchomieniowa Phobos dla języka D
50 Phobos runtime library for D language.
52 %description libs -l pl.UTF-8
53 Biblioteka uruchomieniowa Phobos dla języka D.
56 Summary: Phobos and D-runtime static libraries for D language
57 Summary(pl.UTF-8): Biblioteki statyczne Phobos oraz D-runtime dla języka D
58 Group: Development/Libraries
59 Requires: %{name} = %{version}-%{release}
62 Phobos and D-runtime static libraries for D language.
64 %description static -l pl.UTF-8
65 Biblioteki statyczne Phobos oraz D-runtime dla języka D.
69 %{__mv} tools-%{version} tools
72 %{?with_dynamic:%patch1 -p1}
74 echo "%{version}" > src/dmd/VERSION
76 cp -p src/dmd/backendlicense.txt dmd-backendlicense.txt
77 cp -p src/dmd/readme.txt dmd-readme.txt
78 cp -p src/druntime/LICENSE druntime-LICENSE
79 cp -p src/druntime/README.md druntime-README.md
82 %{__make} -C src/dmd -f posix.mak \
87 GFLAGS='%{rpmcxxflags} $(WARNINGS) -D__pascal= -fno-exceptions'
89 DMD=$(pwd)/src/dmd/dmd
90 for t in target lib/libdruntime-linux%{model}.so ; do
91 %{__make} -C src/druntime -f posix.mak $t \
95 CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
100 %{__make} -C src/phobos -f posix.mak \
104 CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
109 %{__make} -C tools -f posix.mak \
113 CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
114 DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime -L-L$(pwd)/src/phobos/generated/linux/release/%{model}"
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos/etc/c,%{_libdir},%{_sysconfdir},%{_docdir}/dmd}
120 install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd
121 cp -p src/druntime/lib/libdruntime-linux%{model}* $RPM_BUILD_ROOT%{_libdir}
122 cp -a src/phobos/generated/linux/release/%{model}/libphobos2.so* $RPM_BUILD_ROOT%{_libdir}
123 cp -p src/phobos/generated/linux/release/%{model}/libphobos2.a $RPM_BUILD_ROOT%{_libdir}
124 cp -pr src/druntime/import $RPM_BUILD_ROOT%{_includedir}/d/dmd/druntime
125 cp -pr src/phobos/{std,*.d} $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos
126 cp -p src/phobos/etc/c/*.d $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos/etc/c
127 cp -pr src/druntime/doc $RPM_BUILD_ROOT%{_docdir}/dmd/druntime
128 install tools/generated/linux/%{model}/{ddemangle,rdmd} $RPM_BUILD_ROOT%{_bindir}
129 install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1
130 install -Dp man/man5/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5
132 cat >$RPM_BUILD_ROOT%{_sysconfdir}/dmd.conf <<EOF
134 DFLAGS=-I/usr/include/d/dmd/phobos -I/usr/include/d/dmd/druntime -L-L%{_libdir} -L--no-warn-search-mismatch -L--export-dynamic
138 rm -rf $RPM_BUILD_ROOT
140 %post libs -p /sbin/ldconfig
141 %postun libs -p /sbin/ldconfig
144 %defattr(644,root,root,755)
145 %attr(755,root,root) %{_libdir}/libphobos2.so.*.*.*
146 %attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.65
149 %defattr(644,root,root,755)
150 %doc README.TXT license.txt dmd-*.txt druntime-*
151 %attr(755,root,root) %{_bindir}/ddemangle
152 %attr(755,root,root) %{_bindir}/dmd
153 %attr(755,root,root) %{_bindir}/rdmd
155 %attr(755,root,root) %{_libdir}/libphobos2.so
156 %attr(755,root,root) %{_libdir}/libdruntime-linux%{model}.so
158 %{_libdir}/libdruntime-linux%{model}so.a
159 %{_libdir}/libdruntime-linux%{model}so.o
160 %{_sysconfdir}/dmd.conf
161 %dir %{_includedir}/d
163 %{_mandir}/man1/dmd.1*
164 %{_mandir}/man5/dmd.conf.5*
169 %defattr(644,root,root,755)
171 %{_libdir}/libdruntime-linux%{model}.a
172 %{_libdir}/libdruntime-linux%{model}.o
173 %{_libdir}/libphobos2.a