Magellan Linux

Contents of /smage/trunk/include/alx-split.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4818 - (show annotations) (download)
Tue May 7 13:01:42 2013 UTC (11 years, 5 months ago) by niro
File size: 4269 byte(s)
-fixed broken split handling
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 _PNAME=\"${PNAME}\"
76 }"
77 }
78
79 alx-split_generate_split_info_dev()
80 {
81 eval "split_info_${PNAME}-dev()
82 {
83 DESCRIPTION=\"Development files for ${PCAT}/${PNAME}-${PVER}-${PBUILD}.\"
84 DEPEND=\"== ${PCAT}/${PNAME}-${PVER}\"
85 _PNAME=\"${PNAME}\"
86 }"
87 }
88
89 alx-split_generate_src_install_dev()
90 {
91 eval "alx-split_src_install_${PNAME}-dev()
92 {
93 cd \${SRCDIR}
94 if [[ ! -z \$(typeset -f alx_generic_src_install) ]]
95 then
96 alx_generic_src_install
97 else
98 mmake DESTDIR=\${BINDIR} install || die
99
100 local i
101 for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
102 FAQ LICENSE NEWS README TODO
103 do
104 if [ -f \${SRCDIR}/\${i} ]
105 then
106 minstalldocs \${i} || die
107 fi
108 done
109 fi
110
111 if [[ ! -z \${ALX_DEV_RM_OPTS} ]]
112 then
113 local i
114 for i in \${ALX_DEV_RM_OPTS}
115 do
116 case \${i} in
117 *\**|*\\\**)
118 if [[ -e \${BINDIR}/\$(dirname \${i}) ]]
119 then
120 find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
121 fi
122 ;;
123 *)
124 if [[ -e \${BINDIR}/\${i} ]]
125 then
126 rm -r \${BINDIR}/\${i} || die
127 fi
128 ;;
129 esac
130 done
131 fi
132
133 if [[ ! -z \${ALX_DEV_ZAPMOST_OPTS} ]]
134 then
135 zapmost \${BINDIR} \${ALX_DEV_ZAPMOST_OPTS} || die
136 fi
137 }"
138 }
139
140 alx-split_generate_src_install()
141 {
142 eval "alx-split_src_install_${PNAME}()
143 {
144 cd \${SRCDIR}
145 if [[ ! -z \$(typeset -f alx_generic_src_install) ]]
146 then
147 alx_generic_src_install
148 else
149 mmake DESTDIR=\${BINDIR} install || die
150
151 local i
152 for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
153 FAQ LICENSE NEWS README TODO
154 do
155 if [ -f \${SRCDIR}/\${i} ]
156 then
157 minstalldocs \${i} || die
158 fi
159 done
160 fi
161
162 if [[ ! -z \${ALX_RM_OPTS} ]]
163 then
164 local i
165 for i in \${ALX_RM_OPTS}
166 do
167 case \${i} in
168 *\**|*\\\**)
169 if [[ -e \${BINDIR}/\$(dirname \${i}) ]]
170 then
171 find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
172 fi
173 ;;
174 *)
175 if [[ -e \${BINDIR}/\${i} ]]
176 then
177 rm -r \${BINDIR}/\${i} || die
178 fi
179 ;;
180 esac
181 done
182 fi
183
184 if [[ ! -z \${ALX_ZAPMOST_OPTS} ]]
185 then
186 zapmost \${BINDIR} \${ALX_ZAPMOST_OPTS} || die
187 fi
188 }"
189 }
190
191 alx-split_generate_split_info
192 alx-split_generate_split_info_dev
193
194 alx-split_generate_src_install_dev
195 alx-split_generate_src_install
196
197 export_inherits alx-split src_install_${PNAME} src_install_${PNAME}-dev