Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6001 - (hide annotations) (download)
Thu Mar 19 10:08:35 2015 UTC (9 years, 7 months ago) by niro
File size: 4975 byte(s)
-be more verbose and fixed broken symlink handling of busybox if the reference does not exists
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 niro 3607 # delete from normal packages
15 niro 1667 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 niro 4693 usr/include"
24 niro 1667
25 niro 4693 # zap in dev packages
26 niro 1667 ALX_DEV_ZAPMOST_OPTS=""
27    
28     # delete from dev packages
29 niro 4693 ALX_DEV_RM_OPTS=""
30 niro 1667
31 niro 3775 # be backward compatible
32 niro 3779 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 niro 3775
47 niro 1667 # alx keeps
48 niro 3775 if [[ ! -z ${ALX_PKG_KEEP} ]]
49 niro 1667 then
50 niro 3775 ALX_ZAPMOST_OPTS+=" ${ALX_PKG_KEEP}"
51     ALX_DEV_RM_OPTS+=" ${ALX_PKG_KEEP}"
52 niro 4693 else
53 niro 4818 ALX_RM_OPTS+=" $(mlibdir)/*.so
54 niro 4693 usr/$(mlibdir)/*.so
55     $([[ $(mlibdir) != lib ]] && echo 'lib/*.so usr/lib/*.so')"
56 niro 1667 fi
57    
58     # alx dev keeps
59 niro 3775 if [[ ! -z ${ALX_DEV_PKG_KEEP} ]]
60 niro 1667 then
61 niro 3775 ALX_DEV_ZAPMOST_OPTS+=" ${ALX_DEV_PKG_KEEP}"
62     ALX_RM_OPTS+=" ${ALX_DEV_PKG_KEEP}"
63 niro 4693 else
64 niro 4818 ALX_DEV_RM_OPTS+=" $(mlibdir)/*.so.*
65 niro 4693 usr/$(mlibdir)/*.so.*
66     $([[ $(mlibdir) != lib ]] && echo 'lib/*.so.* usr/lib/*.so.*')"
67 niro 1667 fi
68    
69     alx-split_generate_split_info()
70     {
71     eval "split_info_${PNAME}()
72     {
73     DESCRIPTION=\"${DESCRIPTION}\"
74     DEPEND=\"${DEPEND}\"
75 niro 2075 _PNAME=\"${PNAME}\"
76 niro 1667 }"
77     }
78    
79     alx-split_generate_split_info_dev()
80     {
81     eval "split_info_${PNAME}-dev()
82     {
83 niro 3835 DESCRIPTION=\"Development files for ${PCAT}/${PNAME}-${PVER}-${PBUILD}.\"
84     DEPEND=\"== ${PCAT}/${PNAME}-${PVER}\"
85 niro 2075 _PNAME=\"${PNAME}\"
86 niro 1667 }"
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 niro 6001 echo find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
121 niro 3571 find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
122 niro 1667 fi
123     ;;
124     *)
125     if [[ -e \${BINDIR}/\${i} ]]
126     then
127 niro 6001 echo rm -r \${BINDIR}/\${i}
128 niro 1667 rm -r \${BINDIR}/\${i} || die
129 niro 6001 # busybox does not detect symlinks with -e if the reference does not exists
130     elif [[ -L \${BINDIR}/\${i} ]]
131     then
132     echo rm -r \${BINDIR}/\${i}
133     rm -r \${BINDIR}/\${i} || die
134 niro 1667 fi
135     ;;
136     esac
137     done
138     fi
139    
140     if [[ ! -z \${ALX_DEV_ZAPMOST_OPTS} ]]
141     then
142     zapmost \${BINDIR} \${ALX_DEV_ZAPMOST_OPTS} || die
143     fi
144     }"
145     }
146    
147     alx-split_generate_src_install()
148     {
149     eval "alx-split_src_install_${PNAME}()
150     {
151     cd \${SRCDIR}
152     if [[ ! -z \$(typeset -f alx_generic_src_install) ]]
153     then
154     alx_generic_src_install
155     else
156     mmake DESTDIR=\${BINDIR} install || die
157    
158     local i
159     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
160     FAQ LICENSE NEWS README TODO
161     do
162     if [ -f \${SRCDIR}/\${i} ]
163     then
164     minstalldocs \${i} || die
165     fi
166     done
167     fi
168    
169     if [[ ! -z \${ALX_RM_OPTS} ]]
170     then
171     local i
172     for i in \${ALX_RM_OPTS}
173     do
174     case \${i} in
175     *\**|*\\\**)
176     if [[ -e \${BINDIR}/\$(dirname \${i}) ]]
177     then
178 niro 6001 echo find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
179 niro 3571 find \${BINDIR}/\$(dirname \${i}) -maxdepth 1 -name \"\$(basename \${i})\" | xargs --no-run-if-empty rm
180 niro 1667 fi
181     ;;
182     *)
183     if [[ -e \${BINDIR}/\${i} ]]
184     then
185 niro 6001 echo rm -r \${BINDIR}/\${i}
186 niro 1667 rm -r \${BINDIR}/\${i} || die
187 niro 6001 # busybox does not detect symlinks with -e if the reference does not exists
188     elif [[ -L \${BINDIR}/\${i} ]]
189     then
190     echo rm -r \${BINDIR}/\${i}
191     rm -r \${BINDIR}/\${i} || die
192 niro 1667 fi
193     ;;
194     esac
195     done
196     fi
197    
198     if [[ ! -z \${ALX_ZAPMOST_OPTS} ]]
199     then
200     zapmost \${BINDIR} \${ALX_ZAPMOST_OPTS} || die
201     fi
202     }"
203     }
204    
205     alx-split_generate_split_info
206     alx-split_generate_split_info_dev
207    
208     alx-split_generate_src_install_dev
209     alx-split_generate_src_install
210    
211 niro 3646 export_inherits alx-split src_install_${PNAME} src_install_${PNAME}-dev