diff options
| author | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-04-11 11:08:20 +0000 |
|---|---|---|
| committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-04-11 11:08:20 +0000 |
| commit | c917bf85ab4229246c87aef2cbd4669adb36fd92 (patch) | |
| tree | 3f702b3558039d9495b429b69911f54694ba77fc /meta/packages/util-linux/util-linux.inc | |
| parent | 5fc01adae4a49cfd0754e53962fd1e4913a6220f (diff) | |
| download | poky-c917bf85ab4229246c87aef2cbd4669adb36fd92.tar.gz | |
util-linux: added 2.12r from OE (needed by fakeroot)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1478 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/util-linux/util-linux.inc')
| -rw-r--r-- | meta/packages/util-linux/util-linux.inc | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/meta/packages/util-linux/util-linux.inc b/meta/packages/util-linux/util-linux.inc new file mode 100644 index 0000000000..a5ff009669 --- /dev/null +++ b/meta/packages/util-linux/util-linux.inc | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system." | ||
| 2 | SECTION = "base" | ||
| 3 | LICENSE = "GPL" | ||
| 4 | DEPENDS = "zlib ncurses" | ||
| 5 | |||
| 6 | inherit autotools | ||
| 7 | |||
| 8 | SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux/util-linux-${PV}.tar.bz2 \ | ||
| 9 | file://gcc34.patch;patch=1 \ | ||
| 10 | file://MCONFIG \ | ||
| 11 | file://make_include \ | ||
| 12 | file://swapargs.h \ | ||
| 13 | file://fdiskbsdlabel_thumb.diff;patch=1 \ | ||
| 14 | file://umount.diff;patch=1 \ | ||
| 15 | file://defines.h" | ||
| 16 | |||
| 17 | PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-swaponoff util-linux-losetup util-linux-umount util-linux-mount util-linux-readprofile " | ||
| 18 | |||
| 19 | FILES_${PN}-doc += "/usr/share/misc/getopt/getopt-*.*" | ||
| 20 | |||
| 21 | FILES_util-linux-fdisk = "/sbin/fdisk.${PN}" | ||
| 22 | FILES_util-linux-cfdisk = "/sbin/cfdisk" | ||
| 23 | FILES_util-linux-sfdisk = "/sbin/sfdisk" | ||
| 24 | FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}" | ||
| 25 | FILES_util-linux-losetup = "/sbin/losetup.${PN}" | ||
| 26 | FILES_util-linux-mount = "/bin/mount.${PN}" | ||
| 27 | FILES_util-linux-umount = "/bin/umount.${PN}" | ||
| 28 | FILES_util-linux-readprofile = "/usr/sbin/readprofile" | ||
| 29 | |||
| 30 | RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile " | ||
| 31 | RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup" | ||
| 32 | |||
| 33 | do_compile () { | ||
| 34 | set -e | ||
| 35 | install ${WORKDIR}/MCONFIG ${S}/MCONFIG | ||
| 36 | install ${WORKDIR}/make_include ${S}/make_include | ||
| 37 | install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h | ||
| 38 | install ${WORKDIR}/defines.h ${S}/defines.h | ||
| 39 | oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \ | ||
| 40 | 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \ | ||
| 41 | 'LDFLAGS=${LDFLAGS}' | ||
| 42 | } | ||
| 43 | |||
| 44 | checklink() { | ||
| 45 | local targ link value | ||
| 46 | targ="$1" | ||
| 47 | link="$2" | ||
| 48 | ext="$3" | ||
| 49 | if test -h "$link" | ||
| 50 | then | ||
| 51 | value="$(readlink "$link")" | ||
| 52 | if test "$value" = "$targ" | ||
| 53 | then | ||
| 54 | rm "$link" | ||
| 55 | ln -s "$targ"."${PN}" "$link$ext" | ||
| 56 | return 0 | ||
| 57 | else | ||
| 58 | echo "$link: '$value' found '$targ' expected" >&2 | ||
| 59 | return 1 | ||
| 60 | fi | ||
| 61 | else | ||
| 62 | echo "$link: not a symbolic link" >&2 | ||
| 63 | return 1 | ||
| 64 | fi | ||
| 65 | } | ||
| 66 | |||
| 67 | do_install () { | ||
| 68 | # with ccache the timestamps on compiled files may | ||
| 69 | # end up earlier than on their inputs, this allows | ||
| 70 | # for the resultant compilation in the install step. | ||
| 71 | oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \ | ||
| 72 | 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \ | ||
| 73 | 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install | ||
| 74 | |||
| 75 | test -f ${D}${base_sbindir}/pivot_root && \ | ||
| 76 | mv ${D}${base_sbindir}/pivot_root ${D}${base_sbindir}/pivot_root.${PN} | ||
| 77 | mv ${D}${base_bindir}/dmesg ${D}${base_bindir}/dmesg.${PN} | ||
| 78 | mv ${D}${base_bindir}/kill ${D}${base_bindir}/kill.${PN} | ||
| 79 | mv ${D}${base_bindir}/more ${D}${base_bindir}/more.${PN} | ||
| 80 | mv ${D}${base_sbindir}/hwclock ${D}${base_sbindir}/hwclock.${PN} | ||
| 81 | mv ${D}${base_sbindir}/mkswap ${D}${base_sbindir}/mkswap.${PN} | ||
| 82 | mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN} | ||
| 83 | mv ${D}${base_sbindir}/sln ${D}${base_sbindir}/sln.${PN} | ||
| 84 | mv ${D}${base_sbindir}/mkfs.minix ${D}${base_sbindir}/mkfs.minix.${PN} | ||
| 85 | mv ${D}${base_sbindir}/fsck.minix ${D}${base_sbindir}/fsck.minix.${PN} | ||
| 86 | mv ${D}${bindir}/hexdump ${D}${bindir}/hexdump.${PN} | ||
| 87 | mv ${D}${bindir}/last ${D}${bindir}/last.${PN} | ||
| 88 | mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN} | ||
| 89 | mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN} | ||
| 90 | mv ${D}${bindir}/renice ${D}${bindir}/renice.${PN} | ||
| 91 | mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN} | ||
| 92 | |||
| 93 | mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN} | ||
| 94 | mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN} | ||
| 95 | mv ${D}${base_bindir}/umount ${D}${base_bindir}/umount.${PN} | ||
| 96 | mv ${D}${base_bindir}/mount ${D}${base_bindir}/mount.${PN} | ||
| 97 | mv ${D}${base_sbindir}/fdisk ${D}${base_sbindir}/fdisk.${PN} | ||
| 98 | |||
| 99 | checklink swapon ${D}${base_sbindir}/swapoff ".${PN}" | ||
| 100 | checklink shutdown ${D}${base_sbindir}/reboot ".${PN}" | ||
| 101 | checklink shutdown ${D}${base_sbindir}/halt ".${PN}" | ||
| 102 | checklink shutdown ${D}${base_sbindir}/fastboot "" | ||
| 103 | checklink shutdown ${D}${base_sbindir}/fasthalt "" | ||
| 104 | } | ||
| 105 | |||
| 106 | pkg_postinst_${PN} () { | ||
| 107 | update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100 | ||
| 108 | update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100 | ||
| 109 | update-alternatives --install ${base_bindir}/more more more.${PN} 100 | ||
| 110 | update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100 | ||
| 111 | test -x ${base_sbindir}/pivot_root.${PN} && \ | ||
| 112 | update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100 | ||
| 113 | update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100 | ||
| 114 | update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100 | ||
| 115 | update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100 | ||
| 116 | update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100 | ||
| 117 | update-alternatives --install ${bindir}/last last last.${PN} 100 | ||
| 118 | update-alternatives --install ${bindir}/logger logger logger.${PN} 100 | ||
| 119 | update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100 | ||
| 120 | update-alternatives --install ${bindir}/renice renice renice.${PN} 100 | ||
| 121 | update-alternatives --install ${bindir}/wall wall wall.${PN} 100 | ||
| 122 | |||
| 123 | # There seems to be problem, atleast on nslu2, with these, untill they are | ||
| 124 | # fixed the busybox ones have higher priority | ||
| 125 | update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10 | ||
| 126 | update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10 | ||
| 127 | update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10 | ||
| 128 | update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10 | ||
| 129 | } | ||
| 130 | |||
| 131 | pkg_prerm_${PN} () { | ||
| 132 | test -x ${base_sbindir}/pivot_root.${PN} && \ | ||
| 133 | update-alternatives --remove pivot_root pivot_root.${PN} | ||
| 134 | update-alternatives --remove dmesg dmesg.${PN} | ||
| 135 | update-alternatives --remove kill kill.${PN} | ||
| 136 | update-alternatives --remove more more.${PN} | ||
| 137 | update-alternatives --remove halt halt.${PN} | ||
| 138 | update-alternatives --remove hwclock hwclock.${PN} | ||
| 139 | update-alternatives --remove mkswap mkswap.${PN} | ||
| 140 | update-alternatives --remove reboot reboot.${PN} | ||
| 141 | update-alternatives --remove shutdown shutdown.${PN} | ||
| 142 | update-alternatives --remove sln sln.${PN} | ||
| 143 | update-alternatives --remove mkfs.minix mkfs.minix.${PN} | ||
| 144 | update-alternatives --remove fsck.minix fsck.minix.${PN} | ||
| 145 | update-alternatives --remove hexdump hexdump.${PN} | ||
| 146 | update-alternatives --remove last last.${PN} | ||
| 147 | update-alternatives --remove logger logger.${PN} | ||
| 148 | update-alternatives --remove mesg mesg.${PN} | ||
| 149 | update-alternatives --remove renice renice.${PN} | ||
| 150 | update-alternatives --remove wall wall.${PN} | ||
| 151 | } | ||
| 152 | |||
| 153 | pkg_postinst_util-linux-fdisk () { | ||
| 154 | update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100 | ||
| 155 | } | ||
| 156 | |||
| 157 | pkg_prerm_util-linux-fdisk () { | ||
| 158 | update-alternatives --remove fdisk fdisk.${PN} | ||
| 159 | } | ||
| 160 | |||
| 161 | pkg_postinst_util-linux-mount () { | ||
| 162 | update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100 | ||
| 163 | } | ||
| 164 | |||
| 165 | pkg_prerm_util-linux-mount () { | ||
| 166 | update-alternatives --remove mount mount.${PN} | ||
| 167 | } | ||
| 168 | |||
| 169 | pkg_postinst_util-linux-umount () { | ||
| 170 | update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100 | ||
| 171 | } | ||
| 172 | |||
| 173 | pkg_prerm_util-linux-umount () { | ||
| 174 | update-alternatives --remove umount umount.${PN} | ||
| 175 | } | ||
| 176 | |||
| 177 | pkg_postinst_util-linux-losetup () { | ||
| 178 | update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100 | ||
| 179 | } | ||
| 180 | |||
| 181 | pkg_prerm_util-linux-losetup () { | ||
| 182 | update-alternatives --remove losetup losetup.${PN} | ||
| 183 | } | ||
| 184 | |||
| 185 | pkg_postinst_util-linux-swaponoff () { | ||
| 186 | update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100 | ||
| 187 | update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100 | ||
| 188 | } | ||
| 189 | |||
| 190 | pkg_prerm_util-linux-swaponoff () { | ||
| 191 | update-alternatives --remove swapoff swapoff.${PN} | ||
| 192 | update-alternatives --remove swapon swapon.${PN} | ||
| 193 | } | ||
