Magellan Linux

Contents of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.1.6-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations) (download)
Sun Jan 11 01:07:49 2009 UTC (15 years, 3 months ago) by niro
File size: 3380 byte(s)
-fixed old cvs headers
1 # $Id$
2
3 PNAME="busybox-initscripts"
4 PVER="0.1.6"
5 PBUILD="r1"
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
72 # fix mageversion if any release version is given
73 if [[ ! -z ${RELEASE_MAGEVERSION} ]]
74 then
75 echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
76 fi
77 }
78
79 postinstall()
80 {
81 # emulate seq; its needed to run rc-config
82 # this fixes some annyoing warning when building
83 # livecd or bootstrapping a system.
84 # this hack will be removed when the toolchain is fixed
85 if [ ! -f /usr/bin/seq ]
86 then
87 echo "Using fake 'seq' command ..."
88 seq() {
89 start=$1
90 end=$2
91 for ((i=start; i < end+1; i++))
92 do
93 echo $i
94 done
95 }
96 export -f seq
97 fi
98
99 # create service state dir mountpoint
100 # needed by >=initscripts-0.3.2-r1
101 [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
102
103 # mark this dir as undeletable
104 touch ${MROOT}/var/lib/init.d/.keep
105
106 echo "Creating Runlevels ..."
107 local i
108 for i in cleanfs \
109 loadkeys \
110 localnet \
111 modules \
112 mountfs \
113 network \
114 setclock \
115 swap
116 do
117 echo -e "\tAdded ${i} ..."
118 ${MROOT}/sbin/rc-config del ${i} > /dev/null
119 ${MROOT}/sbin/rc-config add ${i} > /dev/null
120 done
121
122 #
123 # do not ask the user about following files
124 #
125 # if they exist let config_protect process them
126 # but then remove the protected files, to keep only the original file
127 #
128 # file-root is ${MROOT}/etc
129 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"
130 local i file path
131 for i in ${CONFIG_IGNORE}
132 do
133 file="$(basename ${i})"
134 path="$(dirname ${i})/"
135 [[ ${path} == ./ ]] && path=""
136
137 rm -f ${MROOT}/etc/${path}._cfg????_${file}
138 done
139 }

Properties

Name Value
svn:keywords Id