Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 120 - (hide annotations) (download)
Thu Jan 7 09:37:55 2010 UTC (14 years, 5 months ago) by niro
File size: 2965 byte(s)
only delete files if the directory exist
1 niro 29 # $Id$
2     # mcore split packages
3    
4 niro 58 sminclude mcore cleanutils
5 niro 30
6 niro 29 # global split defines
7     : ${SPLIT_PACKAGES="${PNAME} ${PNAME}-dev"}
8    
9 niro 50 # some basics defines:
10 niro 46
11 niro 50 # zap in normal packages
12     MCORE_ZAPMOST_OPTS=""
13    
14     # delete from dev packages
15     MCORE_RM_OPTS="usr/$(mlibdir)/*.a
16     usr/$(mlibdir)/*.la
17     usr/share/doc
18     usr/share/info
19     usr/share/locale
20 niro 52 usr/share/man
21 niro 50 usr/include"
22    
23     # zap in normal packages
24     MCORE_DEV_ZAPMOST_OPTS=""
25    
26     # delete from dev packages
27     MCORE_DEV_RM_OPTS="$(mlibdir)/*.so
28     $(mlibdir)/*.so
29     usr/$(mlibdir)/*.so
30     usr/$(mlibdir)/*.so.*"
31    
32 niro 45 # mcore keeps
33 niro 47 if [[ ! -z ${MCORE_ONLY_KEEP} ]]
34 niro 45 then
35 niro 49 MCORE_ZAPMOST_OPTS+=" ${MCORE_ONLY_KEEP}"
36     MCORE_DEV_RM_OPTS+=" ${MCORE_ONLY_KEEP}"
37 niro 45 fi
38    
39 niro 46 # mcore dev keeps
40 niro 47 if [[ ! -z ${MCORE_DEV_ONLY_KEEP} ]]
41 niro 45 then
42 niro 49 MCORE_DEV_ZAPMOST_OPTS+=" ${MCORE_DEV_ONLY_KEEP}"
43     MCORE_RM_OPTS+=" ${MCORE_DEV_ONLY_KEEP}"
44 niro 45 fi
45    
46 niro 37 mcore-split_generate_split_info()
47     {
48     eval "split_info_${PNAME}()
49     {
50     DESCRIPTION=\"${DESCRIPTION}\"
51     DEPEND=\"${DEPEND}\"
52     }"
53     }
54    
55 niro 29 mcore-split_generate_split_info_dev()
56     {
57     eval "split_info_${PNAME}-dev()
58     {
59 niro 36 DESCRIPTION=\"Development files for ${PCATEGORIE}/${PNAME}-${PVER}-${PBUILD}.\"
60 niro 35 DEPEND=\"== ${PCATEGORIE}/${PNAME}-${PVER}\"
61 niro 29 }"
62     }
63    
64 niro 30 mcore-split_generate_src_install_dev()
65     {
66     eval "mcore-split_src_install_${PNAME}-dev()
67     {
68 niro 46 cd \${SRCDIR}
69 niro 59 if [[ ! -z \$(typeset -f mcore_generic_src_install) ]]
70 niro 55 then
71     mcore_generic_src_install
72     else
73     mmake DESTDIR=\${BINDIR} install || die
74     fi
75 niro 44
76 niro 46 if [[ ! -z \${MCORE_DEV_RM_OPTS} ]]
77 niro 44 then
78     local i
79 niro 46 for i in \${MCORE_DEV_RM_OPTS}
80 niro 44 do
81 niro 64 case \${i} in
82     *\**|*\\\**)
83 niro 120 if [[ -e \${BINDIR}/\$(dirname \${i}) ]]
84     then
85     find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm
86     fi
87 niro 64 ;;
88     *)
89     if [[ -e \${BINDIR}/\${i} ]]
90     then
91     rm -r \${BINDIR}/\${i} || die
92     fi
93     ;;
94     esac
95 niro 44 done
96     fi
97 niro 54
98     if [[ ! -z \${MCORE_DEV_ZAPMOST_OPTS} ]]
99     then
100     zapmost \${BINDIR} \${MCORE_DEV_ZAPMOST_OPTS} || die
101     fi
102 niro 30 }"
103     }
104    
105 niro 31 mcore-split_generate_src_install()
106     {
107     eval "mcore-split_src_install_${PNAME}()
108     {
109 niro 46 cd \${SRCDIR}
110 niro 59 if [[ ! -z \$(typeset -f mcore_generic_src_install) ]]
111 niro 55 then
112     mcore_generic_src_install
113     else
114     mmake DESTDIR=\${BINDIR} install || die
115     fi
116 niro 31
117 niro 50 if [[ ! -z \${MCORE_RM_OPTS} ]]
118     then
119     local i
120     for i in \${MCORE_RM_OPTS}
121     do
122 niro 64 case \${i} in
123     *\**|*\\\**)
124 niro 120 if [[ -e \${BINDIR}/\$(dirname \${i}) ]]
125     then
126     find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm
127     fi
128 niro 64 ;;
129     *)
130     if [[ -e \${BINDIR}/\${i} ]]
131     then
132     rm -r \${BINDIR}/\${i} || die
133     fi
134     ;;
135     esac
136 niro 50 done
137     fi
138 niro 44
139 niro 46 if [[ ! -z \${MCORE_ZAPMOST_OPTS} ]]
140 niro 44 then
141 niro 46 zapmost \${BINDIR} \${MCORE_ZAPMOST_OPTS} || die
142 niro 44 fi
143 niro 31 }"
144     }
145    
146 niro 39 mcore-split_generate_split_info
147 niro 29 mcore-split_generate_split_info_dev
148 niro 39
149 niro 30 mcore-split_generate_src_install_dev
150 niro 31 mcore-split_generate_src_install
151 niro 30
152 niro 31 export_inherits mcore-split src_install_${PNAME} src_install_${PNAME}-dev