--- admin/PlamoBuild-template-20180815	2018-08-15 16:18:50.000000000 +0900
+++ plamo/03_xclassics/emiclock/PlamoBuild.emiclock-2.0.2	2019-10-12 18:21:57.000000000 +0900
@@ -1,19 +1,20 @@
 #!/bin/sh
 
 ######################################################################
-url=""
+url="http://ftp.vector.co.jp/11/78/1347/emiclock-2.0.2.tar.gz"
 verify=
 digest=
 branch=
 commitid=
-pkgbase=
-vers=
+pkgbase=emiclock
+vers=2.0.2
 arch=`uname -m`
-build=P1
+build=P5
 src=$pkgbase-$vers
 patchfiles=""
 OPT_CONFIG=""
-DOCS="README"
+DOCS="00.README COPYRIGHT* ChangeLog INSTALL.ja MANIFEST README.ja
+    `echo doc/{README-OS,TECH-NOTE}.ja doc/Original/README.{mac,win}.ja`"
 template=20180815
 tmplurl=ftp://plamo.linet.gr.jp/pub/Plamo-src/admin
 ######################################################################
@@ -37,6 +38,9 @@
     if [ -d ${B[$i]} ] ; then rm -rf ${B[$i]} ; fi ; cp -a ${S[$i]} ${B[$i]}
   done
   apply_patches
+  cd $B
+  cp -p config.h{,.orig}
+  sed -i '/USE_SOUND/s@#undef@#define@g' config.h
   for i in `seq 0 $((${#B[@]} - 1))` ; do
     cd ${B[$i]}
     if [ -x configure ] ; then
@@ -45,6 +49,11 @@
           --mandir='${prefix}'/share/man ${OPT_CONFIG[$i]}
     fi
   done
+  xmkmf
+  make depend
+  cp -p Makefile{,.orig}
+  sed -i -e '/MANPATH =/s@/man@/share/man@g' \
+      -e '/^SOUND_DIRECTORY =/!s@$(LIBDIR)/EmiClock@$(DESTDIR)&@g' Makefile
 fi
 if [ $opt_build -eq 1 ] ; then
   for i in `seq 0 $((${#B[@]} - 1))` ; do
@@ -63,17 +72,32 @@
     cd ${B[$i]}
     if [ -f Makefile ] ; then
       make install DESTDIR=$P
+      make install.man DESTDIR=$P
     fi
   done
+  rm $P/usr/$libdir/X11/app-defaults
+  mv $P/etc/X11/app-defaults $P/usr/$libdir/X11
+  jappdefdir=$P/usr/$libdir/X11/ja_JP.eucJP/app-defaults
+  install2 resources/R6/EUC/EmiClock.ad $jappdefdir/EmiClock
+  chmod 444 $jappdefdir/EmiClock
   touch $W/i.et
   cd $W
   TZ=UTC find $P ! -type l -newer i.st ! -newer i.et \
       -exec touch -t `date -u '+%m%d0000'` {} \;
   compress
   setup_docdir
+  cp -a $S/sounds $docdir/$src
+  chown -R root.root $docdir/$src/sounds
+  gzip_one $docdir/$src/sounds/README-myu.ja
+  mv $docdir/$src/{sounds,{$func,$myname,$spec}.gz} $C
+  mv $C/{sounds,{$func,$myname,$spec}.gz} $docdir/$src
+  touch -r $S $docdir/$src ; touch -r $S/sounds $docdir/$src/sounds
   convert_links
-  tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2`
-  tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2`
+  tar cvpf $pkg.tar -C $P usr/bin/emiclock
+  tar rvpf $pkg.tar -C $P usr/$libdir/X11/EmiClock
+  tar rvpf $pkg.tar -C $P usr/$libdir/X11/app-defaults/EmiClock
+  tar rvpf $pkg.tar -C $P usr/$libdir/X11/ja_JP.eucJP/app-defaults/EmiClock
+  tar rvpf $pkg.tar -C $P usr/share/man/man1/emiclock.1.gz
   tar rvpf $pkg.tar -C $P usr/share/doc/$src
   TZ=UTC touch -t `date -u '+%m%d0000'` $pkg.tar
   xz $pkg.tar ; touch $pkg.tar.xz ; mv $pkg.tar.xz $pkg.txz