- Add LICENSE

- Regenerate patches
- Simplify installation
This commit is contained in:
Dmitry Marakasov 2017-02-25 13:50:19 +00:00
parent 6a0490cbe8
commit 37d6be4f4c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434807
4 changed files with 45 additions and 53 deletions

View File

@ -1,26 +1,28 @@
# Created by: Andrey Zakhvatov <andy@icc.surw.chel.su>
# $FreeBSD$
PORTNAME= cal
PORTVERSION= 3.5
PORTREVISION= 1
CATEGORIES= deskutils
MASTER_SITES= SUNSITE/utils/shell
PORTNAME= cal
PORTVERSION= 3.5
PORTREVISION= 1
CATEGORIES= deskutils
MASTER_SITES= SUNSITE/utils/shell
MAINTAINER= ports@FreeBSD.org
COMMENT= Enhanced color version of standard calendar utility
LICENSE= PD
WRKSRC= ${WRKDIR}/cal-3.5/source
MAKEFILE= makefile.unx
ALL_TARGET= cal
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/cal.1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/cal ${STAGEDIR}${PREFIX}/bin/cal
${MV} ${WRKSRC}/cal.1 ${WRKSRC}/cal.1.orig
${SED} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/cal.1.orig > ${WRKSRC}/cal.1
${INSTALL_MAN} ${WRKSRC}/cal.1 ${STAGEDIR}${MANPREFIX}/man/man1
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/cal
@${CHMOD} 0755 ${STAGEDIR}${PREFIX}/etc/cal
${INSTALL_DATA} ${WRKDIR}/cal-3.5/cal.col ${STAGEDIR}${ETCDIR}/calcol.sample
${INSTALL_DATA} ${WRKDIR}/cal-3.5/cal.dat ${STAGEDIR}${ETCDIR}/caldat.sample

View File

@ -1,6 +1,6 @@
--- cal.1.orig Sat Jul 6 02:55:52 1996
+++ cal.1 Mon Mar 29 16:02:33 1999
@@ -375,12 +375,12 @@
--- cal.1.orig 1996-07-05 17:55:52 UTC
+++ cal.1
@@ -375,12 +375,12 @@ Unix local color file
.TP
.B caldat
.TP

View File

@ -1,38 +1,27 @@
*** cal.c.orig Fri Jul 12 04:36:33 1996
--- cal.c Mon May 12 15:23:51 1997
***************
*** 130,135 ****
--- 130,139 ----
/* Note: Other unix systems may require this next re-define to work. */
/* I believe that SCO is one such system. Please send in any fixes */
/* needed to get your system running. */
+ #ifdef __FreeBSD__ /* Make FreeBSD compatible with stricmp() */
+ #define stricmp(a,b) strcasecmp(a,b) /* case-insensitive string comparison */
+ #endif
+
#ifdef __linux__ /* Make linux compatible with stricmp() */
#define stricmp(a,b) strcasecmp(a,b) /* case-insensitive string comparison */
#endif
***************
*** 1401,1408 ****
strcpy(str, ".");
strcpy(str, file);
if ((fp = fopen(str, mode)) == NULL) {
! /* If still not found then look in a lib directory */
strcpy(str, "/usr/lib/");
strcat(str,file);
fp = fopen(str, mode);
}
--- 1405,1416 ----
strcpy(str, ".");
strcpy(str, file);
if ((fp = fopen(str, mode)) == NULL) {
! /* If still not found then look in config directory */
! #ifdef PREFIX
! strcpy(str, PREFIX "/etc/cal/");
! #else
strcpy(str, "/usr/lib/");
+ #endif
strcat(str,file);
fp = fopen(str, mode);
}
--- cal.c.orig 1996-07-11 19:36:33 UTC
+++ cal.c
@@ -130,6 +130,10 @@ BASIC DATA STRUCTURE:
/* Note: Other unix systems may require this next re-define to work. */
/* I believe that SCO is one such system. Please send in any fixes */
/* needed to get your system running. */
+#ifdef __FreeBSD__ /* Make FreeBSD compatible with stricmp() */
+#define stricmp(a,b) strcasecmp(a,b) /* case-insensitive string comparison */
+#endif
+
#ifdef __linux__ /* Make linux compatible with stricmp() */
#define stricmp(a,b) strcasecmp(a,b) /* case-insensitive string comparison */
#endif
@@ -1401,8 +1405,12 @@ FILE *efopen(const char *file, const cha
strcpy(str, ".");
strcpy(str, file);
if ((fp = fopen(str, mode)) == NULL) {
- /* If still not found then look in a lib directory */
+ /* If still not found then look in config directory */
+#ifdef PREFIX
+ strcpy(str, PREFIX "/etc/cal/");
+#else
strcpy(str, "/usr/lib/");
+#endif
strcat(str,file);
fp = fopen(str, mode);
}

View File

@ -1,12 +1,13 @@
--- makefile.unx.orig 1996-03-05 06:36:27.000000000 +0900
+++ makefile.unx 2013-10-19 20:15:02.149614385 +0900
--- makefile.unx.orig 1996-03-04 21:36:27 UTC
+++ makefile.unx
@@ -7,9 +7,13 @@
# To use, enter "make -f makefile.unx"
RM=rm -f
-CC=gcc
+CC=cc
CFLAGS=-O -Wall -DUNIX -DUSE_REMINDER
+CC?=gcc
-CFLAGS=-O -Wall -DUNIX -DUSE_REMINDER
+CFLAGS+=-Wall -DUNIX -DUSE_REMINDER
+.ifdef PREFIX
+CFLAGS+=-DPREFIX="\"${PREFIX}\""