/[gentoo-alt]/trunk/sys-apps/freebsd-baselayout/freebsd-baselayout-0.2-r1.ebuild
Gentoo

Contents of /trunk/sys-apps/freebsd-baselayout/freebsd-baselayout-0.2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 262 - (show annotations) (download)
Mon Mar 14 19:58:14 2005 UTC (9 years, 4 months ago) by spb
File size: 3675 byte(s)
added 0.2-r1

1 # $Header$
2
3 inherit flag-o-matic eutils
4
5 SV=0.7
6 SVREV=-r1
7
8 S="${WORKDIR}/freebsd-rcscripts-${SV}${SVREV}"
9 DESCRIPTION="Filesystem baselayout and init scripts"
10 HOMEPAGE="http://gentoo-alt.gentoo.org"
11 SRC_URI="http://dev.gentoo.org/~spb/fbsd/freebsd-rcscripts-${SV}${SVREV}.tar.bz2"
12
13 KEYWORDS="x86-fbsd"
14
15 RDEPEND="sys-apps/freebsd-sbin
16 >=sys-apps/gawk-3.1.1-r2"
17 DEPEND="virtual/os-headers
18 sys-devel/make"
19
20 IUSE="build"
21
22 PROVIDE="virtual/baselayout"
23
24 src_compile() {
25 use static && append-ldflags -static
26
27 make -C ${S}/src OS=BSD CC="${CC:-gcc}" LD="${CC:-gcc} ${LDFLAGS}" \
28 CFLAGS="${CFLAGS}" || die
29 make -C ${S}/src/filefuncs CC="${CC:-gcc}" LD="${CC:-gcc} ${LDFLAGS}" \
30 CFLAGS="${CFLAGS}" || die
31 }
32
33 src_install() {
34 # Create some directories...
35 dodir /dev
36 keepdir /usr/share /usr/local
37 keepdir /var/tmp /var/empty /var/at /var/backups /var/games
38 keepdir /var/log /var/mail /var/msgs /var/preserve /var/run
39 keepdir /etc /etc/portage
40 keepdir /bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib /usr/libexec
41
42 dodir /usr/share/baselayout
43
44 cp -R ${S}/etc ${D}/etc
45
46 mv ${D}/etc/etc.i386/* ${D}/etc
47 rmdir ${D}/etc/etc.i386
48
49
50 mv ${D}/etc/{passwd,master.passwd,group,fstab} ${D}/usr/share/baselayout
51
52 dodir /etc/runlevels
53 keepdir /etc/init.d
54 exeinto /etc/init.d
55 doexe ${S}/init.d/*
56
57 dodir /etc/conf.d
58 insinto /etc/conf.d
59 [ -d ${S}/etc/conf.d ] && doins ${S}/etc/conf.d/*
60
61 dodir /var/db/pkg
62
63 dodir /lib/rcscripts
64 cp -r ${S}/lib/rcscripts/* ${D}/lib/rcscripts/
65 cp -r ${S}/src/awk ${D}/lib/rcscripts/awk
66 cp ${S}/src/filefuncs/*.so ${D}/lib/rcscripts/
67
68 cp -r ${S}/rc-lists ${D}/usr/share/baselayout
69
70 echo "Gentoo/FreeBSD: FreeBSD version $(uname -r); Gentoo base version ${SV}" >${D}/etc/gentoo-release
71
72 sed -i -e "s@<FBSD-VER>@$(uname -r)@" -e "s/<RC-VER>/${SV}/" ${D}/etc/motd
73
74 into /
75
76 dobin ${S}/bin/rc-status
77
78 dosbin ${S}/sbin/functions.sh
79 dosbin ${S}/sbin/runscript.sh
80 dosbin ${S}/sbin/depscan.sh
81 dosbin ${S}/sbin/rc-update
82 dosym ../../sbin/functions.sh /etc/init.d/functions.sh
83 dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
84 dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
85
86 cd ${S}/src
87 make OS=BSD DESTDIR="${D}" install || die
88 }
89
90 pkg_postinst() {
91 # Set up the default runlevels.
92 if [ -z "$(/bin/ls ${ROOT}/etc/runlevels 2>/dev/null)" ]; then
93 cd ${ROOT}/usr/share/baselayout/rc-lists
94 einfo foo
95 ls
96 for x in *; do
97 einfo "Creating default runlevel symlinks for ${x}"
98 mkdir -p ${ROOT}/etc/runlevels/${x}
99 for y in $(<${ROOT}/usr/share/baselayout/rc-lists/${x}); do
100 if [ ! -e ${ROOT}/etc/init.d/${y} ]; then
101 ewarn "init.d/${y} not found; skipping"
102 else
103 ln -sfn ${ROOT}/etc/init.d/${y} \
104 ${ROOT}/etc/runlevels/${x}/${y}
105 fi
106 done
107 done
108 else
109 einfo "Not creating runlevel symlinks."
110 fi
111
112 if [ ! -e ${ROOT}/etc/hosts ]; then
113 cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc
114 fi
115
116 if use build || [ ! -e "${ROOT}/etc/passwd" ]; then
117 cp ${ROOT}/usr/share/baselayout/{passwd,master.passwd,group,fstab} ${ROOT}/etc
118 fi
119
120 if [ ${ROOT} == / ] && ! use build; then
121 /sbin/depscan.sh &>/dev/null
122 fi
123
124 # This file shouldn't be managed with etc-update; we want it
125 # written immediately.
126 if [ -e ${ROOT}/etc/._cfg????_gentoo-release ]; then
127 rm -f ${ROOT}/etc/gentoo-release
128 mv ${ROOT}/etc/._cfg????_gentoo-release ${ROOT}/etc/gentoo-release
129 fi
130
131 # Create the password database if it doesn't exist.
132 if [[ ! -e "${ROOT}/etc/pwd.db" || ! -e "${ROOT}/etc/spwd.db" ]]; then
133 pwd_mkdb -d "${ROOT}/etc" "${ROOT}/etc/master.passwd"
134 fi
135
136 einfo "Make sure to update all pending config files in /etc"
137 einfo "or things will break. Use etc-update or dispatch-conf to do this."
138 echo
139 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20