Wed Nov 5 22:41:38 2014 UTC ()
Add a patch to weekno.perl so that it uses ISO 8601 week numbering.
Remove dependence on timelocal.pl; use Time::Local instead.
Rename other patches according to new conventions.
Fix pkglint warnings.
Bump PKGREVISION.


(he)
diff -r1.30 -r1.31 pkgsrc/time/titrax/Makefile
diff -r1.3 -r1.4 pkgsrc/time/titrax/PLIST
diff -r1.7 -r1.8 pkgsrc/time/titrax/distinfo
diff -r0 -r1.1 pkgsrc/time/titrax/patches/patch-Imakefile
diff -r0 -r1.1 pkgsrc/time/titrax/patches/patch-sumtitra
diff -r0 -r1.1 pkgsrc/time/titrax/patches/patch-titrat
diff -r0 -r1.1 pkgsrc/time/titrax/patches/patch-weekno.perl
diff -r1.2 -r0 pkgsrc/time/titrax/patches/patch-aa
diff -r1.2 -r0 pkgsrc/time/titrax/patches/patch-ac
diff -r1.1.1.1 -r0 pkgsrc/time/titrax/patches/patch-ab

cvs diff -r1.30 -r1.31 pkgsrc/time/titrax/Makefile (expand / switch to unified diff)

