Magellan Linux

Contents of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.1.11-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1469 - (show annotations) (download)
Thu Mar 3 14:18:34 2011 UTC (13 years, 1 month ago) by niro
File size: 4089 byte(s)
-rev bump for mass rebuild
1 # $Id: busybox-initscripts-0.1.8-r1.smage2 151 2010-04-26 19:05:07Z niro $
2
3 PNAME="busybox-initscripts"
4 PVER="0.1.11"
5 PBUILD="r2"
6
7 PCATEGORIE="sys-apps"
8 STATE="unstable"
9
10 DESCRIPTION="Port of the Magellan Initscripts for busybox."
11 HOMEPAGE="http://magellan-linux.net/"
12
13 # the pkgs "coreutils, findutils, sed, gawk, bzip2, tar, rsync, wget"
14 # are needed to fix the /etc/profile issue
15 DEPEND=">= sys-apps/busybox-1.10
16 >= sys-apps/coreutils-5
17 >= sys-apps/findutils-4
18 >= net-misc/rsync-2"
19
20 SRCFILE="${PNAME}-${PVER}.tar.bz2"
21 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
22
23 sminclude cvs rsync alx
24
25 # available options are source/rsync
26 METHOD=source
27
28 # fixes mageversion;
29 # the makefile uses the date as version number
30 # but for release we want to use the release version
31 RELEASE_MAGEVERSION=
32
33 case ${METHOD} in
34 cvs) SDEPEND=">= dev-util/cvs-1.11" ;;
35 rsync) SDEPEND=">= net-misc/rsync-2.6.9" ;;
36 source) SDEPEND="" ;;
37 esac
38
39 [[ ${METHOD} = source ]] && SRC_URI=( mirror://${PNAME}/${SRCFILE} )
40
41 src_prepare()
42 {
43 [[ ${METHOD} = source ]] && { munpack ${SRCFILE} || die; }
44
45 if [[ ${METHOD} = rsync ]]
46 then
47 RSYNC_URI="rsync://magellan-linux.de/${PNAME}-${PVER}-${PBUILD}"
48 rsync_fetch_source || die
49 fi
50
51 if [[ ${METHOD} = cvs ]]
52 then
53 MY_CVS_MODULE="magellan-src/busybox-initscripts"
54 # $PVER must be eg 0_3_3
55 MY_CVS_OPTS="-r busybox-init-$(echo ${PVER}| sed -e "s|\.|\_|g")-${PBUILD}"
56 export CVSROOT=:pserver:anonymous:@magellan-linux.de:/magellan-cvs
57 cvs_fetch_source || die
58 fi
59 }
60
61 src_install()
62 {
63 cd ${SRCDIR}
64 make DESTDIR=${BINDIR} install || die
65
66 # CONFIG_PROTECT_MASK for /etc/rc.d/init.d
67 install -d ${BINDIR}/etc/env.d || die
68 echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die
69 # always overwrite /etc/mageversion
70 echo 'CONFIG_PROTECT_MASK="/etc/mageversion"' >> ${BINDIR}/etc/env.d/01initscripts || die
71 # always keep this files even if the user edited them
72 local config_protect_ignore
73 config_protect_ignore="/etc/fstab"
74 config_protect_ignore+=" /etc/group"
75 config_protect_ignore+=" /etc/hostname"
76 config_protect_ignore+=" /etc/hosts"
77 config_protect_ignore+=" /etc/inittab"
78 config_protect_ignore+=" /etc/passwd"
79 config_protect_ignore+=" /etc/conf.d/net.eth0"
80 config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4"
81 config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6"
82 config_protect_ignore+=" /etc/modules.autoload"
83 echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die
84
85 # fix mageversion if any release version is given
86 if [[ ! -z ${RELEASE_MAGEVERSION} ]]
87 then
88 echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
89 fi
90 }
91
92 postinstall()
93 {
94 # emulate seq; its needed to run rc-config
95 # this fixes some annyoing warning when building
96 # livecd or bootstrapping a system.
97 # this hack will be removed when the toolchain is fixed
98 if [ ! -f /usr/bin/seq ]
99 then
100 echo "Using fake 'seq' command ..."
101 seq() {
102 start=$1
103 end=$2
104 for ((i=start; i < end+1; i++))
105 do
106 echo $i
107 done
108 }
109 export -f seq
110 fi
111
112 # create service state dir mountpoint
113 # needed by >=initscripts-0.3.2-r1
114 [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
115
116 # mark this dir as undeletable
117 touch ${MROOT}/var/lib/init.d/.keep
118
119 echo "Creating Runlevels ..."
120 local i
121 for i in cleanfs \
122 loadkeys \
123 localnet \
124 modules \
125 mountfs \
126 network \
127 setclock \
128 swap
129 do
130 echo -e "\tAdded ${i} ..."
131 ${MROOT}/sbin/rc-config del ${i} > /dev/null
132 ${MROOT}/sbin/rc-config add ${i} > /dev/null
133 done
134
135 #
136 # do not ask the user about following files
137 #
138 # if they exist let config_protect process them
139 # but then remove the protected files, to keep only the original file
140 #
141 # file-root is ${MROOT}/etc
142 local CONFIG_IGNORE="fstab group hostname hosts inittab passwd conf.d/net.eth0 modules.autoload.d/kernel-2.4 modules.autoload.d/kernel-2.6"
143 local i file path
144 for i in ${CONFIG_IGNORE}
145 do
146 file="$(basename ${i})"
147 path="$(dirname ${i})/"
148 [[ ${path} == ./ ]] && path=""
149
150 rm -f ${MROOT}/etc/${path}._cfg????_${file}
151 done
152 }