]>
Commit | Line | Data |
---|---|---|
fbcc5afc JB |
1 | # |
2 | # Conditional build: | |
bf555f48 JB |
3 | %bcond_with bootstrap # bootstrap using upstream binaries |
4 | %bcond_with dynamic # dynamic linking with libphobos (doesn't work properly as of 2.065.0) | |
fbcc5afc | 5 | # |
39aab3ac JB |
6 | Summary: Digital Mars D compiler |
7 | Summary(pl.UTF-8): Digital Mars D - kompilator języka D | |
8 | Name: dmd | |
bf555f48 | 9 | Version: 2.070.2 |
39aab3ac JB |
10 | Release: 1 |
11 | # Digital Mars is proprietary license (not redistributable) | |
bf555f48 | 12 | License: Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (frontend), Digital Mars (backend) |
39aab3ac | 13 | Group: Development/Languages |
bf555f48 JB |
14 | Source0: http://downloads.dlang.org/releases/2.x/%{version}/%{name}.%{version}.linux.tar.xz |
15 | # NoSource0-md5: 309e6968abb813a654d24ba43aba832f | |
fbcc5afc | 16 | Source1: https://github.com/D-Programming-Language/tools/archive/v%{version}/d-tools-%{version}.tar.gz |
bf555f48 | 17 | # Source1-md5: 8e664bb5b8849b373a210b6ebff27633 |
bcce314d | 18 | Patch0: %{name}-system-zlib.patch |
bf555f48 JB |
19 | Patch1: %{name}-opt.patch |
20 | Patch2: %{name}-shared.patch | |
39aab3ac JB |
21 | NoSource: 0 |
22 | URL: http://dlang.org/dmd-linux.html | |
bcce314d | 23 | BuildRequires: curl-devel |
bf555f48 | 24 | %{!?with_bootstrap:BuildRequires: dmd >= 2.068.2} |
39aab3ac | 25 | BuildRequires: libstdc++-devel |
bcce314d | 26 | BuildRequires: zlib-devel |
fbcc5afc | 27 | %if %{with dynamic} |
bcce314d | 28 | Requires: %{name}-libs = %{version}-%{release} |
fbcc5afc JB |
29 | %endif |
30 | # used as linker | |
31 | Requires: gcc | |
39aab3ac JB |
32 | ExclusiveArch: %{ix86} %{x8664} |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %ifarch %{ix86} | |
36 | %define model 32 | |
37 | %else | |
38 | %define model 64 | |
39 | %endif | |
40 | ||
41 | %description | |
42 | Digital Mars D compiler. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Digital Mars D - kompilator języka D. | |
46 | ||
bcce314d JB |
47 | %package libs |
48 | Summary: Phobos runtime library for D language | |
49 | Summary(pl.UTF-8): Biblioteka uruchomieniowa Phobos dla języka D | |
50 | Group: Libraries | |
51 | ||
52 | %description libs | |
53 | Phobos runtime library for D language. | |
54 | ||
55 | %description libs -l pl.UTF-8 | |
56 | Biblioteka uruchomieniowa Phobos dla języka D. | |
57 | ||
58 | %package static | |
59 | Summary: Phobos and D-runtime static libraries for D language | |
60 | Summary(pl.UTF-8): Biblioteki statyczne Phobos oraz D-runtime dla języka D | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description static | |
65 | Phobos and D-runtime static libraries for D language. | |
66 | ||
67 | %description static -l pl.UTF-8 | |
68 | Biblioteki statyczne Phobos oraz D-runtime dla języka D. | |
69 | ||
39aab3ac | 70 | %prep |
fbcc5afc JB |
71 | %setup -q -n dmd2 -a1 |
72 | %{__mv} tools-%{version} tools | |
73 | ||
bcce314d | 74 | %patch0 -p1 |
bf555f48 JB |
75 | %patch1 -p1 |
76 | %{?with_dynamic:%patch2 -p1} | |
39aab3ac | 77 | |
bcce314d | 78 | echo "%{version}" > src/dmd/VERSION |
39aab3ac JB |
79 | |
80 | cp -p src/dmd/backendlicense.txt dmd-backendlicense.txt | |
81 | cp -p src/dmd/readme.txt dmd-readme.txt | |
82 | cp -p src/druntime/LICENSE druntime-LICENSE | |
0753fbab | 83 | cp -p src/druntime/README.md druntime-README.md |
39aab3ac JB |
84 | |
85 | %build | |
86 | %{__make} -C src/dmd -f posix.mak \ | |
87 | OS=LINUX \ | |
88 | TARGET_CPU=X86 \ | |
89 | MODEL=%{model} \ | |
90 | HOST_CC="%{__cxx}" \ | |
bf555f48 JB |
91 | %{?with_bootstrap:HOST_DMD=$(pwd)/linux/bin%{model}/dmd} \ |
92 | CXXOPTFLAGS="%{rpmcxxflags}" | |
39aab3ac JB |
93 | |
94 | DMD=$(pwd)/src/dmd/dmd | |
bf555f48 JB |
95 | |
96 | %{__make} -C src/druntime -f posix.mak \ | |
39aab3ac JB |
97 | OS=linux \ |
98 | MODEL=%{model} \ | |
99 | CC="%{__cc}" \ | |
bf555f48 | 100 | CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \ |
39aab3ac JB |
101 | DMD="$DMD" \ |
102 | PIC="-fPIC" | |
103 | ||
104 | %{__make} -C src/phobos -f posix.mak \ | |
105 | OS=linux \ | |
106 | MODEL=%{model} \ | |
107 | CC="%{__cc}" \ | |
bf555f48 | 108 | CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \ |
39aab3ac | 109 | DMD="$DMD" \ |
bcce314d | 110 | LIBCURL_STUB= \ |
39aab3ac JB |
111 | PIC="-fPIC" |
112 | ||
fbcc5afc JB |
113 | %{__make} -C tools -f posix.mak \ |
114 | OS=linux \ | |
115 | MODEL=%{model} \ | |
116 | CC="%{__cc}" \ | |
bf555f48 | 117 | DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime/import -L-L$(pwd)/src/phobos/generated/linux/release/%{model}" |
fbcc5afc | 118 | |
39aab3ac JB |
119 | %install |
120 | rm -rf $RPM_BUILD_ROOT | |
fbcc5afc | 121 | install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos/etc/c,%{_libdir},%{_sysconfdir},%{_docdir}/dmd} |
39aab3ac JB |
122 | |
123 | install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd | |
bf555f48 | 124 | cp -p src/druntime/generated/linux/release/%{model}/libdruntime* $RPM_BUILD_ROOT%{_libdir} |
bcce314d | 125 | cp -a src/phobos/generated/linux/release/%{model}/libphobos2.so* $RPM_BUILD_ROOT%{_libdir} |
39aab3ac JB |
126 | cp -p src/phobos/generated/linux/release/%{model}/libphobos2.a $RPM_BUILD_ROOT%{_libdir} |
127 | cp -pr src/druntime/import $RPM_BUILD_ROOT%{_includedir}/d/dmd/druntime | |
128 | cp -pr src/phobos/{std,*.d} $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos | |
fbcc5afc | 129 | cp -p src/phobos/etc/c/*.d $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos/etc/c |
fbcc5afc | 130 | install tools/generated/linux/%{model}/{ddemangle,rdmd} $RPM_BUILD_ROOT%{_bindir} |
39aab3ac | 131 | install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1 |
0753fbab | 132 | install -Dp man/man5/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5 |
39aab3ac JB |
133 | |
134 | cat >$RPM_BUILD_ROOT%{_sysconfdir}/dmd.conf <<EOF | |
135 | [Environment] | |
136 | DFLAGS=-I/usr/include/d/dmd/phobos -I/usr/include/d/dmd/druntime -L-L%{_libdir} -L--no-warn-search-mismatch -L--export-dynamic | |
137 | EOF | |
138 | ||
139 | %clean | |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
bcce314d JB |
142 | %post libs -p /sbin/ldconfig |
143 | %postun libs -p /sbin/ldconfig | |
144 | ||
fbcc5afc JB |
145 | %files libs |
146 | %defattr(644,root,root,755) | |
bf555f48 JB |
147 | %attr(755,root,root) %{_libdir}/libphobos2.so.0.70.2 |
148 | %attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.70 | |
fbcc5afc | 149 | |
39aab3ac JB |
150 | %files |
151 | %defattr(644,root,root,755) | |
152 | %doc README.TXT license.txt dmd-*.txt druntime-* | |
fbcc5afc | 153 | %attr(755,root,root) %{_bindir}/ddemangle |
39aab3ac | 154 | %attr(755,root,root) %{_bindir}/dmd |
fbcc5afc | 155 | %attr(755,root,root) %{_bindir}/rdmd |
bcce314d | 156 | %attr(755,root,root) %{_libdir}/libphobos2.so |
bf555f48 JB |
157 | %{_libdir}/libdruntime.so.a |
158 | %{_libdir}/libdruntime.so.o | |
159 | %{_libdir}/libphobos2.so.0.70.o | |
39aab3ac JB |
160 | %{_sysconfdir}/dmd.conf |
161 | %dir %{_includedir}/d | |
162 | %{_includedir}/d/dmd | |
163 | %{_mandir}/man1/dmd.1* | |
164 | %{_mandir}/man5/dmd.conf.5* | |
165 | %{_docdir}/dmd | |
bcce314d | 166 | |
fbcc5afc | 167 | %if %{with dynamic} |
bcce314d JB |
168 | %files static |
169 | %defattr(644,root,root,755) | |
fbcc5afc | 170 | %endif |
bf555f48 | 171 | %{_libdir}/libdruntime.a |
bcce314d | 172 | %{_libdir}/libphobos2.a |