rpms/calendar/F-10 Makefile.linux, NONE, 1.1 calendar-1.25-linux.patch, NONE, 1.1 calendar.spec, NONE, 1.1 export-calendar-source.sh, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
David Cantrell
dcantrel at fedoraproject.org
Fri Feb 20 20:14:06 UTC 2009
Author: dcantrel
Update of /cvs/pkgs/rpms/calendar/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20164
Modified Files:
.cvsignore sources
Added Files:
Makefile.linux calendar-1.25-linux.patch calendar.spec
export-calendar-source.sh
Log Message:
* Tue Feb 17 2009 David Cantrell <dcantrell at redhat.com> - 1.25-3
- Use cvs status to get the revision number of calendar.c
--- NEW FILE Makefile.linux ---
DESTDIR =
DATADIR = /usr/share
BINDIR = /usr/bin
MANDIR = /usr/share/man
CC = gcc
CFLAGS += -O2 -Wall -D_GNU_SOURCE -DTM_YEAR_BASE=1900
SRCS = calendar.c io.c day.c pesach.c ostern.c paskha.c
OBJS = $(SRCS:.c=.o)
INTER = de_DE.ISO_8859-1 hr_HR.ISO_8859-2 ru_RU.KOI8-R fr_FR.ISO8859-1
all: calendar
calendar: $(OBJS)
$(CC) $(CFLAGS) -o calendar $(OBJS) $(LDFLAGS)
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
install: calendar
mkdir -p $(DESTDIR)$(DATADIR)/calendar
cd calendars ; \
for calendar in calendar.* ; do \
install -m 0644 $$calendar $(DESTDIR)$(DATADIR)/calendar/$$calendar ; \
done
for lang in $(INTER) ; do \
cd calendars/$$lang ; \
mkdir -p $(DESTDIR)$(DATADIR)/calendar/$$lang ; \
for calendar in calendar.* ; do \
install -m 0644 $$calendar $(DESTDIR)$(DATADIR)/calendar/$$lang/$$calendar ; \
done ; \
cd ../../ ; \
done
mkdir -p $(DESTDIR)/$(BINDIR) ; \
install -s -m 0755 calendar $(DESTDIR)/$(BINDIR)/calendar ; \
mkdir -p $(DESTDIR)/$(MANDIR)/man1 ; \
install -m 0644 calendar.1 $(DESTDIR)/$(MANDIR)/man1/calendar.1
clean:
-rm -rf $(OBJS) calendar
calendar-1.25-linux.patch:
--- NEW FILE calendar-1.25-linux.patch ---
diff -up calendar-1.25/calendar.c.orig calendar-1.25/calendar.c
--- calendar-1.25/calendar.c.orig 2005-11-16 06:45:11.000000000 -1000
+++ calendar-1.25/calendar.c 2009-02-12 12:47:01.000000000 -1000
@@ -49,14 +49,12 @@ static const char rcsid[] = "$OpenBSD: c
#include <err.h>
#include <errno.h>
#include <locale.h>
-#include <login_cap.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <tzfile.h>
#include <unistd.h>
#include "pathnames.h"
@@ -184,10 +182,6 @@ main(int argc, char *argv[])
continue;
case 0: /* child */
(void)setlocale(LC_ALL, "");
- if (setusercontext(NULL, pw, pw->pw_uid,
- LOGIN_SETALL ^ LOGIN_SETLOGIN))
- err(1, "unable to set user context (uid %u)",
- pw->pw_uid);
if (acstat) {
if (chdir(pw->pw_dir) ||
stat(calendarFile, &sbuf) != 0 ||
diff -up calendar-1.25/calendar.h.orig calendar-1.25/calendar.h
--- calendar-1.25/calendar.h.orig 2005-08-09 02:32:58.000000000 -1000
+++ calendar-1.25/calendar.h 2009-02-12 15:35:24.000000000 -1000
@@ -29,6 +29,7 @@
* SUCH DAMAGE.
*/
+#include <sys/uio.h>
extern struct passwd *pw;
extern int doall;
@@ -111,7 +112,7 @@ extern int f_SetdayAfter; /* calendar in
/* calendars */
extern enum calendars { GREGORIAN = 0, JULIAN, LUNAR } calendar;
-extern u_long julian;
+extern unsigned long julian;
#define NUMEV 3 /* Total number of such special events */
extern struct specialev spev[NUMEV];
@@ -121,3 +122,5 @@ extern struct specialev spev[NUMEV];
* (e.g. by using named pipes)
*/
#define USERTIMEOUT 20
+
+#define SECSPERDAY 86400
diff -up calendar-1.25/day.c.orig calendar-1.25/day.c
--- calendar-1.25/day.c.orig 2008-04-12 14:22:17.000000000 -1000
+++ calendar-1.25/day.c 2009-02-12 15:41:08.000000000 -1000
@@ -53,7 +53,6 @@ static const char rcsid[] = "$OpenBSD: d
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <tzfile.h>
#include "pathnames.h"
#include "calendar.h"
@@ -170,7 +169,7 @@ settime(time_t *now)
tp->tm_isdst = 0;
tp->tm_hour = 12;
*now = mktime(tp);
- if (isleap(tp->tm_year + TM_YEAR_BASE))
+ if (__isleap(tp->tm_year + TM_YEAR_BASE))
cumdays = daytab[1];
else
cumdays = daytab[0];
@@ -301,7 +300,8 @@ isnow(char *endp, int bodun)
/* adjust bodun rate */
if (bodun && !bodun_always)
- bodun = !arc4random_uniform(3);
+ srandom(3);
+ bodun = random();
/* Easter or Easter depending days */
if (flags & F_SPECIAL)
@@ -452,7 +452,7 @@ isnow(char *endp, int bodun)
}
v2 = day - tp->tm_yday;
if ((v2 > v1) || (v2 < 0)) {
- if ((v2 += isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365)
+ if ((v2 += __isleap(tp->tm_year + TM_YEAR_BASE) ? 366 : 365)
<= v1)
tmtmp.tm_year++;
else if(!bodun || (day - tp->tm_yday) != -1)
@@ -688,7 +688,7 @@ variable_weekday(int *day, int month, in
int *cumdays;
int day1;
- if (isleap(year))
+ if (__isleap(year))
cumdays = daytab[1];
else
cumdays = daytab[0];
diff -up calendar-1.25/io.c.orig calendar-1.25/io.c
--- calendar-1.25/io.c.orig 2007-10-17 10:10:44.000000000 -1000
+++ calendar-1.25/io.c 2009-02-12 12:48:11.000000000 -1000
@@ -59,7 +59,6 @@ static const char rcsid[] = "$OpenBSD: i
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <tzfile.h>
#include <unistd.h>
#include "pathnames.h"
@@ -82,7 +81,7 @@ void
cal(void)
{
int ch, l, i, bodun = 0, bodun_maybe = 0, var, printing;
- struct event *events, *cur_evt, *ev1, *tmp;
+ struct event *events = NULL, *cur_evt = NULL, *ev1 = NULL, *tmp = NULL;
char buf[2048 + 1], *prefix = NULL, *p;
struct match *m;
FILE *fp;
diff -up calendar-1.25/ostern.c.orig calendar-1.25/ostern.c
--- calendar-1.25/ostern.c.orig 2005-11-16 06:45:11.000000000 -1000
+++ calendar-1.25/ostern.c 2009-02-12 15:35:55.000000000 -1000
@@ -34,7 +34,6 @@ static const char rcsid[] = "$OpenBSD: o
#include <stdio.h>
#include <time.h>
-#include <tzfile.h>
#include "calendar.h"
@@ -65,7 +64,7 @@ easter(int year) /* 0 ... abcd, NOT sinc
e_p = e_p + 1;
e_q = 31 + 28 + e_p;
- if (isleap(year))
+ if (__isleap(year))
e_q++;
if (e_n == 4)
diff -up calendar-1.25/paskha.c.orig calendar-1.25/paskha.c
--- calendar-1.25/paskha.c.orig 2005-11-16 06:45:11.000000000 -1000
+++ calendar-1.25/paskha.c 2009-02-12 15:36:27.000000000 -1000
@@ -31,7 +31,7 @@ static const char rcsid[] = "$OpenBSD: p
#endif /* not lint */
#include <stdio.h>
-#include <tzfile.h>
+#include <time.h>
#include "calendar.h"
@@ -52,7 +52,7 @@ paskha(int R) /*year*/
d = (19*a + x) % 30;
e = (2*b + 4*c + 6*d + y) % 7;
cumdays = 31 + 28;
- if (isleap(R))
+ if (__isleap(R))
cumdays++;
return ((cumdays + 22) + (d + e) + 13);
}
diff -up calendar-1.25/pesach.c.orig calendar-1.25/pesach.c
--- calendar-1.25/pesach.c.orig 2004-12-10 10:50:45.000000000 -1000
+++ calendar-1.25/pesach.c 2009-02-12 15:32:37.000000000 -1000
@@ -22,7 +22,7 @@ static const char rcsid[] = "$OpenBSD: p
#endif /* not lint */
#include <stdio.h>
-#include <tzfile.h>
+#include <time.h>
#include "calendar.h"
@@ -66,5 +66,5 @@ pesach(int R)
if (R > 1582)
cumdays += R / 100 - R /400 - 2;
- return (31 + 28 + cumdays + (isleap(R)? 1 : 0));
+ return (31 + 28 + cumdays + (__isleap(R)? 1 : 0));
}
--- NEW FILE calendar.spec ---
Summary: Reminder utility
Name: calendar
Version: 1.25
Release: 3%{?dist}
License: BSD
Group: Applications/Productivity
URL: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/calendar
# The source archive is generated with the export-calendar-source.sh
# script. Update the script's TAG variable when a new version of
# OpenBSD is released. The version number we use for the calendar
# program is the CVS revision ID of the calendar.c file. This is
# determined by the script so it can make the source archive.
Source0: %{name}-%{version}.tar.gz
Source1: Makefile.linux
Source2: export-calendar-source.sh
Patch0: %{name}-1.25-linux.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
The OpenBSD calendar command is a reminder utility. Calendar reads
a mix of configuration files and standard calendar databases and
then displays lines that begin with either today's date or
tomorrow's. The output of the command shows upcoming events for the
week.
%prep
%setup -q
%patch0 -p1
%{__cp} %{SOURCE1} Makefile
%build
%{__make} %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/calendar
%{_mandir}/man1/calendar.1.gz
%{_datadir}/calendar
%changelog
* Tue Feb 17 2009 David Cantrell <dcantrell at redhat.com> - 1.25-3
- Use cvs status to get the revision number of calendar.c
* Tue Feb 17 2009 David Cantrell <dcantrell at redhat.com> - 1.25-2
- Fixed problems in export-calendar-source.sh
- Set permissions on export-calendar-source.sh to 0644
* Thu Feb 12 2009 David Cantrell <dcantrell at redhat.com> - 1.25-1
- Packaged OpenBSD's calendar(1) command from OpenBSD 4.4
--- NEW FILE export-calendar-source.sh ---
#!/bin/sh
CWD=$(pwd)
#TAG=HEAD
TAG=OPENBSD_4_4
rm -rf calendar calendar-${VER}
mkdir calendar
cvs -d anoncvs at anoncvs.ca.openbsd.org:/cvs co \
-d calendar -r ${TAG} src/usr.bin/calendar
cd calendar
VER="$(cvs status calendar.c | grep 'Working revision:' | awk '{ print $3; }')"
cd ..
find calendar -type d -name CVS | xargs rm -rf
mv calendar calendar-${VER}
tar -cvf - calendar-${VER} | gzip -9c > calendar-${VER}.tar.gz
rm -rf calendar-${VER}
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/calendar/F-10/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 20 Feb 2009 19:45:06 -0000 1.1
+++ .cvsignore 20 Feb 2009 20:13:36 -0000 1.2
@@ -0,0 +1 @@
+calendar-1.25.tar.gz
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/calendar/F-10/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 20 Feb 2009 19:45:06 -0000 1.1
+++ sources 20 Feb 2009 20:13:36 -0000 1.2
@@ -0,0 +1 @@
+835aacee18a5a60cc3068deeb7f43d9c calendar-1.25.tar.gz
More information about the fedora-extras-commits
mailing list