# HG changeset patch # User Myhailo Danylenko # Date 1345472025 -10800 # Node ID 6222baf5dccc7aa05a1253e3f77d0b51636a5ff4 # Parent 3f6d549befa8b9268b340ad6380393f2f222c003 Rearrange docs diff -r 3f6d549befa8 -r 6222baf5dccc CMakeLists.txt --- a/CMakeLists.txt Sun Jul 22 15:59:37 2012 +0300 +++ b/CMakeLists.txt Mon Aug 20 17:13:45 2012 +0300 @@ -1,10 +1,10 @@ -## Copyright 2009 Myhailo Danylenko -# This file is part of mcabber module writing howto examples. +## Copyright 2009-2012 Myhailo Danylenko +# This file is part of mcabber-uptime # -# Examples are free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. +# mcabber-uptime is a free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of the +# License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -64,7 +64,7 @@ ## Installation install(TARGETS uptime DESTINATION lib/mcabber) -install(FILES uptime.rc COPYING README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) +install(FILES docs/uptime.rc COPYING docs/readme.mdwn DESTINATION share/doc/${CPACK_PACKAGE_NAME}) install(DIRECTORY help DESTINATION share/mcabber) install(FILES ${PROJECT_BINARY_DIR}/uptime.avv DESTINATION share/mcabber/avv/modules RENAME uptime) diff -r 3f6d549befa8 -r 6222baf5dccc README --- a/README Sun Jul 22 15:59:37 2012 +0300 +++ b/README Mon Aug 20 17:13:45 2012 +0300 @@ -1,41 +1,1 @@ - -This is a mcabber module to show mcabber uptime. It is probably linux-specific, -and will not work on other systems. - -INSTALLATION - -To install it, you need: -glib -mcabber -cmake -make -gcc - -Then do -$ mkdir build -$ cd build -$ cmake .. -$ make edit_cache -$ make -# make install - -Debian users can instead of make install do -$ fakeroot make package -# dpkg -i libmcabber-uptime*.deb - -Users of other distributions can select appropriate package -generator, using cache editor. - -LICENSE - -This code underlies terms of GNU GPL v2 or later. You can find it in file COPYING -from this distribution or on a GNU web-site . - -CONTACTS - -I will be happy to get feedback, patches, suggestions, etc. -You can send me email or contact via jabber . - - -- Myhailo Danylenko - - +docs/readme.mdwn \ No newline at end of file diff -r 3f6d549befa8 -r 6222baf5dccc docs/index.mdwn --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/index.mdwn Mon Aug 20 17:13:45 2012 +0300 @@ -0,0 +1,10 @@ + +[[!meta title="mcabber-uptime"]] + +# Uptime tracking for MCabber + +Tracks uptime starting from module load time or from +mcabber start time, detected via '/proc'. + +[ [[!hg mcabber-uptime desc="SOURCE"]] ] [ [[README|readme]] ] [ [[RC|uptime.rc]] ] + diff -r 3f6d549befa8 -r 6222baf5dccc docs/readme.mdwn --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/readme.mdwn Mon Aug 20 17:13:45 2012 +0300 @@ -0,0 +1,49 @@ + +# Uptime tracking for MCabber + +This is a mcabber module to track mcabber uptime. To do so you need +either to have '/proc/self/stat', '/proc/uptime' and 'sysconf()' +(probably, linux-specific) or load it at mcabber initialization time. + +To use first variant, set the 'uptime_use_proc' option. + +# Installation + +To install it, you need: + + * mcabber headers + * glib + * cmake + * make + * c compiler (gcc) + * linker (binutils) + +Then do: + + $ mkdir build + $ cd build + $ cmake .. + $ make edit_cache + $ make + # make install + +Debian users can instead of make install do: + + $ make package + # dpkg -i libmcabber-uptime_*.deb + +Users of other distributions can select appropriate package generator, +using cache editor. + +# License + +This code underlies terms of GNU GPL v2 or later. You can find it in +file COPYING from this distribution or on a GNU web-site +. + +# Contact + +I will be happy to get feedback, patches, suggestions, etc. +You can send me email or contact via jabber . + + -- Myhailo Danylenko diff -r 3f6d549befa8 -r 6222baf5dccc docs/uptime.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/uptime.rc Mon Aug 20 17:13:45 2012 +0300 @@ -0,0 +1,8 @@ + +# Use /proc filesystem information to determine mcabber +# startup time. If not set, module load time will be starting +# point for uptime calculations. +set uptime_use_proc = 1 + +module load uptime + diff -r 3f6d549befa8 -r 6222baf5dccc uptime.c --- a/uptime.c Sun Jul 22 15:59:37 2012 +0300 +++ b/uptime.c Mon Aug 20 17:13:45 2012 +0300 @@ -88,7 +88,7 @@ return (sec * hz) + (ssec * hz)/100; } -void do_uptime (char *arg) +static void do_uptime (char *arg) { GString *line = g_string_new (NULL); gchar strstartdate[256]; diff -r 3f6d549befa8 -r 6222baf5dccc uptime.rc --- a/uptime.rc Sun Jul 22 15:59:37 2012 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - -# Use /proc filesystem information to determine mcabber -# startup time. If not set, module load time will be starting -# point for uptime calculations. -set uptime_use_proc = 1 - -module load uptime -