Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (hide annotations) (download)
Mon Jan 4 17:49:42 2010 UTC (14 years, 5 months ago) by niro
File size: 2829 byte(s)
-respect wildcards
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     find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm
84     ;;
85     *)
86     if [[ -e \${BINDIR}/\${i} ]]
87     then
88     rm -r \${BINDIR}/\${i} || die
89     fi
90     ;;
91     esac
92 niro 44 done
93     fi
94 niro 54
95     if [[ ! -z \${MCORE_DEV_ZAPMOST_OPTS} ]]
96     then
97     zapmost \${BINDIR} \${MCORE_DEV_ZAPMOST_OPTS} || die
98     fi
99 niro 30 }"
100     }
101    
102 niro 31 mcore-split_generate_src_install()
103     {
104     eval "mcore-split_src_install_${PNAME}()
105     {
106 niro 46 cd \${SRCDIR}
107 niro 59 if [[ ! -z \$(typeset -f mcore_generic_src_install) ]]
108 niro 55 then
109     mcore_generic_src_install
110     else
111     mmake DESTDIR=\${BINDIR} install || die
112     fi
113 niro 31
114 niro 50 if [[ ! -z \${MCORE_RM_OPTS} ]]
115     then
116     local i
117     for i in \${MCORE_RM_OPTS}
118     do
119 niro 64 case \${i} in
120     *\**|*\\\**)
121     find \${BINDIR}/\$(dirname \${i}) -name \"\$(basename \${i})\" | xargs rm
122     ;;
123     *)
124     if [[ -e \${BINDIR}/\${i} ]]
125     then
126     rm -r \${BINDIR}/\${i} || die
127     fi
128     ;;
129     esac
130 niro 50 done
131     fi
132 niro 44
133 niro 46 if [[ ! -z \${MCORE_ZAPMOST_OPTS} ]]
134 niro 44 then
135 niro 46 zapmost \${BINDIR} \${MCORE_ZAPMOST_OPTS} || die
136 niro 44 fi
137 niro 31 }"
138     }
139    
140 niro 39 mcore-split_generate_split_info
141 niro 29 mcore-split_generate_split_info_dev
142 niro 39
143 niro 30 mcore-split_generate_src_install_dev
144 niro 31 mcore-split_generate_src_install
145 niro 30
146 niro 31 export_inherits mcore-split src_install_${PNAME} src_install_${PNAME}-dev