]> git.pld-linux.org Git - packages/js187.git/blob - js187.spec
7b90c26e7ba78c6f7ab1c6e5aef2896432305b0c
[packages/js187.git] / js187.spec
1 # NOTE: JavaScript version is 1.8.7, implementation version is 1.0.0; what should be package version?
2 # Some paths (library name, .pc file) seem intentionally not conflict with js < 1.8,
3 # but some still do (includes path, js-config, js shell).
4 # It's somehow messy, so let's put this version in separate js187 package for now,
5 # until upstream decides which way to go in the future.
6 #
7 # Conditional build:
8 %bcond_without  default_js      # build as default js package
9
10 Summary:        SpiderMonkey JavaScript 1.8.7 implementation
11 Summary(pl.UTF-8):      Implementacja SpiderMonkey języka JavaScript 1.8.7
12 Name:           js187
13 Version:        1.0.0
14 Release:        3
15 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
16 Group:          Development/Languages
17 #Source0:       http://ftp.mozilla.org/pub/mozilla.org/js/%{name}-%{version}.tar.gz
18 Source0:        %{name}-%{version}.tar.gz
19 # Source0-md5:  9399466aa36e98e157cb3780c3f96dde
20 Patch0:         %{name}-install.patch
21 Patch1:         %{name}-x32.patch
22 URL:            http://www.mozilla.org/js/
23 BuildRequires:  libstdc++-devel
24 BuildRequires:  nspr-devel >= 4.7.0
25 BuildRequires:  perl-base >= 1:5.6
26 BuildRequires:  python >= 1:2.5
27 BuildRequires:  readline-devel
28 BuildRequires:  rpm-perlprov
29 BuildRequires:  rpmbuild(macros) >= 1.294
30 BuildRequires:  sed >= 4.0
31 Requires:       %{name}-libs = %{version}-%{release}
32 %if %{with default_js}
33 Provides:       js = 2:1.8.7
34 Obsoletes:      js < 2:1.8.7
35 %endif
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 JavaScript Reference Implementation (codename SpiderMonkey). The
40 package contains JavaScript runtime (compiler, interpreter,
41 decompiler, garbage collector, atom manager, standard classes) and
42 small "shell" program that can be used interactively and with .js
43 files to run scripts.
44
45 %description -l pl.UTF-8
46 Wzorcowa implementacja JavaScriptu (o nazwie kodowej SpiderMonkey).
47 Pakiet zawiera środowisko uruchomieniowe (kompilator, interpreter,
48 dekompilator, odśmiecacz, standardowe klasy) i niewielką powłokę,
49 która może być używana interaktywnie lub z plikami .js do uruchamiania
50 skryptów.
51
52 %package libs
53 Summary:        SpiderMonkey JavaScript 1.8.7 library
54 Summary(pl.UTF-8):      Biblioteka SpiderMonkey JavaScript 1.8.7
55 Group:          Libraries
56 Requires:       nspr >= 4.7.0
57 Conflicts:      js187 < 1.0.0-2
58
59 %description libs
60 SpiderMonkey JavaScript 1.8.7 library.
61
62 %description libs -l pl.UTF-8
63 Biblioteka SpiderMonkey JavaScript 1.8.7.
64
65 %package devel
66 Summary:        Header files for JavaScript 1.8.7 reference library
67 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki JavaScript 1.8.7
68 Group:          Development/Libraries
69 Requires:       %{name}-libs = %{version}-%{release}
70 Requires:       libstdc++-devel
71 Requires:       nspr-devel >= 4.7.0
72 %if %{with default_js}
73 Provides:       js-devel = 2:1.8.7
74 Obsoletes:      js-devel < 2:1.8.7
75 %endif
76
77 %description devel
78 Header files for JavaScript 1.8.7 reference library.
79
80 %description devel -l pl.UTF-8
81 Pliki nagłówkowe biblioteki JavaScript 1.8.7.
82
83 %package static
84 Summary:        Static JavaScript 1.8.7 reference library
85 Summary(pl.UTF-8):      Statyczna biblioteka JavaScript 1.8.7
86 Group:          Development/Libraries
87 Requires:       %{name}-devel = %{version}-%{release}
88 %if %{with default_js}
89 Provides:       js-static = 2:1.8.7
90 Obsoletes:      js-static < 2:1.8.7
91 %endif
92
93 %description static
94 Static version of JavaScript 1.8.7 reference library.
95
96 %description static -l pl.UTF-8
97 Statyczna wersja biblioteki JavaScript 1.8.7.
98
99 %prep
100 %setup -q -n js-1.8.7
101 %patch0 -p1
102 %patch1 -p1
103
104 sed -i -e 's/-O3//' js/src/Makefile.in js/src/config/Makefile.in
105
106 %build
107 cd js/src
108 %configure2_13 \
109         --enable-readline \
110         --enable-threadsafe \
111         --enable-system-ffi \
112         --disable-methodjit \
113         --with-system-nspr
114
115 %{__make} \
116         HOST_OPTIMIZE_FLAGS= \
117         MOZILLA_VERSION=%{version}
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
122 %{__make} -j1 -C js/src install \
123         DESTDIR=$RPM_BUILD_ROOT \
124         MOZILLA_VERSION=%{version} \
125         MODULE=%{name}
126
127 # not installed by make install
128 cp -aL js/src/dist/include/{ds,gc,js,mozilla,vm} $RPM_BUILD_ROOT%{_includedir}/js187
129
130 # not installed by make install in new buildsystem
131 install js/src/shell/js $RPM_BUILD_ROOT%{_bindir}/js187
132
133 %{__mv} $RPM_BUILD_ROOT%{_bindir}/js-config $RPM_BUILD_ROOT%{_bindir}/js187-config
134
135 # fix symlinks pointing to buildroot
136 ln -sf libmozjs187.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libmozjs187.so
137 ln -sf libmozjs187.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/libmozjs187.so.1.0
138
139 %if %{with default_js}
140 # provide symlinks as default js implementation
141 # (don't provide libjs.so.1 as the libraries are not binary-compatible)
142 ln -sf libmozjs187.so $RPM_BUILD_ROOT%{_libdir}/libjs.so
143 ln -sf libmozjs187-1.0.a $RPM_BUILD_ROOT%{_libdir}/libjs.a
144 ln -sf js187 $RPM_BUILD_ROOT%{_includedir}/js
145 ln -sf js187 $RPM_BUILD_ROOT%{_bindir}/js
146 ln -sf js187-config $RPM_BUILD_ROOT%{_bindir}/js-config
147 %else
148 %{__sed} -i -e 's,/js$,/js187,' $RPM_BUILD_ROOT%{_pkgconfigdir}/mozjs187.pc
149 %endif
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %post   libs -p /sbin/ldconfig
155 %postun libs -p /sbin/ldconfig
156
157 %if %{with default_js}
158 %pretrans devel
159 if [ -d %{_includedir}/js ] && [ ! -L %{_includedir}/js ]; then
160         rm -rf /usr/include/js
161 fi
162 %endif
163
164 %files
165 %defattr(644,root,root,755)
166 %doc js/src/README.html
167 %attr(755,root,root) %{_bindir}/js187
168 %if %{with default_js}
169 %attr(755,root,root) %{_bindir}/js
170 %endif
171
172 %files libs
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_libdir}/libmozjs187.so.*.*.*
175 %attr(755,root,root) %ghost %{_libdir}/libmozjs187.so.1.0
176
177 %files devel
178 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_bindir}/js187-config
180 %attr(755,root,root) %{_libdir}/libmozjs187.so
181 %{_includedir}/js187
182 %{_pkgconfigdir}/mozjs187.pc
183 %if %{with default_js}
184 %attr(755,root,root) %{_bindir}/js-config
185 %attr(755,root,root) %{_libdir}/libjs.so
186 %{_includedir}/js
187 %endif
188
189 %files static
190 %defattr(644,root,root,755)
191 %{_libdir}/libmozjs187-1.0.a
192 %if %{with default_js}
193 %{_libdir}/libjs.a
194 %endif
This page took 0.117841 seconds and 2 git commands to generate.