]> git.ipfire.org Git - ipfire-3.x.git/blame - nspr/nspr.nm
nspr: Make package work on x86_64.
[ipfire-3.x.git] / nspr / nspr.nm
CommitLineData
4b2af69a 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
4b2af69a
MT
4###############################################################################
5
802ea3af
MT
6name = nspr
7version = 4.8.6
b90bd413 8release = 2
4b2af69a 9
802ea3af
MT
10groups = System/Libraries
11url = http://www.mozilla.org/projects/nspr/
12license = MPLv1.1 or GPLv2+ or LGPLv2+
13summary = Netscape Portable Runtime.
d615a5b0 14
802ea3af
MT
15description
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
4b2af69a 19 memory management (malloc and free) and shared library linking.
802ea3af
MT
20end
21
22source_dl =
23
24build
25 requires
26 pkg-config
27 end
28
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.
35
36 prepare
37 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{sources}
38
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/
43 cd %{DIR_APP}
44
45 %{MACRO_PATCHES}
46 end
47
b90bd413
MT
48 if "%{DISTRO_ARCH}" == "x86_64"
49 configure_options += \
50 --enable-64bit
51 end
52
53 if "%{DISTRO_ARCH}" == "armv7hl"
54 configure_options += \
55 --enable-thumb2
56 end
57
58 configure_options += \
59 --libdir=/%{lib} \
60 --includedir=/usr/include/nspr4 \
61 --enable-optimize="%{CFLAGS}" \
62 --disable-debug
63
802ea3af
MT
64 build
65 %{DIR_APP}/mozilla/nsprpub/configure \
b90bd413 66 %{configure_options}
802ea3af
MT
67
68 make
69 end
70
71 install_cmds
b90bd413
MT
72 mkdir -pv %{BUILDROOT}/usr/{bin,%{lib}}
73 mkdir -pv %{BUILDROOT}/%{lib}
74 mkdir -pv %{BUILDROOT}%{libdir}/pkgconfig
802ea3af
MT
75
76 cp -vf %{DIR_APP}/config/nspr-config-pc \
77 %{BUILDROOT}/usr/bin/nspr-config
78
79 sed \
b90bd413 80 -e "s,%libdir%,%{libdir},g" \
802ea3af
MT
81 -e "s,%prefix%,/usr,g" \
82 -e "s,%exec_prefix%,/usr,g" \
83 -e "s,%includedir%,/usr/include/nspr4,g" \
84 -e "s,%NSPR_VERSION%,%{version},g" \
b90bd413 85 -e "s,%FULL_NSPR_LIBS%,-L%{libdir} -lnspr4 -lplc4 -lplds4 -ldl -lpthread,g" \
802ea3af
MT
86 -e "s,%FULL_NSPR_CFLAGS%,-I/usr/include/nspr4,g" \
87 < %{DIR_SOURCE}/nspr.pc.in \
b90bd413 88 > %{BUILDROOT}%{libdir}/pkgconfig/nspr.pc
802ea3af
MT
89
90 #mv -v %{BUILDROOT}/usr/lib/lib{nspr,plc.plds}4.so %{BUILDROOT}/lib/
b90bd413
MT
91 ln -svf ../../%{lib}/libnspr4.so %{BUILDROOT}%{libdir}/libnspr4.so
92 ln -svf ../../%{lib}/libplc4.so %{BUILDROOT}%{libdir}/libplc4.so
93 ln -svf ../../%{lib}/libplds4.so %{BUILDROOT}%{libdir}/libplds4.so
802ea3af
MT
94
95 # Remove unneeded stuff
96 rm -rfv \
97 %{BUILDROOT}/usr/bin/compile-et.pl \
98 %{BUILDROOT}/usr/bin/prerr.properties \
99 %{BUILDROOT}/usr/share/aclocal/nspr.m4 \
100 %{BUILDROOT}/usr/include/nspr4/md
101 end
102end
103
104packages
105 package %{name}
106
107 package %{name}-devel
108 template DEVEL
109 end
1f9bc2f0
MT
110
111 package %{name}-debuginfo
112 template DEBUGINFO
113 end
802ea3af 114end