Contents of /smage/trunk/core/ncurses/ncurses-5.7-r5.smage2
Parent Directory | Revision Log
Revision 663 -
(show annotations)
(download)
Thu Oct 21 12:13:39 2010 UTC (13 years, 7 months ago) by niro
File size: 5117 byte(s)
Thu Oct 21 12:13:39 2010 UTC (13 years, 7 months ago) by niro
File size: 5117 byte(s)
-mcore
1 | # $Id: ncurses-5.7-r4.smage2 5487 2010-06-30 00:01:42Z niro $ |
2 | |
3 | PNAME="ncurses" |
4 | PVER="5.7" |
5 | PBUILD="r5" |
6 | |
7 | PCATEGORIE="sys-libs" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="Linux console display library." |
11 | HOMEPAGE="http://www.gnu.org/software/ncurses/ncurses.html" |
12 | |
13 | DEPEND=">= virtual/glibc" |
14 | |
15 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
16 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
17 | |
18 | MCORE_ONLY_KEEP="$(mlibdir)/*.so |
19 | $(mlibdir)/*.so.* |
20 | usr/$(mlibdir)/*.so |
21 | usr/$(mlibdir)/*.so.* |
22 | usr/share/tabset |
23 | usr/share/terminfo/l/linux |
24 | usr/share/terminfo/r/rxvt |
25 | usr/share/terminfo/v/vt100 |
26 | usr/share/terminfo/x/xterm |
27 | usr/share/terminfo/x/xterm-color" |
28 | |
29 | sminclude mtools multilib mcore-split |
30 | |
31 | SRC_URI=( |
32 | gnu://${PNAME}/${SRCFILE} |
33 | mirror://${PNAME}/${SRCFILE} |
34 | mirror://${PNAME}/${PNAME}-${PVER}-branch-update-20081213.patch |
35 | ) |
36 | |
37 | UP2DATE="updatecmd_gnu ${PNAME} gz" |
38 | |
39 | src_prepare() |
40 | { |
41 | # non widec |
42 | munpack ${SRCFILE} || die |
43 | for abi in ${MULTILIB_ABIS} |
44 | do |
45 | mv ${SRCDIR}{,-non-widec}-${abi} || die |
46 | done |
47 | SRCDIR="${SRCDIR}-non-widec" mpatch ${PNAME}-${PVER}-branch-update-20081213.patch || die |
48 | |
49 | # widec |
50 | munpack ${SRCFILE} || die |
51 | mpatch ${PNAME}-${PVER}-branch-update-20081213.patch || die |
52 | } |
53 | |
54 | src_compile() |
55 | { |
56 | # fixes build issues on multilib; do not export any ABI_LDFLAGS |
57 | EXPORT_ABI_LDFLAGS=false |
58 | |
59 | # widec |
60 | # -hashed-db needs Berkeley DB |
61 | mconfigure --with-shared --without-debug --without-hashed-db --enable-widec || die |
62 | # fix parallel make builds |
63 | mmake -j1 sources || die |
64 | mmake || die |
65 | |
66 | # non-widec |
67 | # -hashed-db needs Berkeley DB |
68 | SRCDIR="${SRCDIR}-non-widec" mconfigure --with-shared --without-debug --without-hashed-db || die |
69 | # fix parallel make builds |
70 | SRCDIR="${SRCDIR}-non-widec" mmake -j1 sources || die |
71 | SRCDIR="${SRCDIR}-non-widec" mmake || die |
72 | } |
73 | |
74 | mcore_generic_src_install() |
75 | { |
76 | # needed directories |
77 | minstalldir /$(mlibdir) || die |
78 | |
79 | minstall_destdir || die |
80 | |
81 | mchmod 755 /usr/$(mlibdir)/\*.${PVER} || die |
82 | mchmod 644 /usr/$(mlibdir)/libncurses++w.a || die |
83 | mv ${BINDIR}/usr/$(mlibdir)/libncursesw.so.5* ${BINDIR}/$(mlibdir) || die |
84 | mlink ../../$(mlibdir)/libncursesw.so.5 /usr/$(mlibdir)/libncursesw.so || die |
85 | mlink libncursesw.so /usr/$(mlibdir)/libcursesw.so || die |
86 | |
87 | # non-widec compat |
88 | for lib in curses ncurses form panel menu |
89 | do |
90 | echo "INPUT(-l${lib}w)" > ${BINDIR}/usr/$(mlibdir)/lib${lib}.so || die |
91 | mlink lib${lib}w.a /usr/$(mlibdir)/lib${lib}.a || die |
92 | done |
93 | mlink libcurses.so /usr/$(mlibdir)/libcursesw.so || die |
94 | mlink libncurses.so /usr/$(mlibdir)/libcurses.so || die |
95 | mlink libncursesw.a /usr/$(mlibdir)/libcursesw.a || die |
96 | mlink libncurses.a /usr/$(mlibdir)/libcurses.a || die |
97 | mlink libncurses++w.a /usr/$(mlibdir)/libncurses++.a || die |
98 | # curses-config too |
99 | mlink ncursesw5-config /usr/bin/ncurses5-config || die |
100 | |
101 | # move the -m32 libs also to the right place (multilib) |
102 | if [[ $(mlibdir) != lib ]] |
103 | then |
104 | minstalldir /lib || die |
105 | mchmod 755 /usr/lib/\*.${PVER} || die |
106 | mchmod 644 /usr/lib/libncurses++w.a || die |
107 | mv ${BINDIR}/usr/lib/libncursesw.so.5* ${BINDIR}/lib || die |
108 | mlink ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so || die |
109 | mlink libncursesw.so /usr/lib/libcursesw.so || die |
110 | |
111 | # non-widec compat |
112 | for lib in curses ncurses form panel menu |
113 | do |
114 | echo "INPUT(-l${lib}w)" > ${BINDIR}/usr/lib/lib${lib}.so || die |
115 | mlink lib${lib}w.a /usr/lib/lib${lib}.a || die |
116 | done |
117 | mlink libcurses.so /usr/lib/libcursesw.so || die |
118 | mlink libncurses.so /usr/lib/libcurses.so || die |
119 | mlink libncursesw.a /usr/lib/libcursesw.a || die |
120 | mlink libncurses.a /usr/lib/libcurses.a || die |
121 | mlink libncurses++w.a /usr/lib/libncurses++.a || die |
122 | fi |
123 | |
124 | # install non-widec runtime compat library (do not use minstalllib, |
125 | # we need libcnurses.so with loader hint for libncursesw and not a plain symlink! |
126 | all-abis minstallexec ${SRCDIR}-non-widec-'$abi'/lib/libncurses.so.${PVER} /usr/'$(mlibdir)' || die |
127 | all-abis mlink libncurses.so.${PVER} /usr/'$(mlibdir)'/libncurses.so.${PVER%%.*} || die |
128 | |
129 | # fixes a small man issue |
130 | if [ -e ${BINDIR}/usr/share/man/tack.1 ] |
131 | then |
132 | mv ${BINDIR}/usr/share/man/tack.1 \ |
133 | ${BINDIR}/usr/share/man/man1 || die |
134 | fi |
135 | |
136 | # fix to enable colors in the default xterm |
137 | mv ${BINDIR}/usr/share/terminfo/x/xterm \ |
138 | ${BINDIR}/usr/share/terminfo/x/xterm.orig || die |
139 | mlink xterm-color /usr/share/terminfo/x/xterm || die |
140 | |
141 | minstalldocs ANNOUNCE MANIFEST NEWS README* TO-DO || die |
142 | } |
143 | |
144 | preinstall() |
145 | { |
146 | if [ -L ${MROOT}/usr/$(mlibdir)/libncurses.so ] |
147 | then |
148 | rm ${MROOT}/usr/$(mlibdir)/libncurses.so || die |
149 | fi |
150 | |
151 | if [ -L ${MROOT}/usr/$(mlibdir)/libncurses.so.5 ] |
152 | then |
153 | rm ${MROOT}/usr/$(mlibdir)/libncurses.so.5 || die |
154 | fi |
155 | |
156 | if [ -L ${MROOT}/usr/$(mlibdir)/libcurses.so.5 ] |
157 | then |
158 | rm ${MROOT}/usr/$(mlibdir)/libcurses.so.5 || die |
159 | fi |
160 | |
161 | if [[ $(mlibdir) != lib ]] |
162 | then |
163 | if [ -L ${MROOT}/usr/lib/libncurses.so ] |
164 | then |
165 | rm ${MROOT}/usr/lib/libncurses.so || die |
166 | fi |
167 | |
168 | if [ -L ${MROOT}/usr/lib/libncurses.so.5 ] |
169 | then |
170 | rm ${MROOT}/usr/lib/libncurses.so.5 || die |
171 | fi |
172 | |
173 | if [ -L ${MROOT}/usr/lib/libcurses.so.5 ] |
174 | then |
175 | rm ${MROOT}/usr/lib/libcurses.so.5 || die |
176 | fi |
177 | fi |
178 | } |
179 | |
180 | postinstall() |
181 | { |
182 | # force ldconfig here |
183 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] |
184 | then |
185 | /sbin/ldconfig |
186 | fi |
187 | } |