1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = System/Libraries
11 url = http://www.mozilla.org/projects/nspr/
12 license = MPLv1.1 or GPLv2+ or LGPLv2+
13 summary = Netscape Portable Runtime.
16 NSPR provides platform independence for non-GUI operating system
17 facilities. These facilities include threads, thread synchronization,
18 normal file and network I/O, interval timing and calendar time, basic
19 memory management (malloc and free) and shared library linking.
22 source_dl = ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/
29 # Original nspr-config is not suitable for our distribution,
30 # because on different platforms it contains different dynamic content.
31 # Therefore we produce an adjusted copy of nspr-config that will be
32 # identical on all platforms.
33 # However, we need to use original nspr-config to produce some variables
34 # that go into nspr.pc for pkg-config.
37 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{sources}
39 cp -vf %{DIR_APP}/mozilla/nsprpub/config/nspr-config.in \
40 %{DIR_APP}/mozilla/nsprpub/config/nspr-config-pc.in
41 cp -vf %{DIR_SOURCE}/nspr-config-vars.in \
42 %{DIR_APP}/mozilla/nsprpub/config/
48 if "%{DISTRO_ARCH}" == "x86_64"
49 configure_options += \
53 if "%{DISTRO_ARCH}" == "armv7hl"
54 configure_options += \
58 configure_options += \
59 --includedir=/usr/include/nspr4 \
60 --enable-optimize="%{CFLAGS}" \
64 %{DIR_APP}/mozilla/nsprpub/configure \
71 mkdir -pv %{BUILDROOT}/usr/{bin,%{lib}}
72 mkdir -pv %{BUILDROOT}%{libdir}/pkgconfig
74 cp -vf %{DIR_APP}/config/nspr-config-pc \
75 %{BUILDROOT}/usr/bin/nspr-config
78 -e "s,%libdir%,%{libdir},g" \
79 -e "s,%prefix%,/usr,g" \
80 -e "s,%exec_prefix%,/usr,g" \
81 -e "s,%includedir%,/usr/include/nspr4,g" \
82 -e "s,%NSPR_VERSION%,%{version},g" \
83 -e "s,%FULL_NSPR_LIBS%,-L%{libdir} -lnspr4 -lplc4 -lplds4 -ldl -lpthread,g" \
84 -e "s,%FULL_NSPR_CFLAGS%,-I/usr/include/nspr4,g" \
85 < %{DIR_SOURCE}/nspr.pc.in \
86 > %{BUILDROOT}%{libdir}/pkgconfig/nspr.pc
88 # Remove unneeded stuff
90 %{BUILDROOT}/usr/bin/compile-et.pl \
91 %{BUILDROOT}/usr/bin/prerr.properties \
92 %{BUILDROOT}/usr/share/aclocal/nspr.m4 \
93 %{BUILDROOT}/usr/include/nspr4/md
100 package %{name}-devel
103 # libs are not versioned.
104 files += !%{libdir}/*.so
107 package %{name}-debuginfo