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