rlm@17: #!/usr/bin/env perl rlm@17: rlm@19: use Cwd; rlm@17: rlm@17: sub create_install_dir{ rlm@17: @install_cmd = rlm@17: ("install", "-d", "-m", rlm@17: "775", "-o", "root", "-g", rlm@17: "install", $_[0]); rlm@17: print "@install_cmd\n"; rlm@17: system(@install_cmd) and die $!;} rlm@17: rlm@17: @install_dirs = qw( rlm@17: /usr/bin rlm@17: /usr/sbin rlm@17: /usr/include rlm@17: /usr/lib rlm@17: /usr/man/man1 rlm@17: /usr/man/man2 rlm@17: /usr/man/man3 rlm@17: /usr/man/man4 rlm@17: /usr/man/man5 rlm@17: /usr/man/man6 rlm@17: /usr/man/man7 rlm@17: /usr/man/man8 rlm@17: /usr/doc rlm@17: /usr/info rlm@17: /usr/local/man/man1 rlm@17: /usr/local/man/man2 rlm@17: /usr/local/man/man3 rlm@17: /usr/local/man/man4 rlm@17: /usr/local/man/man5 rlm@17: /usr/local/man/man6 rlm@17: /usr/local/man/man7 rlm@17: /usr/local/man/man8 rlm@17: /usr/local/doc rlm@17: /usr/local/info rlm@17: /usr/share rlm@17: /usr/share/dict rlm@17: /usr/share/doc rlm@17: /usr/share/info rlm@17: /usr/share/locale rlm@17: /usr/share/man/man1 rlm@17: /usr/share/man/man2 rlm@17: /usr/share/man/man3 rlm@17: /usr/share/man/man4 rlm@17: /usr/share/man/man5 rlm@17: /usr/share/man/man6 rlm@17: /usr/share/man/man7 rlm@17: /usr/share/man/man8 rlm@17: /usr/share/nls rlm@17: /usr/share/misc rlm@17: /usr/share/terminfo rlm@17: /usr/share/zoneinfo rlm@17: /usr/share/i18n rlm@17: /usr/share/aclocal rlm@17: /usr/local/bin rlm@17: /usr/local/etc rlm@17: /usr/local/include rlm@17: /usr/local/lib rlm@17: /usr/local/sbin rlm@17: /usr/local/share rlm@17: /usr/local/share/dict rlm@17: /usr/local/share/doc rlm@17: /usr/local/share/info rlm@17: /usr/local/share/locale rlm@17: /usr/local/share/man/man1 rlm@17: /usr/local/share/man/man2 rlm@17: /usr/local/share/man/man3 rlm@17: /usr/local/share/man/man4 rlm@17: /usr/local/share/man/man5 rlm@17: /usr/local/share/man/man6 rlm@17: /usr/local/share/man/man7 rlm@17: /usr/local/share/man/man8 rlm@17: /usr/local/share/nls rlm@17: /usr/local/share/misc rlm@17: /usr/local/share/terminfo rlm@17: /usr/local/share/zoneinfo rlm@17: /opt rlm@17: /opt/doc rlm@17: /opt/info rlm@17: /opt/bin rlm@17: /opt/include rlm@17: /opt/lib rlm@17: /opt/man/man1 rlm@17: /opt/man/man2 rlm@17: /opt/man/man3 rlm@17: /opt/man/man4 rlm@17: /opt/man/man5 rlm@17: /opt/man/man6 rlm@17: /opt/man/man7 rlm@17: /opt/man/man8 rlm@17: /var/lib rlm@17: /var/opt rlm@17: /etc rlm@17: /etc/opt rlm@17: /sbin rlm@17: /bin rlm@17: /lib); rlm@17: rlm@19: rlm@19: sub execute{ rlm@19: print "\t$_[0]\n"; rlm@19: `$_[0]`; rlm@19: if ($?){die $!;} rlm@19: } rlm@19: rlm@19: execute("groupadd --force install"); rlm@19: rlm@17: foreach $install_dir(@install_dirs){ rlm@17: create_install_dir($install_dir);} rlm@17: rlm@19: rlm@21: execute("find /.hg -type d -print0 | xargs -0 -L 1 -t chmod 2770"); rlm@19: execute("find /.hg -type f -print0 | xargs -0 -L 1 -t chmod 660"); rlm@19: rlm@26: execute("install -d -o root -g root -m 755 /pkg/skel"); rlm@19: rlm@25: execute("chown -Rv root:root /.hg"); rlm@19: rlm@19: $pwd = getcwd; rlm@26: execute("ln -sf $pwd/profile /pkg/skel/.profile"); rlm@26: execute("ln -sf $pwd/hg-wrapper /pkg/skel/"); rlm@26: execute("ln -sf $pwd/save-acls /pkg/skel/"); rlm@26: execute("ln -sf `which hg` /pkg/skel/"); rlm@22: rlm@25: execute("install -o root -g root -m 660 $pwd/hgignore /.hgignore"); rlm@25: execute("install -o root -g root -m 660 $pwd/hgrc /.hg/"); rlm@19: rlm@19: rlm@19: