Magellan Linux

Contents of /smage/branches/alx07x-unstable/core/nspr/nspr-4.19-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12247 - (show annotations) (download)
Fri Aug 31 11:07:19 2018 UTC (5 years, 7 months ago) by niro
File size: 2713 byte(s)
-release branches/alx07x-unstable
1 # $Id$
2
3 PNAME="nspr"
4 PVER="4.19"
5 PBUILD="r1"
6
7 PCAT="dev-libs"
8
9 DESCRIPTION="Netscape Portable Runtime (NSPR)."
10 HOMEPAGE="http://www.mozilla.org/projects/nspr/"
11
12 DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1"
13 SPECIAL_VARS="DEPEND_x86_64"
14
15 DEPEND="$(marchdepend)
16 >= virtual/glibc"
17
18 SRCFILE="${PNAME}-${PVER/.0/}.tar.gz"
19 SRCDIR="${BUILDDIR}/${PNAME}-${PVER/.0/}"
20
21 ALX_PKG_KEEP="etc/env.d usr/$(mlibdir)/nspr/*.so usr/$(mlibdir)/nspr/*.so.*"
22 sminclude mtools multilib alx-split
23 msetfeature "!check"
24
25 SRC_URI=(
26 http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PVER/.0/}/src/${SRCFILE}
27 mirror://${PNAME}/${SRCFILE}
28 )
29
30 UP2DATE="updatecmd http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ | grep 'releases/v[0-9]' | sed 's:.*releases/v\(.*\):\1:' | sed 's:/::' | upsort_pipe"
31
32 src_prepare()
33 {
34 munpack ${SRCFILE} || die
35
36 all-abis install -d ${SRCDIR}-$(mabi)/build || die
37 all-abis install -d ${SRCDIR}-$(mabi)/inst || die
38 }
39
40 src_compile()
41 {
42 local abi
43 for abi in ${MULTILIB_ABIS}
44 do
45 case ${abi} in
46 m32) ABI_LIBDIR="lib";;
47 m64) ABI_LIBDIR="lib64";;
48 esac
49 cd ${SRCDIR}-${abi}/build
50
51 local conf
52 [[ ${abi} = m64 ]]&& conf="--enable-64bit"
53
54 ../nspr/configure \
55 --host=${CHOST} \
56 --prefix=/usr \
57 --infodir=/usr/share/info \
58 --mandir=/usr/share/man \
59 --libdir=/usr/$(mlibdir)/nspr \
60 --enable-ipv6 \
61 ${conf} \
62 || die
63
64 make || die
65 done
66 }
67
68 alx_generic_src_install()
69 {
70 local abi
71 for abi in ${MULTILIB_ABIS}
72 do
73 case ${abi} in
74 m32) ABI_LIBDIR="lib";;
75 m64) ABI_LIBDIR="lib64";;
76 esac
77 cd ${SRCDIR}-${abi}/build
78
79 make install || die
80
81 minstalldir /usr || die
82 cp -rfL dist/* ${BINDIR}/usr || die
83
84 # remove the libs from bindir
85 rm -rf ${BINDIR}/usr/bin/lib*.so || die
86
87 # move all file to /usr/lib/nspr as the built system is broken
88 # this fixes libdir on 64bit arches also
89 minstalldir /usr/$(mlibdir)/nspr || die
90 mv ${BINDIR}/usr/lib/*so* ${BINDIR}/usr/$(mlibdir)/nspr || die
91 mv ${BINDIR}/usr/lib/*\.a ${BINDIR}/usr/$(mlibdir)/nspr || die
92
93 # install nspr-config
94 minstallexec config/nspr-config /usr/bin/nspr-config-${abi} || die
95
96 # install pkg-config file
97 minstalldir /usr/$(mlibdir)/pkgconfig || die
98 minstallfile config/nspr.pc /usr/$(mlibdir)/pkgconfig || die
99
100 # inform the system about the new ldpath
101 minstalldir /etc/env.d || die
102 echo "LDPATH=/usr/$(mlibdir)/nspr" > ${BINDIR}/etc/env.d/08nspr-${abi} || die
103
104 if [[ ${ARCH} = x86_64 ]]
105 then
106 mlink multiarch-wrapper /usr/bin/nspr-config || die
107 else
108 mlink nspr-config-${abi} /usr/bin/nspr-config || die
109 fi
110 done
111 }
112
113 preinstall()
114 {
115 add_conf_prot_mask /etc/env.d
116 }
117
118 postinstall()
119 {
120 if [[ -f ${MROOT}/etc/env.d/08nspr ]]
121 then
122 rm ${MROOT}/etc/env.d/08nspr
123 fi
124 }