Contents of /trunk/include/gnome2.sminc
Parent Directory | Revision Log
Revision 22102 -
(show annotations)
(download)
Tue Sep 2 12:08:33 2014 UTC (10 years ago) by niro
File size: 3672 byte(s)
Tue Sep 2 12:08:33 2014 UTC (10 years ago) by niro
File size: 3672 byte(s)
-fixed whitespaces
1 | # $Id$ |
2 | |
3 | : ${SRCFILE="${PNAME}-${PVER}.tar.bz2"} |
4 | : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"} |
5 | |
6 | : ${HOMEPAGE="http://gnome.org/"} |
7 | |
8 | INHERITS="${INHERITS} gnome2" |
9 | |
10 | # default SRC_URIs |
11 | SRC_URI=( |
12 | gnome://${PNAME}/${PVER%.*}/${SRCFILE} |
13 | gnome://${PNAME}/${PVER%.*.*}/${SRCFILE} |
14 | mirror://${PNAME}/${SRCFILE} |
15 | ) |
16 | |
17 | # gnome default setup |
18 | export SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-0} |
19 | export SCROLL_DEBUG=${SCROLL_DEBUG:-0} |
20 | export GNOME_PREFIX="/usr" |
21 | export PATH="${PATH}:${GNOME_PREFIX}/bin" |
22 | export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${GNOME_PREFIX}/$(mlibdir)/pkgconfig" |
23 | export GNOME_LIBCONFIG_PATH="/usr/$(mlibdir):${GNOME_PREFIX}/$(mlibdir)" |
24 | |
25 | # add scrollkeeper to dependencies if requested |
26 | if [[ ${SCROLLKEEPER_UPDATE} = 1 ]] |
27 | then |
28 | DEPEND="${DEPEND} |
29 | >= app-text/scrollkeeper-0.3.14" |
30 | fi |
31 | |
32 | # function to clean gnome pakages |
33 | # scrollkeeper and mimeinfo crap |
34 | gn2_clean_gnome_pkg() |
35 | { |
36 | # litte check to show if you must run scrollkeeper in postinstall or not |
37 | if [ -z "$(find ${BINDIR} -name '*.omf')" ] |
38 | then |
39 | echo |
40 | echo "########################" |
41 | echo "scrollkeeper isn't needed to run." |
42 | echo "########################" |
43 | echo |
44 | if [ "${SCROLL_DEBUG}" = "1" ] |
45 | then |
46 | echo "Press [Enter] to continue ..." |
47 | read |
48 | else |
49 | sleep 3 |
50 | fi |
51 | else |
52 | echo |
53 | echo "########################" |
54 | echo "you need to run scrollkeeper in postinstall for ${PNAME}-${PVER}" |
55 | echo "########################" |
56 | echo |
57 | if [ "${SCROLL_DEBUG}" = "1" ] |
58 | then |
59 | echo "Press [Enter] to continue ..." |
60 | read |
61 | else |
62 | sleep 3 |
63 | fi |
64 | fi |
65 | |
66 | # remove scrollkeeper crap |
67 | if [[ -d ${BINDIR}/var/lib/scrollkeeper ]] |
68 | then |
69 | rm -rf ${BINDIR}/var/lib/scrollkeeper || die |
70 | fi |
71 | |
72 | # mime database will rebuilded later |
73 | if [[ -e ${BINDIR}/usr/share/applications/mimeinfo.cache ]] |
74 | then |
75 | rm -rf ${BINDIR}/usr/share/applications/mimeinfo.cache || die |
76 | fi |
77 | |
78 | # delete /var/tmp if exist |
79 | if [[ -d ${BINDIR}/var/tmp ]] |
80 | then |
81 | rm -rf ${BINDIR}/var/tmp || die |
82 | fi |
83 | } |
84 | |
85 | gn2_configure() |
86 | { |
87 | local configure_opts="$@" |
88 | |
89 | # we run scrollkeeper manually within postinstall |
90 | [[ ${SCROLLKEEPER_UPDATE} = 1 ]] && configure_opts="${configure_opts} --disable-scrollkeeper" |
91 | |
92 | ./configure \ |
93 | --host=${CHOST} \ |
94 | --build=${CHOST} \ |
95 | --prefix=${GNOME_PREFIX} \ |
96 | --sysconfdir=/etc \ |
97 | --infodir=${GNOME_PREFIX}/share/info \ |
98 | --mandir=${GNOME_PREFIX}/share/man \ |
99 | --localstatedir=/var/lib \ |
100 | --libdir=${GNOME_PREFIX}/$(mlibdir) \ |
101 | --libexecdir=${GNOME_PREFIX}/$(mlibdir)/${PNAME} \ |
102 | --enable-static=no \ |
103 | --disable-gtk-doc \ |
104 | ${configure_opts} \ |
105 | || die |
106 | } |
107 | |
108 | gn2_src_prepare() |
109 | { |
110 | munpack ${SRCFILE} || die |
111 | } |
112 | |
113 | gn2_src_compile() |
114 | { |
115 | cd ${SRCDIR} |
116 | gn2_configure || die |
117 | mmake ${GN2_MAKE_OPTS} || die |
118 | } |
119 | |
120 | gn2_src_install() |
121 | { |
122 | cd ${SRCDIR} |
123 | |
124 | # needed directories |
125 | # scrollkeeper needs this |
126 | install -d ${BINDIR}/var/lib/scrollkeeper || die |
127 | |
128 | # using make install instead of minstall |
129 | make DESTDIR=${BINDIR} ${GN2_MAKE_OPTS} install || die |
130 | |
131 | local i |
132 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
133 | FAQ LICENSE NEWS README TODO |
134 | do |
135 | if [ -f ${SRCDIR}/${i} ] |
136 | then |
137 | minstalldocs ${i} || die |
138 | fi |
139 | done |
140 | |
141 | gn2_clean_gnome_pkg |
142 | } |
143 | |
144 | gn2_fix_omf_makefiles() |
145 | { |
146 | # remove scrollkeeper update; we do it later |
147 | # taken from gentoo |
148 | local omf_makefiles |
149 | local omf_base |
150 | local omf |
151 | |
152 | omf_makefiles="$@" |
153 | |
154 | [ -f ${SRCDIR}/omf-install/Makefile.in ] \ |
155 | && omf_makefiles="${omf_makefiles} ${SRCDIR}/omf-install/Makefile.in" |
156 | |
157 | [ -f ${SRCDIR}/omf.make ] \ |
158 | && omf_makefiles="${omf_makefiles} ${SRCDIR}/omf.make" |
159 | |
160 | for omf in ${omf_makefiles}; do |
161 | omfbase=$(basename ${omf}) |
162 | echo "Fixing OMF Makefile: ${omf#${SRCDIR}/}" |
163 | sed -i 's:-scrollkeeper-update.*::' ${omf} |
164 | done |
165 | } |
166 | |
167 | export_inherits gn2 src_prepare src_compile src_install |