Contents of /smage/trunk/include/alx-split.sminc
Parent Directory | Revision Log
Revision 6984 -
(show annotations)
(download)
Thu Jul 30 16:11:30 2015 UTC (9 years, 3 months ago) by niro
File size: 5568 byte(s)
Thu Jul 30 16:11:30 2015 UTC (9 years, 3 months ago) by niro
File size: 5568 byte(s)
-honor empty SDEPEND
1 | # $Id$ |
2 | # alx split packages |
3 | |
4 | sminclude alx cleanutils |
5 | |
6 | # global split defines |
7 | : ${SPLIT_PACKAGES="${PNAME} ${PNAME}-dev"} |
8 | |
9 | # honor empty SDEPEND |
10 | if [[ ! -z ${ALX_DEV_DEPEND} ]] && [[ -z ${SDEPEND} ]] |
11 | then |
12 | SDEPEND="${ALX_DEV_DEPEND}" |
13 | fi |
14 | |
15 | # some basics defines: |
16 | |
17 | # zap in normal packages |
18 | ALX_ZAPMOST_OPTS="" |
19 | |
20 | # delete from normal packages |
21 | ALX_RM_OPTS="usr/$(mlibdir)/*.a |
22 | usr/$(mlibdir)/*.la |
23 | usr/$(mlibdir)/pkgconfig |
24 | usr/share/aclocal |
25 | usr/share/doc |
26 | usr/share/info |
27 | usr/share/locale |
28 | usr/share/man |
29 | usr/include" |
30 | |
31 | # zap in dev packages |
32 | ALX_DEV_ZAPMOST_OPTS="" |
33 | |
34 | # delete from dev packages |
35 | ALX_DEV_RM_OPTS="" |
36 | |
37 | # be backward compatible |
38 | if [[ ! -z ${ALX_ONLY_KEEP} ]] |
39 | then |
40 | ALX_PKG_KEEP="${ALX_ONLY_KEEP}" |
41 | echo -e "${COLYELLOW}Warning: 'ALX_ONLY_KEEP' is deprecated and gets removed in the future.${COLDEFAULT}" |
42 | echo -e "${COLYELLOW} Please modify this smage2 script to use the 'ALX_PKG_KEEP' variable.${COLDEFAULT}" |
43 | unset ALX_ONLY_KEEP |
44 | fi |
45 | if [[ ! -z ${ALX_DEV_ONLY_KEEP} ]] |
46 | then |
47 | ALX_DEV_PKG_KEEP="${ALX_DEV_ONLY_KEEP}" |
48 | echo -e "${COLYELLOW}Warning: 'ALX_DEV_ONLY_KEEP' is deprecated and gets removed in the future.${COLDEFAULT}" |
49 | echo -e "${COLYELLOW} Please modify this smage2 script to use the 'ALX_DEV_PKG_KEEP' variable.${COLDEFAULT}" |
50 | unset ALX_DEV_ONLY_KEEP |
51 | fi |
52 | |
53 | # alx keeps |
54 | if [[ ! -z ${ALX_PKG_KEEP} ]] |
55 | then |
56 | ALX_ZAPMOST_OPTS+=" ${ALX_PKG_KEEP}" |
57 | ALX_DEV_RM_OPTS+=" ${ALX_PKG_KEEP}" |
58 | else |
59 | ALX_RM_OPTS+=" $(mlibdir)/*.so |
60 | usr/$(mlibdir)/*.so |
61 | $([[ $(mlibdir) != lib ]] && echo 'lib/*.so usr/lib/*.so')" |
62 | fi |
63 | |
64 | # alx dev keeps |
65 | if [[ ! -z ${ALX_DEV_PKG_KEEP} ]] |
66 | then |
67 | ALX_DEV_ZAPMOST_OPTS+=" ${ALX_DEV_PKG_KEEP}" |
68 | ALX_RM_OPTS+=" ${ALX_DEV_PKG_KEEP}" |
69 | else |
70 | ALX_DEV_RM_OPTS+=" $(mlibdir)/*.so.* |
71 | usr/$(mlibdir)/*.so.* |
72 | $([[ $(mlibdir) != lib ]] && echo 'lib/*.so.* usr/lib/*.so.*')" |
73 | fi |
74 | |
75 | alx-split_generate_split_info() |
76 | { |
77 | eval "split_info_${PNAME}() |
78 | { |
79 | DESCRIPTION=\"${DESCRIPTION}\" |
80 | DEPEND=\"${DEPEND}\" |
81 | if [[ ! -z \${ALX_DEPEND} ]] |
82 | then |
83 | DEPEND=\"\${DEPEND} |
84 | \${ALX_DEPEND}\" |
85 | fi |
86 | _PNAME=\"${PNAME}\" |
87 | }" |
88 | } |
89 | |
90 | alx-split_generate_split_info_dev() |
91 | { |
92 | eval "split_info_${PNAME}-dev() |
93 | { |
94 | DESCRIPTION=\"Development files for ${PCAT}/${PNAME}-${PVER}-${PBUILD}.\" |
95 | DEPEND=\"== ${PCAT}/${PNAME}-${PVER}\" |
96 | if [[ ! -z \${ALX_DEV_DEPEND} ]] |
97 | then |
98 | DEPEND=\"\${DEPEND} |
99 | \${ALX_DEV_DEPEND}\" |
100 | fi |
101 | _PNAME=\"${PNAME}\" |
102 | }" |
103 | } |
104 | |
105 | # honor multilib builds |
106 | if [[ ${MULTILIB_BUILD} = true ]] |
107 | then |
108 | if [[ ! -z $(typeset -f src_install) ]] |
109 | then |
110 | # rename the old one |
111 | old_alx_src_install=old_alx_$(typeset -f src_install) |
112 | eval "${old_alx_src_install}" |
113 | |
114 | alx_generic_src_install() |
115 | { |
116 | old_alx_src_install || die |
117 | } |
118 | fi |
119 | fi |
120 | |
121 | alx-split_generate_src_install_dev() |
122 | { |
123 | eval "alx-split_src_install_${PNAME}-dev() |
124 | { |
125 | cd \${SRCDIR} |
126 | if [[ ! -z \$(typeset -f alx_generic_src_install) ]] |
127 | then |
128 | alx_generic_src_install |
129 | else |
130 | mmake DESTDIR=\${BINDIR} install || die |
131 | |
132 | local i |
133 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
134 | FAQ LICENSE NEWS README TODO |
135 | do |
136 | if [ -f \${SRCDIR}/\${i} ] |
137 | then |
138 | minstalldocs \${i} || die |
139 | fi |
140 | done |
141 | fi |
142 | |
143 | if [[ ! -z \${ALX_DEV_RM_OPTS} ]] |
144 | then |
145 | local i |
146 | for i in \${ALX_DEV_RM_OPTS} |
147 | do |
148 | case \${i} in |
149 | *\**|*\\\**) |
150 | if [[ -e \${BINDIR}/\$(dirname \${i}) ]] |
151 | then |
152 | echo find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm |
153 | find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm |
154 | fi |
155 | ;; |
156 | *) |
157 | if [[ -e \${BINDIR}/\${i} ]] |
158 | then |
159 | echo rm -r \${BINDIR}/\${i} |
160 | rm -r \${BINDIR}/\${i} || die |
161 | # busybox does not detect symlinks with -e if the reference does not exists |
162 | elif [[ -L \${BINDIR}/\${i} ]] |
163 | then |
164 | echo rm -r \${BINDIR}/\${i} |
165 | rm -r \${BINDIR}/\${i} || die |
166 | fi |
167 | ;; |
168 | esac |
169 | done |
170 | fi |
171 | |
172 | if [[ ! -z \${ALX_DEV_ZAPMOST_OPTS} ]] |
173 | then |
174 | zapmost \${BINDIR} \${ALX_DEV_ZAPMOST_OPTS} || die |
175 | fi |
176 | }" |
177 | } |
178 | |
179 | alx-split_generate_src_install() |
180 | { |
181 | eval "alx-split_src_install_${PNAME}() |
182 | { |
183 | cd \${SRCDIR} |
184 | if [[ ! -z \$(typeset -f alx_generic_src_install) ]] |
185 | then |
186 | alx_generic_src_install |
187 | else |
188 | mmake DESTDIR=\${BINDIR} install || die |
189 | |
190 | local i |
191 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
192 | FAQ LICENSE NEWS README TODO |
193 | do |
194 | if [ -f \${SRCDIR}/\${i} ] |
195 | then |
196 | minstalldocs \${i} || die |
197 | fi |
198 | done |
199 | fi |
200 | |
201 | if [[ ! -z \${ALX_RM_OPTS} ]] |
202 | then |
203 | local i |
204 | for i in \${ALX_RM_OPTS} |
205 | do |
206 | case \${i} in |
207 | *\**|*\\\**) |
208 | if [[ -e \${BINDIR}/\$(dirname \${i}) ]] |
209 | then |
210 | echo find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm |
211 | find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm |
212 | fi |
213 | ;; |
214 | *) |
215 | if [[ -e \${BINDIR}/\${i} ]] |
216 | then |
217 | echo rm -r \${BINDIR}/\${i} |
218 | rm -r \${BINDIR}/\${i} || die |
219 | # busybox does not detect symlinks with -e if the reference does not exists |
220 | elif [[ -L \${BINDIR}/\${i} ]] |
221 | then |
222 | echo rm -r \${BINDIR}/\${i} |
223 | rm -r \${BINDIR}/\${i} || die |
224 | fi |
225 | ;; |
226 | esac |
227 | done |
228 | fi |
229 | |
230 | if [[ ! -z \${ALX_ZAPMOST_OPTS} ]] |
231 | then |
232 | zapmost \${BINDIR} \${ALX_ZAPMOST_OPTS} || die |
233 | fi |
234 | }" |
235 | } |
236 | |
237 | alx-split_generate_split_info |
238 | alx-split_generate_split_info_dev |
239 | |
240 | alx-split_generate_src_install_dev |
241 | alx-split_generate_src_install |
242 | |
243 | export_inherits alx-split src_install_${PNAME} src_install_${PNAME}-dev |