--- admin/PlamoBuild-template-20170415 2017-04-15 12:25:32.000000000 +0900 +++ plamo/01_minimum/network.txz/ntp/PlamoBuild.ntp-4.2.8p10 2017-06-17 08:43:53.000000000 +0900 @@ -1,18 +1,21 @@ #!/bin/sh ###################################################################### -url="" +url="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz" verify= digest= commitid= -pkgbase= -vers= +pkgbase=ntp +vers=4.2.8p10 arch=`uname -m` -build=P1 +build=P2 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README.pullrequests ChangeLog README.patches readme.y2kfixes + CommitLog-4.1.0 COPYRIGHT NOTES.y2kfixes README CommitLog + README.leapsmear NEWS INSTALL README.versions WHERE-TO-START TODO + README.hackers README.bk README.refclocks" template=20170415 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin ###################################################################### @@ -41,7 +44,8 @@ if [ -x configure ] ; then ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --libdir='${exec_prefix}'/$libdir --infodir='${prefix}'/share/info \ - --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} + --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]} \ + CFLAGS="-g -O2 -fPIC" fi done fi @@ -64,16 +68,117 @@ make install DESTDIR=$P fi done + install -d $P/etc + cat <<- "EOF" > $P/etc/ntp.conf.new + # Location of drift file + driftfile /var/lib/ntp/ntp.drift + + # NTP Servers + server ntp1.jst.mfeed.ad.jp + server ntp2.jst.mfeed.ad.jp + server ntp3.jst.mfeed.ad.jp + + # Restriction + restrict -4 default kod limited notrap nomodify nopeer noquery + restrict -6 default kod limited notrap nomodify nopeer noquery + restrict 127.0.0.1 + restrict ::1 + EOF + install -d $P/etc/rc.d/init.d + cat <<- "EOF" > $P/etc/rc.d/init.d/ntp + #!/bin/sh + + NTPD_OPTS="-u ntp:ntp -p /var/run/ntpd.pid -g" + + start() { + if pgrep -u ntp ntpd > /dev/null 2>&1 ; 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 $NTPD_OPTS + fi + } + + stop() { + killall ntpd + } + + status() { + if pgrep -u ntp ntpd > /dev/null 2>&1 ; then + echo "NTP daemon is running." + exit 0 + else + echo "NTP daemon is not running." + exit 1 + fi + } + + case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 + start + ;; + status) + status + ;; + *) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 + ;; + esac + exit 0 + EOF + chmod 755 $P/etc/rc.d/init.d/ntp + install -d $P/var/lib/ntp + chown ntp.ntp $P/var/lib/ntp touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ -exec touch -t `date '+%m%d0900'` {} \; compress setup_docdir + mv $docdir/sntp $docdir/$src + mv $docdir/ntp $docdir/$src/html + mv $docdir/$src/{sntp,{readme.y2kfixes,CommitLog-4.1.0,COPYRIGHT}.gz} $C + mv $docdir/$src/{NOTES.y2kfixes,README,CommitLog,README.leapsmear}.gz $C + mv $docdir/$src/{NEWS,INSTALL,README.versions,WHERE-TO-START,TODO}.gz $C + mv $docdir/$src/{README.{hackers,bk}.gz,html,README.refclocks.gz} $C + mv $docdir/$src/{$func,$myname,$spec}.gz $C + mv $C/{sntp,{readme.y2kfixes,CommitLog-4.1.0,COPYRIGHT}.gz} $docdir/$src + mv $C/{NOTES.y2kfixes,README,CommitLog,README.leapsmear}.gz $docdir/$src + mv $C/{NEWS,INSTALL,README.versions,WHERE-TO-START,TODO}.gz $docdir/$src + mv $C/{README.{hackers,bk}.gz,html,README.refclocks.gz} $docdir/$src + mv $C/{$func,$myname,$spec}.gz $docdir/$src + touch -r $S $docdir/$src convert_links + 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 var/lib/ntp 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 cleanup