/[gentoo-alt]/trunk/overlay/sys-freebsd/freebsd-baselayout/freebsd-baselayout-0.2-r9.ebuild
Gentoo

Contents of /trunk/overlay/sys-freebsd/freebsd-baselayout/freebsd-baselayout-0.2-r9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1020 - (show annotations) (download)
Mon Feb 13 13:47:36 2006 UTC (8 years, 6 months ago) by flameeyes
File size: 4419 byte(s)
Add baselayout that drops the old settings files.
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 inherit flag-o-matic eutils
6
7 SV=0.7
8 SVREV=-r3
9
10 DESCRIPTION="Filesystem baselayout and init scripts"
11 HOMEPAGE="http://gentoo-alt.gentoo.org"
12 SLOT="0"
13 KEYWORDS="~x86-fbsd ~amd64-fbsd"
14
15 IUSE="build static"
16
17 SRC_URI="mirror://gentoo/freebsd-rcscripts-${SV}${SVREV}.tar.bz2
18 http://dev.gentoo.org/~spb/fbsd/freebsd-rcscripts-${SV}${SVREV}.tar.bz2"
19
20 RDEPEND="sys-freebsd/freebsd-sbin
21 >=sys-apps/gawk-3.1.4-r4"
22 DEPEND="virtual/os-headers
23 sys-devel/make"
24
25 PROVIDE="virtual/baselayout"
26
27 S="${WORKDIR}/freebsd-rcscripts-${SV}${SVREV}"
28
29 src_unpack() {
30 unpack ${A}
31 cd ${S}/init.d
32 epatch ${FILESDIR}/checkfs-typo.patch
33 }
34
35 src_compile() {
36 use static && append-ldflags -static
37
38 make -C ${S}/src OS=BSD CC="${CC:-gcc}" LD="${CC:-gcc} ${LDFLAGS}" \
39 CFLAGS="${CFLAGS}" || die
40 }
41
42 src_install() {
43 # Create some directories...
44 keepdir /usr/share /usr/local
45 keepdir /var/tmp /var/empty /var/at /var/backups /var/games
46 keepdir /var/mail /var/msgs /var/preserve /var/run
47 keepdir /etc /etc/portage
48 keepdir /bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib /usr/libexec
49 [[ -d ${ROOT}/dev ]] || keepdir /dev
50 [[ -d ${ROOT}/proc ]] || keepdir /proc
51
52 dodir /usr/share/baselayout
53
54 cp -R ${S}/etc/* ${D}/etc
55
56 mv ${D}/etc/etc.i386/* ${D}/etc
57 rmdir ${D}/etc/etc.i386
58
59 mv ${D}/etc/{passwd,master.passwd,group,fstab} ${D}/usr/share/baselayout
60
61 dodir /etc/runlevels
62 keepdir /etc/init.d
63 exeinto /etc/init.d
64 doinitd ${S}/init.d/*
65
66 [[ -d ${S}/etc/conf.d ]] && doconfd ${S}/etc/conf.d/*
67
68 dodir /var/db/pkg
69
70 dodir /lib/rcscripts
71 cp -r ${S}/lib/rcscripts/* ${D}/lib/rcscripts/
72 cp -r ${S}/src/awk ${D}/lib/rcscripts/awk
73
74 cp -r ${S}/rc-lists ${D}/usr/share/baselayout
75
76 echo "Gentoo/FreeBSD: FreeBSD version $(uname -r); Gentoo base version ${SV}" >${D}/etc/gentoo-release
77
78 sed -i -e "s@<FBSD-VER>@$(uname -r)@" -e "s/<RC-VER>/${SV}/" ${D}/etc/motd
79
80 into /
81
82 dobin ${S}/bin/rc-status
83
84 dosbin ${S}/sbin/functions.sh
85 dosbin ${S}/sbin/runscript.sh
86 dosbin ${S}/sbin/depscan.sh
87 dosbin ${S}/sbin/rc-update
88 dosym ../../sbin/functions.sh /etc/init.d/functions.sh
89 dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
90 dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
91
92 # Replace wrong profile from -r3
93 rm -f ${D}/etc/profile
94 insinto /etc
95 doins ${FILESDIR}/profile
96
97 # Remove all the files we provide elsewhere
98 cd ${D}/etc
99 rm -rf ftpusers pccard.conf pccard_ether devd.conf pf.conf pf.os amd.conf \
100 apmd.conf syslog.conf newsyslog.conf remote phones ppp isdn nsmb.conf \
101 mtree
102
103 if [[ ! -e ${ROOT}/var/run/utmp ]]; then
104 touch ${D}/var/run/utmp
105 chown root:utmp ${D}/var/run/utmp
106 chmod 664 ${D}/var/run/utmp
107 fi
108
109 cd ${S}/src
110 make OS=BSD DESTDIR="${D}" install || die
111 }
112
113 pkg_postinst() {
114 # Set up the default runlevels.
115 if [[ -z "$(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null)" ]]; then
116 cd ${ROOT}/usr/share/baselayout/rc-lists
117 einfo foo
118 ls
119 for x in *; do
120 einfo "Creating default runlevel symlinks for ${x}"
121 mkdir -p ${ROOT}/etc/runlevels/${x}
122 for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
123 if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then
124 ewarn "init.d/${y} not found; skipping"
125 else
126 ln -sfn ${ROOT}/etc/init.d/${y} \
127 ${ROOT}/etc/runlevels/${x}/${y}
128 fi
129 done
130 done
131 else
132 einfo "Not creating runlevel symlinks."
133 fi
134
135 if [[ ! -e ${ROOT}/etc/hosts ]]; then
136 cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
137 fi
138
139 if use build || [[ ! -e "${ROOT}/etc/passwd" ]]; then
140 cp ${ROOT}/usr/share/baselayout/{passwd,master.passwd,group,fstab} ${ROOT}/etc
141 fi
142
143 if [[ ${ROOT} == / ]] && ! use build; then
144 /sbin/depscan.sh &>/dev/null
145 fi
146
147 # This file shouldn't be managed with etc-update; we want it
148 # written immediately.
149 if [[ -e ${ROOT}/etc/._cfg????_gentoo-release ]]; then
150 rm -f ${ROOT}/etc/gentoo-release
151 mv ${ROOT}/etc/._cfg????_gentoo-release ${ROOT}/etc/gentoo-release
152 fi
153
154 # Create the password database if it doesn't exist.
155 if [[ ! -e "${ROOT}/etc/pwd.db" || ! -e "${ROOT}/etc/spwd.db" ]]; then
156 pwd_mkdb -d "${ROOT}/etc" "${ROOT}/etc/master.passwd"
157 fi
158
159 # Making sure that /tmp and /var/tmp have right permission or too many
160 # things will break
161 chmod 1777 /tmp /var/tmp
162
163 einfo "Make sure to update all pending config files in /etc"
164 einfo "or things will break. Use etc-update or dispatch-conf to do this."
165 echo
166 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20