[wmclock] Initial import (#827136).
raorn
raorn at fedoraproject.org
Mon Jun 4 09:28:54 UTC 2012
commit 55cd509ee904ade27c2f2d891d2f4b630cf92f61
Author: Alexey I. Froloff <raorn at raorn.name>
Date: Mon Jun 4 13:28:09 2012 +0400
Initial import (#827136).
.gitignore | 1 +
sources | 1 +
wmclock-1.0.12.2-nopolling.patch | 75 ++++++++++++++++++++++++++++++++++++++
wmclock.spec | 58 +++++++++++++++++++++++++++++
4 files changed, 135 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..1d55ce7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/wmclock-1.0.12.2-pruned.tar.gz
diff --git a/sources b/sources
index e69de29..3934b99 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ea12799ed9f4342024a52c68ea06466e wmclock-1.0.12.2-pruned.tar.gz
diff --git a/wmclock-1.0.12.2-nopolling.patch b/wmclock-1.0.12.2-nopolling.patch
new file mode 100644
index 0000000..e7f85e5
--- /dev/null
+++ b/wmclock-1.0.12.2-nopolling.patch
@@ -0,0 +1,75 @@
+diff -up wmclock-1.0.12.2/wmclock.c.nopolling wmclock-1.0.12.2/wmclock.c
+--- wmclock-1.0.12.2/wmclock.c.nopolling 2000-03-08 10:31:33.000000000 +0300
++++ wmclock-1.0.12.2/wmclock.c 2012-05-31 18:12:52.214041416 +0400
+@@ -20,6 +20,7 @@
+ * with the software or the use or other dealings in the software.
+ */
+
++#include <sys/select.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/time.h>
+@@ -141,7 +142,8 @@ int yPos[NUM_Y_POSITIONS];
+ Display *dpy;
+ Window rootWindow;
+ int screen;
+-/* int xFd; */
++int xFd;
++fd_set xFdSet;
+ int displayDepth;
+ XSizeHints sizeHints;
+ XWMHints wmHints;
+@@ -801,6 +803,7 @@ int main(int argc, char **argv)
+ XTextProperty wmName;
+ XClassHint classHint;
+ Pixmap shapeMask;
++ struct timeval nextEvent;
+
+ /* Parse command line options */
+ progName = extractProgName(argv[0]);
+@@ -842,7 +845,7 @@ int main(int argc, char **argv)
+ screen = DefaultScreen(dpy);
+ rootWindow = RootWindow(dpy, screen);
+ displayDepth = DefaultDepth(dpy, screen);
+- /* xFd = XConnectionNumber(dpy); */
++ xFd = XConnectionNumber(dpy);
+
+ /* Icon Daten nach XImage konvertieren */
+ GetXpms();
+@@ -1042,14 +1045,29 @@ int main(int argc, char **argv)
+ poll((struct poll *) 0, (size_t) 0, 50); /* 5/100 sec */
+ }
+ #else
+- if (enableYearDisplay)
+- {
+- usleep(200000L); /* 1/5 sec */
+- }
++ //We compute the date of next event, in order to avoid polling
++ if (enableBlinking)
++ {
++ gettimeofday(&nextEvent,NULL);
++ nextEvent.tv_sec = 0;
++ nextEvent.tv_usec = 1000000-nextEvent.tv_usec;
++ }
+ else
+- {
+- usleep(50000L); /* 5/100 sec */
+- }
++ {
++ if (enableYearDisplay)
++ {
++ nextEvent.tv_sec = 86400-actualTime%86400;
++ nextEvent.tv_usec = 0;
++ }
++ else
++ {
++ nextEvent.tv_sec = 60-actualTime%60;
++ nextEvent.tv_usec = 0;
++ }
++ }
++ FD_ZERO(&xFdSet);
++ FD_SET(xFd,&xFdSet);
++ select(FD_SETSIZE,&xFdSet,NULL,NULL,&nextEvent);
+ #endif
+ }
+ return(0);
diff --git a/wmclock.spec b/wmclock.spec
new file mode 100644
index 0000000..6cc1e74
--- /dev/null
+++ b/wmclock.spec
@@ -0,0 +1,58 @@
+Name: wmclock
+Version: 1.0.12.2
+Release: 1%{?dist}
+
+Summary: Dockable clock applet for WindowMaker
+License: GPLv2+
+Group: User Interface/X
+
+Url: http://www.jmknoble.net/WindowMaker/wmclock
+#
+# Source tarball contains original asclock source code, that is not used
+# during build. Download original source, unpack and use the following
+# commands to generate "pruned" tarball:
+#
+# ./configure
+# make tar MAKE_CHANGELOG=: EXTRA_DIRS='lang.* xpm' TARBALL='$(TARDIR)-pruned.tar.gz'
+#
+Source: %{name}-%{version}-pruned.tar.gz
+Patch: %{name}-1.0.12.2-nopolling.patch
+
+BuildRequires: imake libX11-devel libXext-devel libXpm-devel xorg-x11-proto-devel
+
+%description
+Wmclock is an applet which displays the date and time in a dockable
+tile in the same style as the clock from the N*XTSTEP operating
+system. Wmclock is specially designed for the WindowMaker window
+manager, by Alfredo Kojima, and features multiple language support,
+twenty-four-hour and twelve-hour (am/pm) time display, and, optionally,
+can run a user-specified program on a mouse click. Wmclock is derived
+from asclock, a similar clock for the AfterStep window manager.
+
+%prep
+%setup -q
+%patch -p1
+
+for f in README wmclock.man.in; do
+ mv "$f" "$f.save"
+ iconv -f LATIN1 -t UTF-8 < "$f.save" > "$f"
+ touch -r "$f.save" "$f"
+ rm "$f.save"
+done
+
+%build
+./configure --lang english
+make %{?_smp_mflags} CDEBUGFLAGS="$RPM_OPT_FLAGS"
+
+%install
+%{make_install} install.man install.share
+
+%files
+%doc README COPYING
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
+%{_datadir}/%{name}
+
+%changelog
+* Thu May 31 2012 Alexey I. Froloff <raorn at raorn.name> - 1.0.12.2-1
+- Initial build for Fedora
More information about the scm-commits
mailing list