]> git.pld-linux.org Git - packages/dmd.git/blob - dmd.spec
- up to 2.072.0
[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.072.0
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:        5928fdc2065fec9440f5d255146384ad
16 Source1:        https://github.com/dlang/tools/archive/v%{version}/d-tools-%{version}.tar.gz
17 # Source1-md5:  3244aab8bb1583c3c970d8a702dd5280
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 # some intermediate(?) object disliked a lot by ldconfig
135 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libdruntime.so.a
136
137 cat >$RPM_BUILD_ROOT%{_sysconfdir}/dmd.conf <<EOF
138 [Environment]
139 DFLAGS=-I/usr/include/d/dmd/phobos -I/usr/include/d/dmd/druntime -L-L%{_libdir} -L--no-warn-search-mismatch -L--export-dynamic
140 EOF
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %post   libs -p /sbin/ldconfig
146 %postun libs -p /sbin/ldconfig
147
148 %files libs
149 %defattr(644,root,root,755)
150 %attr(755,root,root) %{_libdir}/libphobos2.so.0.72.0
151 %attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.72
152
153 %files
154 %defattr(644,root,root,755)
155 %doc README.TXT license.txt dmd-*.txt druntime-*
156 %attr(755,root,root) %{_bindir}/ddemangle
157 %attr(755,root,root) %{_bindir}/dmd
158 %attr(755,root,root) %{_bindir}/rdmd
159 %attr(755,root,root) %{_libdir}/libphobos2.so
160 %{_libdir}/libdruntime.so.o
161 %{_libdir}/libphobos2.so.0.72.o
162 %{_sysconfdir}/dmd.conf
163 %dir %{_includedir}/d
164 %{_includedir}/d/dmd
165 %{_mandir}/man1/dmd.1*
166 %{_mandir}/man5/dmd.conf.5*
167 %{_docdir}/dmd
168
169 %if %{with dynamic}
170 %files static
171 %defattr(644,root,root,755)
172 %endif
173 %{_libdir}/libdruntime.a
174 %{_libdir}/libphobos2.a
This page took 0.048845 seconds and 3 git commands to generate.