]> git.pld-linux.org Git - packages/dmd.git/blob - dmd.spec
c7ec049b0451a2fb90d6e560e02bc27c2c763405
[packages/dmd.git] / dmd.spec
1 #
2 # Conditional build:
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)
5 #
6 Summary:        Digital Mars D compiler
7 Summary(pl.UTF-8):      Digital Mars D - kompilator języka D
8 Name:           dmd
9 Version:        2.070.2
10 Release:        1
11 # Digital Mars is proprietary license (not redistributable)
12 License:        Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (frontend), Digital Mars (backend)
13 Group:          Development/Languages
14 Source0:        http://downloads.dlang.org/releases/2.x/%{version}/%{name}.%{version}.linux.tar.xz
15 # NoSource0-md5:        309e6968abb813a654d24ba43aba832f
16 Source1:        https://github.com/D-Programming-Language/tools/archive/v%{version}/d-tools-%{version}.tar.gz
17 # Source1-md5:  8e664bb5b8849b373a210b6ebff27633
18 Patch0:         %{name}-system-zlib.patch
19 Patch1:         %{name}-opt.patch
20 Patch2:         %{name}-shared.patch
21 NoSource:       0
22 URL:            http://dlang.org/dmd-linux.html
23 BuildRequires:  curl-devel
24 %{!?with_bootstrap:BuildRequires:       dmd >= 2.068.2}
25 BuildRequires:  libstdc++-devel
26 BuildRequires:  zlib-devel
27 %if %{with dynamic}
28 Requires:       %{name}-libs = %{version}-%{release}
29 %endif
30 # used as linker
31 Requires:       gcc
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
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
70 %prep
71 %setup -q -n dmd2 -a1
72 %{__mv} tools-%{version} tools
73
74 %patch0 -p1
75 %patch1 -p1
76 %{?with_dynamic:%patch2 -p1}
77
78 echo "%{version}" > src/dmd/VERSION
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
83 cp -p src/druntime/README.md druntime-README.md
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}" \
91         %{?with_bootstrap:HOST_DMD=$(pwd)/linux/bin%{model}/dmd} \
92         CXXOPTFLAGS="%{rpmcxxflags}"
93
94 DMD=$(pwd)/src/dmd/dmd
95
96 %{__make} -C src/druntime -f posix.mak \
97         OS=linux \
98         MODEL=%{model} \
99         CC="%{__cc}" \
100         CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \
101         DMD="$DMD" \
102         PIC="-fPIC"
103
104 %{__make} -C src/phobos -f posix.mak \
105         OS=linux \
106         MODEL=%{model} \
107         CC="%{__cc}" \
108         CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \
109         DMD="$DMD" \
110         LIBCURL_STUB= \
111         PIC="-fPIC"
112
113 %{__make} -C tools -f posix.mak \
114         OS=linux \
115         MODEL=%{model} \
116         CC="%{__cc}" \
117         DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime/import -L-L$(pwd)/src/phobos/generated/linux/release/%{model}"
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121 install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos/etc/c,%{_libdir},%{_sysconfdir},%{_docdir}/dmd}
122
123 install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd
124 cp -p src/druntime/generated/linux/release/%{model}/libdruntime* $RPM_BUILD_ROOT%{_libdir}
125 cp -a src/phobos/generated/linux/release/%{model}/libphobos2.so* $RPM_BUILD_ROOT%{_libdir}
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
129 cp -p src/phobos/etc/c/*.d $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos/etc/c
130 install tools/generated/linux/%{model}/{ddemangle,rdmd} $RPM_BUILD_ROOT%{_bindir}
131 install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1
132 install -Dp man/man5/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5
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
142 %post   libs -p /sbin/ldconfig
143 %postun libs -p /sbin/ldconfig
144
145 %files libs
146 %defattr(644,root,root,755)
147 %attr(755,root,root) %{_libdir}/libphobos2.so.0.70.2
148 %attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.70
149
150 %files
151 %defattr(644,root,root,755)
152 %doc README.TXT license.txt dmd-*.txt druntime-*
153 %attr(755,root,root) %{_bindir}/ddemangle
154 %attr(755,root,root) %{_bindir}/dmd
155 %attr(755,root,root) %{_bindir}/rdmd
156 %attr(755,root,root) %{_libdir}/libphobos2.so
157 %{_libdir}/libdruntime.so.a
158 %{_libdir}/libdruntime.so.o
159 %{_libdir}/libphobos2.so.0.70.o
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
166
167 %if %{with dynamic}
168 %files static
169 %defattr(644,root,root,755)
170 %endif
171 %{_libdir}/libdruntime.a
172 %{_libdir}/libphobos2.a
This page took 0.107666 seconds and 3 git commands to generate.