Annotation of /smage/trunk/include/alx-split.sminc
Parent Directory | Revision Log
Revision 1670 -
(hide annotations)
(download)
Sun Jan 23 00:13:29 2011 UTC (13 years, 9 months ago) by niro
Original Path: smage/branches/alx-0_6_0/include/alx-split.sminc
File size: 4062 byte(s)
Sun Jan 23 00:13:29 2011 UTC (13 years, 9 months ago) by niro
Original Path: smage/branches/alx-0_6_0/include/alx-split.sminc
File size: 4062 byte(s)
-renamed variable ALX_REMOVE_DEPRECATED_MAGE_TARGETS to REMOVE_DEPRECATED_MAGE_TARGETS
1 | niro | 1667 | # $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 dev 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 normal packages | ||
26 | ALX_DEV_ZAPMOST_OPTS="" | ||
27 | |||
28 | # delete from dev packages | ||
29 | ALX_DEV_RM_OPTS="$(mlibdir)/*.so | ||
30 | $(mlibdir)/*.so.* | ||
31 | usr/$(mlibdir)/*.so | ||
32 | usr/$(mlibdir)/*.so.*" | ||
33 | |||
34 | # alx keeps | ||
35 | if [[ ! -z ${ALX_ONLY_KEEP} ]] | ||
36 | then | ||
37 | ALX_ZAPMOST_OPTS+=" ${ALX_ONLY_KEEP}" | ||
38 | ALX_DEV_RM_OPTS+=" ${ALX_ONLY_KEEP}" | ||
39 | fi | ||
40 | |||
41 | # alx dev keeps | ||
42 | if [[ ! -z ${ALX_DEV_ONLY_KEEP} ]] | ||
43 | then | ||
44 | ALX_DEV_ZAPMOST_OPTS+=" ${ALX_DEV_ONLY_KEEP}" | ||
45 | ALX_RM_OPTS+=" ${ALX_DEV_ONLY_KEEP}" | ||
46 | fi | ||
47 | |||
48 | SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} alx-split_postinstall" | ||
49 | |||
50 | alx-split_postinstall() | ||
51 | { | ||
52 | local target | ||
53 | |||
54 | niro | 1670 | case ${REMOVE_DEPRECATED_MAGE_TARGETS} in |
55 | niro | 1667 | 1|yes|true|TRUE) |
56 | for target in ${DEPRECATED_MAGE_TARGETS} | ||
57 | do | ||
58 | # first try to remove split_package_base target | ||
59 | if [[ ! -z $(magequery -n ${SPLIT_PACKAGE_BASE}-${target}) ]] | ||
60 | then | ||
61 | echo "removing deprecated mage-target '${SPLIT_PACKAGE_BASE}-${target}'" | ||
62 | mage uninstall ${SPLIT_PACKAGE_BASE}-${target} || die | ||
63 | fi | ||
64 | |||
65 | # then try to remove pname target | ||
66 | if [[ ! -z $(magequery -n ${PNAME}-${target}) ]] | ||
67 | then | ||
68 | echo "removing deprecated mage-target '${PNAME}-${target}'" | ||
69 | mage uninstall ${PNAME}-${target} || die | ||
70 | fi | ||
71 | done | ||
72 | ;; | ||
73 | esac | ||
74 | } | ||
75 | |||
76 | alx-split_generate_split_info() | ||
77 | { | ||
78 | eval "split_info_${PNAME}() | ||
79 | { | ||
80 | DESCRIPTION=\"${DESCRIPTION}\" | ||
81 | DEPEND=\"${DEPEND}\" | ||
82 | }" | ||
83 | } | ||
84 | |||
85 | alx-split_generate_split_info_dev() | ||
86 | { | ||
87 | eval "split_info_${PNAME}-dev() | ||
88 | { | ||
89 | DESCRIPTION=\"Development files for ${PCATEGORIE}/${PNAME}-${PVER}-${PBUILD}.\" | ||
90 | DEPEND=\"== ${PCATEGORIE}/${PNAME}-${PVER}\" | ||
91 | }" | ||
92 | } | ||
93 | |||
94 | alx-split_generate_src_install_dev() | ||
95 | { | ||
96 | eval "alx-split_src_install_${PNAME}-dev() | ||
97 | { | ||
98 | cd \${SRCDIR} | ||
99 | if [[ ! -z \$(typeset -f alx_generic_src_install) ]] | ||
100 | then | ||
101 | alx_generic_src_install | ||
102 | else | ||
103 | mmake DESTDIR=\${BINDIR} install || die | ||
104 | |||
105 | local i | ||
106 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
107 | FAQ LICENSE NEWS README TODO | ||
108 | do | ||
109 | if [ -f \${SRCDIR}/\${i} ] | ||
110 | then | ||
111 | minstalldocs \${i} || die | ||
112 | fi | ||
113 | done | ||
114 | fi | ||
115 | |||
116 | if [[ ! -z \${ALX_DEV_RM_OPTS} ]] | ||
117 | then | ||
118 | local i | ||
119 | for i in \${ALX_DEV_RM_OPTS} | ||
120 | do | ||
121 | case \${i} in | ||
122 | *\**|*\\\**) | ||
123 | if [[ -e \${BINDIR}/\$(dirname \${i}) ]] | ||
124 | then | ||
125 | find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm | ||
126 | fi | ||
127 | ;; | ||
128 | *) | ||
129 | if [[ -e \${BINDIR}/\${i} ]] | ||
130 | then | ||
131 | rm -r \${BINDIR}/\${i} || die | ||
132 | fi | ||
133 | ;; | ||
134 | esac | ||
135 | done | ||
136 | fi | ||
137 | |||
138 | if [[ ! -z \${ALX_DEV_ZAPMOST_OPTS} ]] | ||
139 | then | ||
140 | zapmost \${BINDIR} \${ALX_DEV_ZAPMOST_OPTS} || die | ||
141 | fi | ||
142 | }" | ||
143 | } | ||
144 | |||
145 | alx-split_generate_src_install() | ||
146 | { | ||
147 | eval "alx-split_src_install_${PNAME}() | ||
148 | { | ||
149 | cd \${SRCDIR} | ||
150 | if [[ ! -z \$(typeset -f alx_generic_src_install) ]] | ||
151 | then | ||
152 | alx_generic_src_install | ||
153 | else | ||
154 | mmake DESTDIR=\${BINDIR} install || die | ||
155 | |||
156 | local i | ||
157 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
158 | FAQ LICENSE NEWS README TODO | ||
159 | do | ||
160 | if [ -f \${SRCDIR}/\${i} ] | ||
161 | then | ||
162 | minstalldocs \${i} || die | ||
163 | fi | ||
164 | done | ||
165 | fi | ||
166 | |||
167 | if [[ ! -z \${ALX_RM_OPTS} ]] | ||
168 | then | ||
169 | local i | ||
170 | for i in \${ALX_RM_OPTS} | ||
171 | do | ||
172 | case \${i} in | ||
173 | *\**|*\\\**) | ||
174 | if [[ -e \${BINDIR}/\$(dirname \${i}) ]] | ||
175 | then | ||
176 | find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm | ||
177 | fi | ||
178 | ;; | ||
179 | *) | ||
180 | if [[ -e \${BINDIR}/\${i} ]] | ||
181 | then | ||
182 | rm -r \${BINDIR}/\${i} || die | ||
183 | fi | ||
184 | ;; | ||
185 | esac | ||
186 | done | ||
187 | fi | ||
188 | |||
189 | if [[ ! -z \${ALX_ZAPMOST_OPTS} ]] | ||
190 | then | ||
191 | zapmost \${BINDIR} \${ALX_ZAPMOST_OPTS} || die | ||
192 | fi | ||
193 | }" | ||
194 | } | ||
195 | |||
196 | alx-split_generate_split_info | ||
197 | alx-split_generate_split_info_dev | ||
198 | |||
199 | alx-split_generate_src_install_dev | ||
200 | alx-split_generate_src_install | ||
201 | |||
202 | export_inherits alx-split src_install_${PNAME} src_install_${PNAME}-dev |