# fss-0002

main:
  find -type f -name Makefile.in -exec sed -i -e 's| -m 644||g' '{}' ';'
  ./configure $CONF $SH_ONLY --disable-agetty --enable-cramfs --disable-kill --enable-write --enable-init --enable-login-utils --disable-rename --disable-pg-bell --disable-login-stat-mail --disable-schedutils --enable-reset --with-fsprobe=blkid --disable-tls --disable-switch_root
  sed -i -e '/setlocale(/d' */*.{c,h}
  sed -i -e 's|OMAGIC|0407|g' -e 's|NMAGIC|0410|g' -e 's|ZMAGIC|0413|g' text-utils/more.c 
  echo "#undef HAVE_VERSIONSORT" >> config.h
  sed -i -e 's|#include <a.out.h>||g' text-utils/more.c
  sed -i -e '/#define HAVE_DECL__NL_TIME_WEEK_1STDAY/d' config.h
  sed -i -e 's|chgrp tty |echo &|g' login-utils/Makefile misc-utils/Makefile
  sed -i -e 's|chmod g+s |echo &|g' login-utils/Makefile misc-utils/Makefile
  make LDFLAGS="-lintl"
  make pkgconfigdir=${TC}lib/pkgconfig/ install
  chmod ugo-x /lib/lib{uuid,blkid,mount}.la
  mv -v /lib/lib{uuid,blkid,mount}.la ${TC}lib/
  cp -v text-utils/line /bin/
  cp -v misc-utils/{write,cal,look,mcookie,reset} /bin/
  cp -v sys-utils/ctrlaltdel /sbin/
  cp -v text-utils/hexdump /bin/
  cp -v login-utils/wall /bin/
  cp -v getopt/getopt /bin/
  cp -v disk-utils/isosize /bin/
  chgrp e_public /bin/ipcmk
  chgrp e_hardware /bin/lscpu
  chgrp e_public /bin/reset
  chgrp e_mount /bin/{mount,umount}
  chgrp e_switch_root /sbin/pivot_root
  chgrp e_shutdown /sbin/ctrlaltdel
  chgrp e_public /bin/login
  chgrp e_time_admin /sbin/hwclock
  #setcap cap_sys_time=ep /sbin/hwclock
  chmod +s /sbin/hwclock
  #chgrp e_getty /sbin/agetty
  chgrp e_chat /bin/{wall,write}
  chgrp e_basic /bin/cal
  chgrp e_process /bin/renice
  chgrp e_basic /bin/{chfn,chsh,col,colcrt,colrm,column,rev}
  chgrp e_xorg /bin/mcookie
  chgrp e_text /bin/{line,more,look,getopt}
  chgrp e_system /bin/dmesg
  chgrp e_cdrom /bin/isosize
  chgrp e_file /bin/{hexdump,rev,tailf}
  chgrp e_checkfs /sbin/{fsck.cramfs,fsck.minix} /sbin/fsck
  chgrp e_partition /sbin/{blockdev,mkfs,mkfs.bfs,mkfs.cramfs,mkfs.minix,mkswap,swapon,swapoff,swaplabel,wipefs,fsfreeze} /sbin/{blkid,findfs}
  chgrp e_checkfs /bin/{fallocate,findmnt}
  chgrp e_time /sbin/rtcwake
  chgrp e_print /sbin/tunelp
  chgrp e_floppy /sbin/fdformat
  chgrp e_loopback /sbin/losetup
  chgrp e_basic /bin/script{,replay}
  chgrp e_public /lib/lib{uuid,blkid,mount}.so* /bin/uuidgen
  chmod o-rx /bin/ipcmk
  chmod o-rx /bin/lscpu
  chmod o-rx /bin/reset
  chmod o-rx /bin/{mount,umount}
  chmod o-rx /sbin/pivot_root
  chmod o-rx /sbin/ctrlaltdel
  chmod o-rx /bin/login
  chmod o-rx /sbin/hwclock
  #chmod o-rx /sbin/agetty
  chmod o-rx /bin/{wall,write}
  chmod o-rx /bin/cal
  chmod o-rx /bin/renice
  chmod o-rx /bin/{chfn,chsh,col,colcrt,colrm,column,rev}
  chmod o-rx /bin/mcookie
  chmod o-rx /bin/{line,more,look,getopt}
  chmod o-rx /bin/dmesg
  chmod o-rx /bin/isosize
  chmod o-rx /bin/{hexdump,rev,tailf}
  chmod o-rx /sbin/{fsck.cramfs,fsck.minix} /sbin/fsck
  chmod o-rx /sbin/{blockdev,mkfs,mkfs.bfs,mkfs.cramfs,mkfs.minix,mkswap,swapon,swapoff,swaplabel,wipefs,fsfreeze} /sbin/{blkid,findfs}
  chmod o-rx /bin/{fallocate,findmnt}
  chmod o-rx /sbin/rtcwake
  chmod o-rx /sbin/tunelp
  chmod o-rx /sbin/fdformat
  chmod o-rx /sbin/losetup
  chmod o-rx /bin/script{,replay}
  chmod o-rx /lib/lib{uuid,blkid,mount}.so* /bin/uuidgen
  mv -v /bin/{setarch,i386,linux32,linux64} ${TC}bin/
  if [[ -f /bin/x86_64 ]] ; then mv -v /bin/x86_64 ${TC}bin/ ; fi
  if [[ -f /bin/x86_64 ]] ; then mv -v /bin/x86_64  ${TC}bin/ ; fi
  rm -Rf /bin/{chkdupexe,cytune,ddate,flock,ipcrm,ipcs,namei,newgrp,pg,setsid,setterm,ul,whereis}
  rm -Rf /sbin/{f,cf,sf}disk
  rm -Rf /sbin/simpleinit
  rm -Rf /sbin/{vipw,readprofile,ldattach,vigr}
  #setcap cap_sys_admin=ep /bin/mount
  #setcap cap_sys_admin=ep /bin/umount
  chmod +s /bin/mount
  chmod +s /bin/umount
  rm -Rf /usr/
  rm -Rf /sbin/{shutdown,fastboot,fasthalt,reboot}
  rm -Rf /sbin/{display-services,initctl,need,provide}
  rm -Rf /bin/logger
  rm -Rf /sbin/uuidd
  rm -Rf /bin/unshare
  cp -v ${PR}shutdown /sbin/
  cp -v ${PR}reboot /sbin/
  chgrp e_shutdown /sbin/{shutdown,reboot}
  chmod o-rx /sbin/{shutdown,reboot}
  echo "mode utc" > /etc/clock
  echo "#server 0.north-america.pool.ntp.org" >> /etc/clock
  chgrp e_time /etc/clock
  tkis_handle_documentation info standard /share/info
