diff options
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | Makefile.old (renamed from Makefile) | 0 | ||||
-rw-r--r-- | README | 12 | ||||
-rw-r--r-- | cacheserver/Makefile.old (renamed from cacheserver/Makefile) | 0 | ||||
-rw-r--r-- | configure.in | 58 | ||||
-rw-r--r-- | docs/proto/Makefile.old (renamed from docs/proto/Makefile) | 0 | ||||
-rw-r--r-- | include/defconf.h (renamed from include/config.h) | 0 | ||||
-rw-r--r-- | innbbsd/Makefile.old (renamed from innbbsd/Makefile) | 0 | ||||
-rw-r--r-- | innbbsd/innbbsd.c | 8 | ||||
-rw-r--r-- | mbbsd/Makefile.am | 41 | ||||
-rw-r--r-- | mbbsd/Makefile.old (renamed from mbbsd/Makefile) | 0 | ||||
-rw-r--r-- | sample/Makefile.old (renamed from sample/Makefile) | 0 | ||||
-rw-r--r-- | sample/innd/Makefile.old (renamed from sample/innd/Makefile) | 0 | ||||
-rw-r--r-- | util/Makefile.am | 114 | ||||
-rw-r--r-- | util/Makefile.old (renamed from util/Makefile) | 0 |
15 files changed, 235 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..0017125f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +######################################################################## +# PTT BBS Automake +# Create: piaip, Sat Sep 10 10:36:56 CST 2005 +######################################################################## +# $Id$ + +# We are not using standard GNU package +AUTOMAKE_OPTIONS=foreign + +SUBDIRS=mbbsd util @@ -21,12 +21,14 @@ $Id$ proto/ mbbsd/ 裡面各個檔案的說明,詳見該目錄的 README z6ibbs.[12].txt in2 隨筆 - sample/ 範例 + sample/ 範例設定及資源檔 crontab 提供 bbs執行時須透過 crontab 定時跑的設定 - blog/ PttBLOG include/ include 檔 - innbbsd/ 轉信 mbbsd/ bbs 主程式 - mbbsd.icc/ 提供使用 icc來編譯所須要的 Makefile - pttpi/ Ptt Programming Interface + + util/ 工具程式 + innbbsd/ 轉信 + + blog/ PttBLOG 模組 + staticweb/ 靜態網頁瀏覽模組 diff --git a/cacheserver/Makefile b/cacheserver/Makefile.old index 42b077b4..42b077b4 100644 --- a/cacheserver/Makefile +++ b/cacheserver/Makefile.old diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..a1721948 --- /dev/null +++ b/configure.in @@ -0,0 +1,58 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(PTTBBS, 1.9, piaip@csie.ntu.edu.tw) +AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR(mbbsd/bbs.c) +AC_CONFIG_HEADER(config.h) +AC_PREFIX_DEFAULT(/home/bbs) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Checks for header files. +AC_FUNC_ALLOCA +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h sgtty.h stddef.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h utmp.h utmpx.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_TYPE_UID_T +AC_C_INLINE +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +AC_FUNC_GETGROUPS +# AC_FUNC_GETLOADAVG +AC_PROG_GCC_TRADITIONAL +AC_FUNC_LSTAT +AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_MKTIME +AC_FUNC_MMAP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_SETPGRP +AC_FUNC_SETVBUF_REVERSED +AC_TYPE_SIGNAL +AC_FUNC_STAT +AC_FUNC_STRFTIME +AC_FUNC_UTIME_NULL +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([alarm bzero dup2 floor ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize gettimeofday inet_ntoa localtime_r memchr memmove memset mkdir munmap pow putenv rmdir select setenv socket strcasecmp strchr strdup strerror strncasecmp strrchr strspn strstr tzset utime]) +AC_CONFIG_FILES([Makefile mbbsd/Makefile util/Makefile]) +AC_OUTPUT diff --git a/docs/proto/Makefile b/docs/proto/Makefile.old index 63086b38..63086b38 100644 --- a/docs/proto/Makefile +++ b/docs/proto/Makefile.old diff --git a/include/config.h b/include/defconf.h index 194e5dc9..194e5dc9 100644 --- a/include/config.h +++ b/include/defconf.h diff --git a/innbbsd/Makefile b/innbbsd/Makefile.old index 0e6c75cc..0e6c75cc 100644 --- a/innbbsd/Makefile +++ b/innbbsd/Makefile.old diff --git a/innbbsd/innbbsd.c b/innbbsd/innbbsd.c index f71ab30c..bdbd2a59 100644 --- a/innbbsd/innbbsd.c +++ b/innbbsd/innbbsd.c @@ -266,7 +266,6 @@ static int CMDmode(client) ClientType *client; { - /* char cwdpath[MAXPATHLEN+1]; */ argv_t *argv = &client->Argv; extern ClientType INNBBSD_STAT; daemoncmd_t *p = argv->dc; @@ -312,8 +311,11 @@ CMDmode(client) fprintf(argv->out, "NONE NEWSFEEDS %d\r\n", NONENEWSFEEDS); fprintf(argv->out, "Max connections %d\r\n", Maxclient); #ifdef DEBUGCWD - getwd(cwdpath); - fprintf(argv->out, "Working directory %s\r\n", cwdpath); + { + char cwdpath[MAXPATHLEN+1]; + getcwd(cwdpath, sizeof(cwdpath)); + fprintf(argv->out, "Working directory %s\r\n", cwdpath); + } #endif if (Channel) for (i = 0, j = 0; i < Maxclient; ++i) { diff --git a/mbbsd/Makefile.am b/mbbsd/Makefile.am new file mode 100644 index 00000000..8d19b6ff --- /dev/null +++ b/mbbsd/Makefile.am @@ -0,0 +1,41 @@ +######################################################################## +# PTT BBS Automake +# Create: piaip, Sat Sep 10 10:36:56 CST 2005 +######################################################################## +# $Id$ + +bin_PROGRAMS=mbbsd + +mbbsd_SOURCES= \ + ../include/var.h \ + admin.c announce.c args.c assess.c bbs.c board.c brc.c cache.c \ + cal.c calendar.c card.c chat.c chc.c chc_tab.c chess.c chicken.c \ + convert.c crypt.c dark.c edit.c fav.c file.c friend.c gamble.c \ + go.c gomo.c guess.c indict.c io.c kaede.c lovepaper.c mail.c \ + mbbsd.c menu.c more.c name.c osdep.c othello.c passwd.c pmore.c \ + read.c record.c register.c screen.c stuff.c syspost.c talk.c \ + term.c topsong.c user.c var.c vice.c vote.c voteboard.c xyz.c + +../include/var.h: var.c + perl ../util/parsevar.pl < var.c > ../include/var.h + +## reduce .bss align overhead +#.if !defined(DEBUG) +#LDFLAGS+=-Wl,--sort-common +#.endif + +#$(PROG): $(OBJS) +# sh ../util/newvers.sh +# $(DIETCC) $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) $(EXT_LIBS) vers.c + +#test: $(PROG) +# killall -9 testmbbsd || true +# cp mbbsd testmbbsd +# ./testmbbsd 9000 +# rm -f testmbbsd +# +#install: $(PROG) +# install -d $(BBSHOME)/bin/ +# install -c -m 755 $(PROG) $(BBSHOME)/bin/ +# mv -f $(BBSHOME)/bin/mbbsd $(BBSHOME)/bin/mbbsd.`date '+%m%d%H%M'` +# ln -sv $(BBSHOME)/bin/mbbsd.`date '+%m%d%H%M'` $(BBSHOME)/bin/mbbsd diff --git a/mbbsd/Makefile b/mbbsd/Makefile.old index a635cb48..a635cb48 100644 --- a/mbbsd/Makefile +++ b/mbbsd/Makefile.old diff --git a/sample/Makefile b/sample/Makefile.old index 832eba59..832eba59 100644 --- a/sample/Makefile +++ b/sample/Makefile.old diff --git a/sample/innd/Makefile b/sample/innd/Makefile.old index 28f297c2..28f297c2 100644 --- a/sample/innd/Makefile +++ b/sample/innd/Makefile.old diff --git a/util/Makefile.am b/util/Makefile.am new file mode 100644 index 00000000..f1cdf95d --- /dev/null +++ b/util/Makefile.am @@ -0,0 +1,114 @@ +######################################################################## +# PTT BBS Automake +# Create: piaip, Sat Sep 10 10:36:56 CST 2005 +######################################################################## +# $Id$ + +CFLAGS=-DPTTBBS_UTIL +BBSBASE=../include/var.h + +# Compile and build with BBS utility library. +CPROG_WITH_UTIL= \ + boardlist BM_money post poststat \ + jungo account birth deluserfile \ + expire mandex rmuid horoscope \ + openvice parse_news openticket topusr \ + yearsold toplazyBM toplazyBBM writemoney \ + reaper buildAnnounce inndBM mailangel \ + outmail chkhbf checkmoney merge_dir \ + transman angel gamblegive checkdir \ + chesscountry tunepasswd buildir xchatd + +# Compile directly. +CPROG_WITHOUT_UTIL= \ + countalldice bbsrf bbsmail initbbs \ + gamble_fix merge_board merge_passwd showboard \ + userlist uhash_loader + +# No need to be compiled. +SCRIPT_PROG = \ + BM_money.sh backpasswd.sh mailog.sh opendice.sh \ + openticket.sh stock.sh topsong.sh weather.sh \ + stock.perl weather.perl toplazyBM.sh toplazyBBM.sh \ + dailybackup.pl tarqueue.pl waterball.pl filtermail.pl \ + getbackup.pl udnnews.pl rebuildaloha.pl + +bin_PRORAMS=$(SCRIPT_PROG) $(CPROG_WITHOUT_UTIL) $(CPROG_WITH_UTIL) \ + shmctl + +UTIL_LIB= \ + util_cache.c util_record.c util_passwd.c util_var.c \ + util_stuff.c util_osdep.c util_args.c util_file.c \ + util_crypt.c + +MBBSD_OBJS= \ + cache record passwd var \ + stuff osdep args file \ + crypt + +../include/var.h: ../mbbsd/var.c + cd ../mbbsd; $(MAKE) ../include/var.h + +.for fn in ${CPROG_WITH_UTIL} +${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c +.endfor + +.for fn in ${MBBSD_OBJS} +util_${fn}.o: ${BBSBASE} ../mbbsd/${fn}.c + $(CCACHE) ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ ../mbbsd/${fn}.c +.endfor + +shmctl: ${BBSBASE} shmctl.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o shmctl ${UTIL_OBJS} shmctl.c + +bbsmail: ${BBSBASE} bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) -o bbsmail -DUSE_ICONV \ + bbsmail.c ../innbbsd/str_decode.c $(UTIL_OBJS) + +install: $(PROGS) + install -d $(BBSHOME)/bin/ + install -c -m 755 $(PROGS) $(BBSHOME)/bin/ + chmod 4755 $(BBSHOME)/bin/post +.if defined(WITHFILTERMAIL) + $(MAKE) installfiltermail +.endif + +clean: + rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL) + + +installfiltermail: + mv $(BBSHOME)/bin/bbsmail $(BBSHOME)/bin/realbbsmail + ln -s $(BBSHOME)/bin/filtermail.pl $(BBSHOME)/bin/bbsmail + +# for diskstat(FreeBSD 4.x only) . +# diskstat should be compiled with bbs and installed with root +diskstat: diskstat.c + $(CCACHE) $(CC) $(CFLAGS) -o diskstat diskstat.c -ldevstat -lkvm + +installdiskstat: diskstat + cp -f diskstat /usr/local/bin/ + chgrp kmem /usr/local/bin/diskstat + chmod 2755 /usr/local/bin/diskstat + +# for bbsctl. bbsctl should be compiled with bbs and installed with root +bbsctl: bbsctl.c + $(CCACHE) $(CC) $(CFLAGS) -o $@ $@.c + +installbbsctl: bbsctl + rm -f /home/bbs/bin/bbsctl + cp /home/bbs/pttbbs/util/bbsctl /home/bbs/bin/bbsctl + chown root /home/bbs/bin/bbsctl + chmod 4755 /home/bbs/bin/bbsctl + +cleanpasswd: cleanpasswd.c ${UTIL_OBJS} + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o cleanpasswd ${UTIL_OBJS} cleanpasswd.c + +r2014transfer: r2014convert + $(CCACHE) ${CC} ${CFLAGS} ${LDFLAGS} -o r2014convert r2014convert.c + ./r2014convert + rm r2014convert + +passwdconverter: passwdconverter.c + $(CCACHE) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -o passwdconverter passwdconverter.c diff --git a/util/Makefile b/util/Makefile.old index cc94fdd5..cc94fdd5 100644 --- a/util/Makefile +++ b/util/Makefile.old |