Magellan Linux

Annotation of /trunk/core/initscripts/initscripts-0.5.3-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:keywords Id