wok-next annotate busybox/receipt @ rev 21469

updated tinc (1.0.25 -> 1.0.36)
author Hans-G?nter Theisgen
date Wed May 13 07:41:00 2020 +0100 (2020-05-13)
parents b19ddba309f9
children 36705bc9f341
rev   line source
al@19875 1 # SliTaz package receipt v2.
pankso@0 2
pankso@0 3 PACKAGE="busybox"
al@19875 4 VERSION="1.27.2"
pankso@0 5 CATEGORY="base-system"
al@19875 6 SHORT_DESC="Tiny versions of UNIX utilities"
pankso@289 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@14657 8 LICENSE="GPL2"
al@19596 9 WEB_SITE="https://busybox.net/"
pankso@0 10
al@19596 11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
al@19596 12 WGET_URL="${WEB_SITE}downloads/$TARBALL"
al@19596 13
al@21020 14 BUILD_DEPENDS="patch bzip2 gettext-dev perl pam-dev libtirpc-dev" # uclibc-cross-compiler-i486 musl-libc-dev dietlibc
al@20443 15 case "$ARCH" in
al@21020 16 x86_64) SPLIT="$PACKAGE-pam:pam";;
al@21020 17 *) SPLIT="$PACKAGE-pam:pam ssfs-busybox:ssfs" # $PACKAGE-boot:boot $PACKAGE-static:static
al@20445 18 ;;
al@20443 19 esac
pascal@8237 20
al@19875 21 compile_rules() {
al@20519 22 export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libtirpc)"
al@20443 23 case "$SET" in
al@20443 24 '')
al@20443 25 cp $stuff/.config $src
pankso@12926 26 make oldconfig &&
al@20445 27 make &&
al@20445 28 make install || return 1
al@19596 29 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
pankso@12755 30 $src/_install/bin/busybox
al@19626 31
al@20443 32 # Making translations
al@20443 33 make -C $stuff/po install
al@20443 34
al@20443 35 cook_pick_manpages $src/docs/busybox.1
al@20443 36 cook_pick_docs \
al@20443 37 $src/docs/*.txt \
al@20443 38 $src/docs/*.htm* \
al@20443 39 $src/docs/cgi
al@20443 40
al@20443 41 cp -a $src/_install/* $install; rm -rf $src/_install
al@20443 42
al@20443 43 [ -e $install/sbin/ip ] && ln -s busybox $install/bin/ip
al@20443 44 rm -f $install/bin/bbconfig $install/usr/bin/ar
al@20443 45 mkdir -p \
al@20443 46 $install/etc/init.d \
al@20443 47 $install/var/spool/cron/crontabs \
al@20443 48 $install/var/spool/lpd \
al@20443 49 $install/var/lib/misc \
al@20443 50 $install/etc/modprobe.d \
al@20443 51 $install/usr/share/udhcpc
al@20443 52
al@20443 53 # Busybox config files
al@20443 54 cp -a $stuff/etc/* $install/etc
al@20443 55 chown -R 0.0 $install/etc
al@20443 56 chmod 600 $install/etc/busybox.conf
al@20443 57
al@20443 58 # Daemon scripts
al@20443 59 cp $stuff/daemon $install/etc/init.d
al@20443 60 for i in crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd \
al@20443 61 telnetd tftpd udhcpd zcip; do
al@20443 62 grep -qi "config_$i=y" $stuff/.config &&
al@20443 63 ln -s daemon $install/etc/init.d/$i
al@20443 64 done
al@20443 65 rm $install/linuxrc
al@20443 66
al@20443 67 # Udhcpc stuff
al@20443 68 install -m755 $stuff/udhcp.script $install/usr/share/udhcpc/default.script
al@20443 69
al@20443 70 # Httpd stuff (httphelper.sh found in slitaz-base-files package)
al@20443 71 ln -s /usr/lib/slitaz/httphelper.sh $install/usr/bin/httpd_helper.sh
al@20443 72 cp -r $stuff/www $install/var
al@20443 73
al@20443 74 # Update copyright year
al@20443 75 grep -rl 'YEAR' $install/var/www | xargs sed -i "s|YEAR|$(date +%Y)|"
al@20443 76 ;;
al@20443 77
al@20443 78 pam)
al@20443 79 sed 's|# CONFIG_PAM is not set|CONFIG_PAM=y|' $stuff/.config > $src/.config
al@19875 80 make oldconfig &&
al@20445 81 make || return 1
al@19626 82 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
al@19626 83
al@20443 84 # mv docs/busybox.1 docs/busybox.pam.1
al@20443 85 mkdir -p \
al@20443 86 $install/bin/ \
al@20443 87 $install/etc/pam.d/
al@20443 88 cp -a $src/busybox $install/bin
al@20443 89 cp $stuff/login $install/etc/pam.d/
al@20443 90 ;;
al@20443 91
al@20443 92 ssfs)
al@20443 93 # WARNING! This branch not tested yet!
al@20443 94 #
al@20443 95 rootfs="$src/ssfs-busybox/usr/share/ssfs/rootfs"
al@20443 96 mkdir -p $rootfs/etc
al@20443 97 cp $stuff/.config-ssfs $src/.config
al@20443 98 make oldconfig &&
al@20443 99 make busybox &&
al@20443 100 make CONFIG_PREFIX=$rootfs install || return 1
al@20443 101 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
al@20443 102 chown -R 0.0 $rootfs/etc
al@20443 103 chmod 0600 $rootfs/etc/busybox.conf
al@20443 104 chmod 4755 $rootfs/bin/busybox
al@20443 105 ;;
al@20443 106
al@20443 107 static)
al@20443 108 # WARNING! This branch not tested yet!
al@20443 109 #
al@19626 110 # prepare busybox-static package
pascal@19631 111 if [ -n "$(/usr/bin/uclibc-i486-gcc --version 2>/dev/null)" ]; then
al@19875 112 echo 'Making busybox-uclibc'
al@19875 113 cp $stuff/.config-static $src/.config
al@19875 114 sed -i 's|# CONFIG_ASH_INTERNAL_GLOB is not set|CONFIG_ASH_INTERNAL_GLOB=y|' $src/.config
al@19875 115 make oldconfig &&
al@19875 116 make || return 1
al@19626 117 cp busybox busybox-static
al@19626 118 mv busybox busybox-uclibc
al@19626 119 mv -f docs/busybox.1 docs/busybox.static.1
al@19626 120 fi
al@19626 121
al@19875 122 if [ -x '/usr/bin/musl-gcc' ]; then
al@19875 123 echo 'Making busybox-musl'
al@19626 124 # prepare busybox-musl package
al@19875 125 cp $stuff/.config-static $src/.config
al@19875 126 sed -i 's|uclibc-i486-||' $src/.config
al@19875 127 make oldconfig &&
al@19875 128 make CC=musl-gcc || return 1
al@19626 129 mv busybox busybox-musl
al@19626 130 mv -f docs/busybox.1 docs/busybox.static.1
al@19626 131 fi
al@19626 132
al@19875 133 if [ -x '/usr/lib/diet/bin/diet' ]; then
al@19875 134 echo 'Making busybox-diet'
al@19626 135 # prepare busybox-diet package
al@19875 136 cp $stuff/.config-static $src/.config
al@19875 137 sed -i 's|uclibc-i486-||;
al@19875 138 s|CFLAGS="|&-D_BSD_SOURCE |;
al@19875 139 s|LDFLAGS="|&-Wl,--allow-multiple-definition |;
al@20445 140 s|LDLIBS="|&compat tirpc |' $src/.config
al@19875 141 make oldconfig &&
al@19875 142 make CC="/usr/lib/diet/bin/diet gcc" || return 1
al@19626 143 mv busybox busybox-diet
al@19626 144 mv -f docs/busybox.1 docs/busybox.static.1
al@19626 145 fi
al@19159 146 ;;
pankso@12755 147 esac
pankso@12755 148 }
pankso@12755 149
pankso@12755 150 # Cross compilation check.
al@19875 151 testsuite() {
al@20445 152 readelf -h $WOK/busybox/install/bin/busybox
pankso@0 153 }
pankso@0 154
al@19875 155 genpkg_rules() {
al@19875 156 case $PACKAGE in
al@19875 157 busybox)
al@20443 158 copy @std *.mo
al@20445 159 DEPENDS="slitaz-base-files glibc-base ncurses libtirpc"
al@19875 160 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
al@19875 161 /etc/resolv.conf /etc/httpd.conf"
al@20443 162 ;;
al@20443 163 busybox-pam)
al@20443 164 copy @std
al@20443 165 CAT="base-system|with PAM support"
al@20445 166 DEPENDS="busybox libtirpc pam"
al@20443 167 CONFIG_FILES="/etc/pam.d"
al@20443 168 PROVIDE="busybox:pam"
al@20443 169 ;;
al@20443 170 ssfs-busybox)
al@20443 171 # NOTE: We install files in Ssfs data directory to always have ready
al@20443 172 # to create chroot on the server and provide an easy way to update
al@20443 173 # the vdisk. We don't do a static build, we need some shared lib in
al@20443 174 # the chroot anyway. Busybox is configured to not use /usr and with
al@20443 175 # a minimal set of applets.
pankso@12755 176
al@20443 177 CAT="base-system|for Ssfs virtual disk minimal chroot"
al@20443 178 rootfs=$fs/usr/share/ssfs/rootfs
al@20443 179 cp -a $src/ssfs-busybox/* $fs
al@19875 180 ;;
al@19875 181 busybox-boot)
al@19875 182 jslinux=false
al@19875 183 CAT="base-system|for core-5in1/boot flavor"
al@19875 184 DEPENDS="linux syslinux"
al@19875 185 mkdir -p \
al@19875 186 $fs/usr/share/boot/bin \
al@19875 187 $fs/usr/share/boot/dev
al@19875 188
al@19875 189 CHOICE='static'
al@19875 190 for i in uclibc musl diet; do
al@19875 191 [ -x "$src/busybox-$i" ] || continue
al@19875 192 [ -x "$src/busybox-$CHOICE" ] &&
al@19875 193 [ $(stat -c %s $src/busybox-$i) -ge \
al@19875 194 $(stat -c %s $src/busybox-$CHOICE) ] &&
al@19875 195 continue
al@19875 196 CHOICE="$i"
al@19875 197 done
al@19875 198 cp -a $src/busybox-$CHOICE $fs/usr/share/boot/bin/busybox
al@19875 199
al@19875 200 chmod 4755 $fs/usr/share/boot/bin/busybox
al@19875 201 mknod -m 660 $fs/usr/share/boot/dev/console c 5 1
al@19875 202 mknod -m 771 $fs/usr/share/boot/dev/null c 1 3
al@19875 203 mknod -m 660 $fs/usr/share/boot/dev/tty c 5 0
al@19875 204 mknod -m 660 $fs/usr/share/boot/dev/tty1 c 4 1
al@19875 205 if $jslinux; then
al@19875 206 mknod -m 644 $fs/usr/share/boot/dev/clipboard c 10 231
al@19875 207 mknod -m 660 $fs/usr/share/boot/dev/ttyS0 c 4 64
al@19875 208 fi
al@19875 209
al@19875 210 cp $stuff/init $fs/usr/share/boot/init
al@19875 211 $jslinux || sed -i '/jslinux/d' $fs/usr/share/boot/init
al@19875 212 chmod +x $fs/usr/share/boot/init
al@19875 213
al@19875 214 ( cd $fs/usr/share/boot; find bin dev init | cpio -o -H newc > initrd )
al@19875 215 rm -rf \
al@19875 216 $fs/usr/share/boot/bin \
al@19875 217 $fs/usr/share/boot/dev \
al@19875 218 $fs/usr/share/boot/init
al@19875 219 ;;
al@19875 220 busybox-static)
al@19875 221 CAT="base-system|static version"
al@19875 222 DEPENDS=" "
al@19875 223 mkdir -p $fs/usr/share/boot
al@19875 224
al@19875 225 CHOICE='static'
al@19875 226 for i in uclibc musl diet; do
al@19875 227 [ -x "$src/busybox-$i" ] || continue
al@19875 228 [ -x "$src/busybox-$CHOICE" ] &&
al@19875 229 [ $(stat -c %s $src/busybox-$i) -ge \
al@19875 230 $(stat -c %s $src/busybox-$CHOICE) ] &&
al@19875 231 continue
al@19875 232 CHOICE="$i"
al@19875 233 done
al@19875 234 cp -a $src/busybox-$CHOICE $fs/usr/share/boot/busybox-static
al@19875 235 ;;
al@19875 236 esac
pankso@0 237 }
pankso@557 238
pankso@12755 239 # GNU utils stuff.
al@19875 240 pre_install_busybox() {
pascal@5015 241 local i
pascal@18846 242 [ -s $1/etc/resolv.conf ] &&
pascal@18816 243 cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install
al@19875 244 answer=''
al@19596 245 for i in $(sed '/busybox$/d; /bin\//!d' "$1$INSTALLED/$PACKAGE/files.list"); do
pascal@18730 246 [ -f "$1$i" ] || continue
pascal@5015 247 if [ -z "$answer" ]; then
al@19596 248 echo
al@19596 249 confirm 'Keep installed GNU utilities?' y || break
al@19596 250 answer='Y'
pascal@5015 251 fi
pascal@18730 252 cp -a "$1$i" "$1$i-busybox-install"
pascal@5924 253 done
pankso@557 254 }
pascal@983 255
al@19875 256 post_install_busybox() {
pascal@5015 257 local i
pascal@18816 258 [ -f $1/etc/resolv.conf-busybox-install ] &&
pascal@18816 259 mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf
al@19596 260 for i in $($1/bin/busybox --list-full); do
al@19596 261 [ -f "$1/$i-busybox-install" ] || continue
al@19596 262 mv "$1/$i-busybox-install" "$1/$i"
al@19596 263 done
pascal@18730 264 chmod 4755 "$1/bin/busybox"
pankso@10818 265
al@19596 266 touch "$1/etc/daemons.conf"
pankso@10818 267 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
al@19596 268 if ! grep -q ^DNSD_OPTIONS "$1/etc/daemons.conf"; then
al@19596 269 cat >> "$1/etc/daemons.conf" <<EOF
al@19596 270 # Domain name server options.
al@19596 271 DNSD_OPTIONS="-d"
al@19596 272
al@19596 273 EOF
pankso@10818 274 fi
pascal@18816 275 if ! grep -q ^TFTPD_OPTIONS $1/etc/daemons.conf; then
al@19596 276 cat >> "$1/etc/daemons.conf" <<EOF
al@19596 277 # Tftp daemon options.
al@19596 278 TFTPD_OPTIONS="-r /boot"
al@19596 279
al@19596 280 EOF
pankso@10818 281 fi
pascal@5686 282 }
pascal@8932 283
al@19875 284 # We can't remove this package!
al@19875 285 pre_remove_busybox() {
al@21020 286 return 1
pascal@8932 287 }
al@19875 288
al@19875 289 pre_remove_busybox_pam() {
al@19875 290 # We install non-pam busybox to replace busybox-pam.
al@19875 291 tazpkg get-install busybox --forced
al@19875 292
al@19875 293 # We remove /bin/busybox from the file.list of busybox-pam.
al@19875 294 # This way, the non-pam busybox we just installed will not be
al@19875 295 # removed.
al@19875 296 sed '/\/bin\/busybox/d' \
al@19875 297 -i /var/lib/tazpkg/installed/busybox-pam/files.list
al@19875 298 }
al@19875 299
al@19875 300 post_install_busybox_pam() {
al@19875 301 chmod 4755 "$1/bin/busybox"
al@19875 302 }
al@19875 303
al@19875 304 post_install_busybox_static() {
al@19875 305 chmod 4755 "$1/usr/share/boot/busybox-static"
al@19875 306 }