wmclock: Add version 1.0.14 to repository.
[dockapps.git] / wmclock / wmclock.spec.in
blobb8c90a0f92fc5bbf3603e339dbb5fe7a4a65cc3f
1 # User-Defined Macros:
2 # %%define <name> <expansion>
3 %define Name wmclock
4 %define Version @VERSION@
5 %define Release 1
6 %define Prefix /usr/local
7 %define ExecPrefix /usr/local
8 Summary: dockable clock applet for Window Maker
9 Name: %{Name}
10 Version: %{Version}
11 Release: %{Release}
12 #Epoch:
13 Copyright: GPL
14 Group: User Interface/X
15 URL: http://www.bluestop.org/wmclock/
16 Source0: http://www.bluestop.org/wmclock/%{Name}-%{Version}.tar.gz
17 #Patch0:
18 #Prefix: %{Prefix}
19 BuildRoot: /tmp/%{Name}-%{Version}-%{Release}-root
20 #Provides:
21 #Requires:
22 #Obsoletes:
24 %description
25 Wmclock is an applet which displays the date and time in a dockable
26 tile in the same style as the clock from the NEXTSTEP(tm) operating
27 system. Wmclock is specially designed for the Window Maker window
28 manager, by Alfredo Kojima, and features multiple language support,
29 twenty-four-hour and twelve-hour (am/pm) time display, and, optionally,
30 can run a user-specified program on a mouse click. Wmclock is derived
31 from asclock, a similar clock for the AfterStep window manager.
33 %prep
34 %setup
35 #%patch0 -b .orig
37 #function Replace() {
38 # local fil="$1"
39 # local sep="$2"
40 # local old="$3"
41 # local new="$4"
42 # local suf="$5"
43 # [ -z "${suf}" ] && suf='~'
44 # mv -f ${fil} ${fil}${suf}
45 # cat ${fil}${suf} | sed -e "s${sep}${old}${sep}${new}${sep}g" >$fil
48 %build
49 if [ -z "${CC}" ]; then
50 if [ -n "`which gcc`" ]; then
51 CC="gcc"
52 else
53 CC="cc"
56 export CC
58 ./configure --lang english
59 make CC="${CC}" CDEBUGFLAGS="${RPM_OPT_FLAGS}"
61 %install
62 function CheckBuildRoot() {
63 # do a few sanity checks on the BuildRoot
64 # to make sure we don't damage a system
65 case "${RPM_BUILD_ROOT}" in
66 ''|' '|/|/bin|/boot|/dev|/etc|/home|/lib|/mnt|/root|/sbin|/tmp|/usr|/var)
67 echo "Yikes! Don't use '${RPM_BUILD_ROOT}' for a BuildRoot!"
68 echo "The BuildRoot gets deleted when this package is rebuilt;"
69 echo "something like '/tmp/build-blah' is a better choice."
70 return 1
72 *) return 0
74 esac
76 function CleanBuildRoot() {
77 if CheckBuildRoot; then
78 rm -rf "${RPM_BUILD_ROOT}"
79 else
80 exit 1
83 CleanBuildRoot
85 for i in \
86 %{Prefix} \
87 %{Prefix}/share \
88 %{Prefix}/share/%{Name} \
89 %{ExecPrefix} \
90 ; do
91 mkdir -p "${RPM_BUILD_ROOT}${i}"
92 done
94 make DESTDIR="${RPM_BUILD_ROOT}" install
95 make DESTDIR="${RPM_BUILD_ROOT}" install.man
96 make DESTDIR="${RPM_BUILD_ROOT}" install.share
98 %clean
99 function CheckBuildRoot() {
100 # do a few sanity checks on the BuildRoot
101 # to make sure we don't damage a system
102 case "${RPM_BUILD_ROOT}" in
103 ''|' '|/|/bin|/boot|/dev|/etc|/home|/lib|/mnt|/root|/sbin|/tmp|/usr|/var)
104 echo "Yikes! Don't use '${RPM_BUILD_ROOT}' for a BuildRoot!"
105 echo "The BuildRoot gets deleted when this package is rebuilt;"
106 echo "something like '/tmp/build-blah' is a better choice."
107 return 1
109 *) return 0
111 esac
113 function CleanBuildRoot() {
114 if CheckBuildRoot; then
115 rm -rf "${RPM_BUILD_ROOT}"
116 else
117 exit 1
120 CleanBuildRoot
122 %files
123 %attr(- ,root,root) %doc COPYING ChangeLog INSTALL README
124 %attr(0755,root,root) %{ExecPrefix}/bin/wmclock
125 %attr(0755,root,root) %{ExecPrefix}/man/man1/wmclock.1*
126 %attr(0755,root,root) %dir %{Prefix}/share/wmclock
127 %attr(- ,root,root) %{Prefix}/share/wmclock/*