--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/network.txz/old/ntp-20160928/PlamoBuild.ntp-4.2.8p7 2016-09-28 13:52:23.000000000 +0900 @@ -1,15 +1,18 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p7.tar.gz" +pkgbase=ntp +vers=4.2.8p7 arch=`uname -m` -build=P1 +build=P2 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README.leapsmear ChangeLog NEWS CommitLog README readme.y2kfixes + COPYRIGHT README.hackers CommitLog-4.1.0 WHERE-TO-START + README.patches TODO README.refclocks INSTALL README.pullrequests + README.versions README.bk NOTES.y2kfixes" ###################################################################### fscheck() { @@ -272,6 +275,54 @@ make install DESTDIR=$P fi done + install -d $P/etc + cat <<- "EOF" > $P/etc/ntp.conf.new + # peer configuration for your host + # (expected to operate at stratum 3) + server ntp1.jst.mfeed.ad.jp + server ntp2.jst.mfeed.ad.jp + server ntp3.jst.mfeed.ad.jp + driftfile /etc/ntp.drift + EOF + install -d $P/etc/rc.d/init.d + cat <<- "EOF" > $P/etc/rc.d/init.d/ntp + #!/bin/sh + + start() { + if ps ax | grep -q ntpd ; then + echo "NTP daemon already running. NTP start aborted." + exit 0 + fi + if [ -x /usr/bin/ntpd -a -f /etc/ntp.conf ] ; then + ntpdate -s `sed -n '/^server/p' /etc/ntp.conf | cut -d' ' -f2` + ntpd -c /etc/ntp.conf + fi + } + + stop() { + killall ntpd + } + + case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 + ;; + esac + exit 0 + EOF + chmod 755 $P/etc/rc.d/init.d/ntp touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -294,10 +345,34 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + mv $docdir/sntp $docdir/$src + mv $docdir/ntp $docdir/$src/html + mv $docdir/$src/{sntp,{WHERE-TO-START,README.patches,TODO}.gz} $C + mv $docdir/$src/{{README.refclocks,INSTALL,README.pullrequests}.gz,html} $C + mv $docdir/$src/{README.versions,README.bk,NOTES.y2kfixes,$myname}.gz $C + mv $C/{sntp,{WHERE-TO-START,README.patches,TODO}.gz} $docdir/$src + mv $C/{{README.refclocks,INSTALL,README.pullrequests}.gz,html} $docdir/$src + mv $C/{README.versions,README.bk,NOTES.y2kfixes,$myname}.gz $docdir/$src + touch -r $S $docdir/$src convert + install -d $P/install + cat <<- "EOF" > $P/install/doinst.sh + mv etc/ntp.conf.new /tmp + if [ -f etc/ntp.conf ] ; then + mv /tmp/ntp.conf.new etc/ntp.conf.dist + else + mv /tmp/ntp.conf.new etc/ntp.conf + fi + EOF + touch -t `date '+%m%d0900'` $P/install/doinst.sh tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` + tar rvpf $pkg.tar -C $P usr/share/ntp + tar rvpf $pkg.tar -C $P `cd $P ; find etc -type f` tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man5 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man8 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz read -p "Do you want to keep work files? [y/N] " ans