diff --git a/bin/csh/Makefile b/bin/csh/Makefile index 128ba5b19ab0..2e54483721ab 100644 --- a/bin/csh/Makefile +++ b/bin/csh/Makefile @@ -8,6 +8,11 @@ .include +CONFGROUPS= ETC ROOT +ETC= csh.cshrc csh.login csh.logout +ROOT= dot.cshrc +ROOTDIR= /root +ROOTNAME= .cshrc PACKAGE=runtime TCSHDIR= ${SRCTOP}/contrib/tcsh .PATH: ${TCSHDIR} @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1 LIBADD= termcapw crypt -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \ + /root/.cshrc /.cshrc CLEANFILES= ${GENHDRS} gethost csh.1 @@ -148,4 +154,11 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h ${BUILD sort >> ${.TARGET} @echo '#endif /* _h_tc_const */' >> ${.TARGET} +beforeinstall: + rm -f ${DESTDIR}/.cshrc + +afterinstallconfig: + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd + .include diff --git a/etc/csh.cshrc b/bin/csh/csh.cshrc similarity index 100% rename from etc/csh.cshrc rename to bin/csh/csh.cshrc diff --git a/etc/csh.login b/bin/csh/csh.login similarity index 100% rename from etc/csh.login rename to bin/csh/csh.login diff --git a/etc/csh.logout b/bin/csh/csh.logout similarity index 100% rename from etc/csh.logout rename to bin/csh/csh.logout diff --git a/etc/root/dot.cshrc b/bin/csh/dot.cshrc similarity index 100% rename from etc/root/dot.cshrc rename to bin/csh/dot.cshrc diff --git a/etc/root/dot.login b/bin/csh/dot.login similarity index 100% rename from etc/root/dot.login rename to bin/csh/dot.login diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 5b2a66129c7a..1e8684051a47 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -3,6 +3,9 @@ .include +CONFS= dot.profile profile +CONFSDIR_dot.profile= /root +CONFSNAME_dot.profile= .profile PACKAGE=runtime PROG= sh INSTALLFLAGS= -S @@ -34,6 +37,7 @@ WFORMAT=0 CLEANFILES+= mknodes mksyntax CLEANFILES+= ${GENSRCS} ${GENHDRS} +LINKS= /root/.profile /.profile build-tools: mknodes mksyntax @@ -60,4 +64,7 @@ token.h: mktokens HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +beforeinstall: + rm -f ${DESTDIR}/.profile + .include diff --git a/etc/root/dot.profile b/bin/sh/dot.profile similarity index 100% rename from etc/root/dot.profile rename to bin/sh/dot.profile diff --git a/etc/profile b/bin/sh/profile similarity index 100% rename from etc/profile rename to bin/sh/profile diff --git a/etc/Makefile b/etc/Makefile index 85b8c5c2e8b6..7f02abfba2ea 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -33,7 +33,6 @@ BIN1= crontab \ networks \ nsswitch.conf \ phones \ - profile \ protocols \ rc.bsdextended \ rc.firewall \ @@ -88,10 +87,6 @@ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf BIN1+= rc.sendmail .endif -.if ${MK_TCSH} != "no" -BIN1+= csh.cshrc csh.login csh.logout -.endif - .if ${MK_WIRELESS} != "no" BIN1+= regdomain.xml .endif @@ -145,10 +140,6 @@ distribution: ${DESTDIR}/etc/services; .endif -.if ${MK_TCSH} == "no" - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd -.endif - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) ( \ echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \ @@ -190,20 +181,7 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ dot.k5login ${DESTDIR}/root/.k5login; .endif - cd ${.CURDIR}/root; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.profile ${DESTDIR}/root/.profile; \ - rm -f ${DESTDIR}/.profile; \ - ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile -.if ${MK_TCSH} != "no" - cd ${.CURDIR}/root; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.cshrc ${DESTDIR}/root/.cshrc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - dot.login ${DESTDIR}/root/.login; \ - rm -f ${DESTDIR}/.cshrc; \ - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc -.endif + .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail