]>
Commit | Line | Data |
---|---|---|
39aab3ac JB |
1 | Summary: Digital Mars D compiler |
2 | Summary(pl.UTF-8): Digital Mars D - kompilator języka D | |
3 | Name: dmd | |
4 | Version: 2.062 | |
5 | Release: 1 | |
6 | # Digital Mars is proprietary license (not redistributable) | |
7 | License: Boost (D runtime, Phobos), GPL v1+ or Artistic (compiler frontend), Digital Mars (the rest) | |
8 | Group: Development/Languages | |
9 | Source0: http://downloads.dlang.org.s3-website-us-east-1.amazonaws.com/releases/2013/%{name}.%{version}.zip | |
10 | # NoSource0-md5: fd2211206532ab41a8aef764a9225d3c | |
11 | NoSource: 0 | |
12 | URL: http://dlang.org/dmd-linux.html | |
13 | BuildRequires: libstdc++-devel | |
14 | ExclusiveArch: %{ix86} %{x8664} | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %ifarch %{ix86} | |
18 | %define model 32 | |
19 | %else | |
20 | %define model 64 | |
21 | %endif | |
22 | ||
23 | %description | |
24 | Digital Mars D compiler. | |
25 | ||
26 | %description -l pl.UTF-8 | |
27 | Digital Mars D - kompilator języka D. | |
28 | ||
29 | %prep | |
30 | %setup -q -n dmd2 | |
31 | ||
32 | echo "%{version}" > src/VERSION | |
33 | ||
34 | cp -p src/dmd/backendlicense.txt dmd-backendlicense.txt | |
35 | cp -p src/dmd/readme.txt dmd-readme.txt | |
36 | cp -p src/druntime/LICENSE druntime-LICENSE | |
37 | cp -p src/druntime/README druntime-README | |
38 | ||
39 | %build | |
40 | %{__make} -C src/dmd -f posix.mak \ | |
41 | OS=LINUX \ | |
42 | TARGET_CPU=X86 \ | |
43 | MODEL=%{model} \ | |
44 | HOST_CC="%{__cxx}" \ | |
45 | GFLAGS='%{rpmcxxflags} $(WARNINGS) -D__pascal= -fno-exceptions' | |
46 | ||
47 | DMD=$(pwd)/src/dmd/dmd | |
48 | %{__make} -C src/druntime -f posix.mak \ | |
49 | OS=linux \ | |
50 | MODEL=%{model} \ | |
51 | CC="%{__cc}" \ | |
52 | CFLAGS="%{rpmcflags} -m%{model} -fPIC" \ | |
53 | DMD="$DMD" \ | |
54 | PIC="-fPIC" | |
55 | ||
56 | %{__make} -C src/phobos -f posix.mak \ | |
57 | OS=linux \ | |
58 | MODEL=%{model} \ | |
59 | CC="%{__cc}" \ | |
60 | CFLAGS="%{rpmcflags} -m%{model} -fPIC" \ | |
61 | DMD="$DMD" \ | |
62 | PIC="-fPIC" | |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos,%{_libdir},%{_sysconfdir},%{_docdir}/dmd} | |
67 | ||
68 | install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd | |
69 | cp -p src/druntime/lib/libdruntime-linux%{model}.a $RPM_BUILD_ROOT%{_libdir} | |
70 | cp -p src/phobos/generated/linux/release/%{model}/libphobos2.a $RPM_BUILD_ROOT%{_libdir} | |
71 | cp -pr src/druntime/import $RPM_BUILD_ROOT%{_includedir}/d/dmd/druntime | |
72 | cp -pr src/phobos/{std,*.d} $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos | |
73 | cp -pr src/druntime/doc $RPM_BUILD_ROOT%{_docdir}/dmd/druntime | |
74 | install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1 | |
75 | install -Dp man/man1/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5 | |
76 | ||
77 | cat >$RPM_BUILD_ROOT%{_sysconfdir}/dmd.conf <<EOF | |
78 | [Environment] | |
79 | DFLAGS=-I/usr/include/d/dmd/phobos -I/usr/include/d/dmd/druntime -L-L%{_libdir} -L--no-warn-search-mismatch -L--export-dynamic | |
80 | EOF | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %doc README.TXT license.txt dmd-*.txt druntime-* | |
88 | %attr(755,root,root) %{_bindir}/dmd | |
89 | %{_libdir}/libdruntime-linux%{model}.a | |
90 | %{_libdir}/libphobos2.a | |
91 | %{_sysconfdir}/dmd.conf | |
92 | %dir %{_includedir}/d | |
93 | %{_includedir}/d/dmd | |
94 | %{_mandir}/man1/dmd.1* | |
95 | %{_mandir}/man5/dmd.conf.5* | |
96 | %{_docdir}/dmd |