--- pkgsrc/time/titrax/Makefile 2014/06/29 19:12:51 1.30
+++ pkgsrc/time/titrax/Makefile 2014/11/05 22:41:38 1.31
@@ -1,33 +1,33 @@ @@ -1,33 +1,33 @@
1# $NetBSD: Makefile,v 1.30 2014/06/29 19:12:51 dholland Exp $ 1# $NetBSD: Makefile,v 1.31 2014/11/05 22:41:38 he Exp $
2# 2#
3 3
4DISTNAME= titrax-1.98 4DISTNAME= titrax-1.98
5PKGREVISION= 9 5PKGREVISION= 10
6CATEGORIES= x11 time 6CATEGORIES= x11 time
7MASTER_SITES= ${MASTER_SITE_XCONTRIB:=office/} 7MASTER_SITES= ${MASTER_SITE_XCONTRIB:=office/}
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://www.alvestrand.no/titrax/TimeTracker.html 10HOMEPAGE= http://www.alvestrand.no/titrax/TimeTracker.html
11COMMENT= Little X11 tool to track project times 11COMMENT= Little X11 tool to track project times
12LICENSE= titrax-license 12LICENSE= titrax-license
13 13
14RESTRICTED= Do not sell for "real money". 14RESTRICTED= Do not sell for "real money".
15# XXX Arguably NO_*_ON_CDROM is not necessary, because "real money" seems 15# XXX Arguably NO_*_ON_CDROM is not necessary, because "real money" seems
16# to exclude CDROM distribution charges. 16# to exclude CDROM distribution charges.
17NO_SRC_ON_CDROM= ${RESTRICTED} 17NO_SRC_ON_CDROM= ${RESTRICTED}
18NO_BIN_ON_CDROM= ${RESTRICTED} 18NO_BIN_ON_CDROM= ${RESTRICTED}
19 19
20USE_IMAKE= YES 20USE_IMAKE= YES
21USE_TOOLS+= perl:run 21USE_TOOLS+= perl:run
22 22
23pre-configure: 23pre-configure:
24 ${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.bak 24 ${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.bak
25 ${SED} -e "s|@LOCALBASE@|${LOCALBASE}|g" \ 25 ${SED} -e "s|@LOCALBASE@|${PREFIX}|g" \
26 -e "s|@X11BASE@|${X11PREFIX}|g" \ 26 -e "s|@X11BASE@|${X11PREFIX}|g" \
27 ${WRKSRC}/Imakefile.bak > ${WRKSRC}/Imakefile 27 ${WRKSRC}/Imakefile.bak > ${WRKSRC}/Imakefile
28 28
29INSTALLATION_DIRS= libexec/titrax 29INSTALLATION_DIRS= libexec/titrax
30 30
31.include "../../x11/libXaw/buildlink3.mk" 31.include "../../x11/libXaw/buildlink3.mk"
32.include "../../x11/libXt/buildlink3.mk" 32.include "../../x11/libXt/buildlink3.mk"
33.include "../../mk/bsd.pkg.mk" 33.include "../../mk/bsd.pkg.mk"

cvs diff -r1.3 -r1.4 pkgsrc/time/titrax/PLIST (expand / switch to unified diff)

--- pkgsrc/time/titrax/PLIST 2009/06/14 18:18:00 1.3
+++ pkgsrc/time/titrax/PLIST 2014/11/05 22:41:38 1.4
@@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
1@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:18:00 joerg Exp $ 1@comment $NetBSD: PLIST,v 1.4 2014/11/05 22:41:38 he Exp $
2bin/sumtitra 2bin/sumtitra
3bin/titrax 3bin/titrax
4bin/titrat 4bin/titrat
5lib/X11/app-defaults/Titrax 5lib/X11/app-defaults/Titrax
6libexec/titrax/weekno.perl 6libexec/titrax/weekno.perl
7${IMAKE_MAN_DIR}/sumtitra.${IMAKE_MANNEWSUFFIX} 7${IMAKE_MAN_DIR}/sumtitra.${IMAKE_MAN_SUFFIX}
8${IMAKE_MAN_DIR}/titrax.${IMAKE_MANNEWSUFFIX} 8${IMAKE_MAN_DIR}/titrax.${IMAKE_MAN_SUFFIX}

cvs diff -r1.7 -r1.8 pkgsrc/time/titrax/distinfo (expand / switch to unified diff)

--- pkgsrc/time/titrax/distinfo 2014/06/29 19:12:51 1.7
+++ pkgsrc/time/titrax/distinfo 2014/11/05 22:41:38 1.8
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1$NetBSD: distinfo,v 1.7 2014/06/29 19:12:51 dholland Exp $ 1$NetBSD: distinfo,v 1.8 2014/11/05 22:41:38 he Exp $
2 2
3SHA1 (titrax-1.98.tar.gz) = 2849f8930aac945d435f58ad0a2a98fc19477da0 3SHA1 (titrax-1.98.tar.gz) = 2849f8930aac945d435f58ad0a2a98fc19477da0
4RMD160 (titrax-1.98.tar.gz) = 519898ed0d74b50d1a01041a6479fb4974823f3e 4RMD160 (titrax-1.98.tar.gz) = 519898ed0d74b50d1a01041a6479fb4974823f3e
5Size (titrax-1.98.tar.gz) = 41154 bytes 5Size (titrax-1.98.tar.gz) = 41154 bytes
6SHA1 (patch-aa) = 67b1aadb6e8ad5bc86959fe41c71dd5467d35f2c 6SHA1 (patch-Imakefile) = 67b1aadb6e8ad5bc86959fe41c71dd5467d35f2c
7SHA1 (patch-ab) = 03ea1f434ab68ccd408830c778a462c083729c95 7SHA1 (patch-sumtitra) = 2fbad9d6cdbc5239cf2a25ab057f640452c5a33e
8SHA1 (patch-ac) = 2fbad9d6cdbc5239cf2a25ab057f640452c5a33e 8SHA1 (patch-titrat) = a6979392d0d0f755ff94147c490c466c3f60ff55
9SHA1 (patch-ad) = 49ab87c6c5d1574bcef3baf6d0c8a4c8e0220583 9SHA1 (patch-weekno.perl) = c5b431054d600fd2ee6ebe345257fd0febe9e0b0

File Added: pkgsrc/time/titrax/patches/patch-Imakefile
$NetBSD: patch-Imakefile,v 1.1 2014/11/05 22:41:38 he Exp $

- configure for pkgsrc
- do ratty interpreter fixes (XXX: change to REPLACE_PERL)
- use tail -n +2 instead of tail +2 to work around broken Linux userlands

--- Imakefile.orig	1995-10-17 13:44:48.000000000 +0000
+++ Imakefile
@@ -1,10 +1,10 @@
 # Installation options
 #=====================
 # The place where you install local programs (not X)
-NONXBINDIR = /local/bin
+NONXBINDIR = @LOCALBASE@/bin
 #
 # PERLLIBDIR should be the output from perl -e 'print "@INC[0]\n"'
-PERLLIBDIR = /usr/lib/perl
+PERLLIBDIR = @X11BASE@/libexec/titrax
 # PERL - where your Perl executable is located (is in sumtitrax)
 PERL = $(NONXBINDIR)/perl
 #
@@ -12,7 +12,7 @@ PERL = $(NONXBINDIR)/perl
 # XAWLIB = -lXaw3d
 #
 # If you want to stop UDP packets to the author, uncomment this
-# CDEBUGFLAGS = -DDO_NOT_TELL_ABOUT_ME
+CDEBUGFLAGS = -DDO_NOT_TELL_ABOUT_ME
 #
 # If you have problems with undefined variables, you may have
 # hit the linker bug with SunOS 4.1.2 and X11R4; uncomment this line
@@ -44,13 +44,13 @@ LASTVERSION = V1_97
 # functions that are declared, but not used
 LINTOPTS = -az
 
-all:: titrax sumtitra titrat
+all:: titrax sumtitra titrat weekno.perl
 depend:: Titrax_ad.h
 
 ComplexProgramTarget(titrax)
 InstallAppDefaults(Titrax)
-InstallProgram(sumtitra,$(NONXBINDIR))
-InstallProgram(titrat,$(NONXBINDIR))
+InstallNamedProg(sumtitra,sumtitra,$(BINDIR))
+InstallNamedProg(titrat,titrat,$(BINDIR))
 InstallManPage(sumtitra,$(MANDIR))
 InstallNonExec(weekno.perl,$(PERLLIBDIR))
 
@@ -61,14 +61,19 @@ titrax.o: Titrax_ad.h
 # Modifying PERL scripts - technique courtesy of Lindsay (of Zircon fame)
 sumtitra: Makefile
 	mv sumtitra sumtitra.tmp
-	echo '#!$(PERL)' > sumtitra
-	tail +2 sumtitra.tmp >> sumtitra
+	echo '#!$(PERL) -I$(PERLLIBDIR)' > sumtitra
+	tail -n +2 sumtitra.tmp >> sumtitra
 	rm sumtitra.tmp
 titrat: Makefile
 	mv titrat titrat.tmp
 	echo '#!$(PERL)' > titrat
-	tail +2 titrat.tmp >> titrat
+	tail -n +2 titrat.tmp >> titrat
 	rm titrat.tmp
+weekno.perl: Makefile
+	mv weekno.perl weekno.perl.tmp
+	echo '#!$(PERL)' > weekno.perl
+	tail -n +2 weekno.perl.tmp >> weekno.perl
+	rm weekno.perl.tmp
 
 #------------------------------------------------------------------
 # Everything below this line should be only for release and debugging,

File Added: pkgsrc/time/titrax/patches/patch-sumtitra
$NetBSD: patch-sumtitra,v 1.1 2014/11/05 22:41:38 he Exp $

Fix a "year 2000" bug, and fix this to work without warning
with newer perl.

--- sumtitra.orig	1995-10-17 13:44:48.000000000 +0000
+++ sumtitra
@@ -83,7 +83,7 @@ $DATE'startday = $startday;
 $endday = $startday + $numdays - 1;
 
 # Find which week to sum for
-$week = shift(ARGV);
+$week = shift(@ARGV);
 $oneday = 24 * 60 * 60;
 if (!$week) {
    # Default is last week.
@@ -150,7 +150,7 @@ if ($nameadd) {
 } else {
    print "$name\n";
 }
-print $word{"banner"}, " $week 19$year\n";
+print $word{"banner"}, " $week ", 1900+$year, "\n";
 
 printf "%-${projwidth}.${projwidth}s%6s!", $word{"project"}, $word{"tot"};
 for ($startday..$endday) {

File Added: pkgsrc/time/titrax/patches/patch-titrat
$NetBSD: patch-titrat,v 1.1 2014/11/05 22:41:38 he Exp $

Don't use errno.ph, instead hardcode the EEXIST value.

--- titrat.orig Tue Oct 17 14:44:49 1995
+++ titrat      Tue Dec  8 13:48:48 1998
@@ -7,9 +7,9 @@
 require 'ctime.pl';
 # If you cannot find errno.ph, just uncomment the following line, if
 # EEXIST is 17 in your /usr/include/sys/errno.h file.
-# eval 'sub EEXIST {17;}';
+eval 'sub EEXIST {17;}';
 
-require 'errno.ph';
+# require 'errno.ph';
 
 $SIG{'HUP'} = 'signal';
 $SIG{'INT'} = 'signal';

File Added: pkgsrc/time/titrax/patches/patch-weekno.perl
$NetBSD: patch-weekno.perl,v 1.1 2014/11/05 22:41:38 he Exp $

Fix this so that it uses week numbering according to ISO 8601.

--- weekno.perl.orig	1995-10-17 13:44:49.000000000 +0000
+++ weekno.perl
@@ -1,7 +1,7 @@
 #!/local/bin/perl
 # Package for date handling
-# Use the PERL std library timelocal - older had his own
-require "timelocal.pl";
+# Use the PERL std package Time::Local
+use Time::Local;
 
 package DATE;
 #               J   F   M   A   M   J   J   A   S   O   N   D
@@ -51,7 +51,21 @@ sub weekno {
 
 
 sub firstdayfirstweek {
-# Return first day of week 1 of any year
+# Return the day of the year (0 is Jan 1st)
+# for the first day of week 1 of any year.
+#
+# Quoting strftime(3):
+#  %V    is replaced by the week number of the year (Monday as the first day
+#        of the week) as a decimal number [01,53]. According to ISO 8601 the
+#        week containing January 1 is week 1 if it has four or more days in
+#        the new year, otherwise it is week 53 of the previous year, and the
+#        next week is week 1.  The year is given by the `%G' conversion
+#        specification.
+#
+# So this will return a negative value in some cases, i.e. when
+# Jan 1st falls on either of Tuesday, Wednesday or Thursday, and
+# will be positive (1) or zero for Sunday or Monday respectively.
+#
    local($y) = @_;
    local($ret);
    # Get time of January 1, 0.0.0.0
@@ -59,13 +73,14 @@ sub firstdayfirstweek {
    local($firsttime) = &main'timelocal(0, 0, 0, 1, 0, $y, 0, 0, 0);
    local(@firstday) = localtime($firsttime);
    local($wday) = $firstday[6];
-   # Rule works for some years.....89 to 92 tested, they all hit branch 2...
-   if ($wday > 3) {
-      $ret = 8 - $wday;
+   # Weekday 4 is Thursday (localtime returns zero-based with Sunday = 0)
+   if ($wday <= 4) {
+       $ret = 1 - $wday;	# first day of week 1 may be in late December
+       				# The exception is when Jan 1 = Sunday (wday 0)
    } else {
-      $ret = 1 - $wday;
+       $ret = 8 - $wday;	# first day of week 1 is in January
    }
-   $ret;
+   return $ret;
 }
  
 sub firstinweek {

File Deleted: pkgsrc/time/titrax/patches/Attic/patch-aa

File Deleted: pkgsrc/time/titrax/patches/Attic/patch-ac

File Deleted: pkgsrc/time/titrax/patches/Attic/patch-ab