Update to 8.10. Not sure what has changed since 4.x, but I'd guess rather

much.
This commit is contained in:
wiz 2003-07-12 12:23:12 +00:00
parent fbbbef5158
commit 157928c4de
6 changed files with 51 additions and 80 deletions

View file

@ -1,12 +1,11 @@
# $NetBSD: Makefile,v 1.2 2001/02/16 13:41:30 wiz Exp $
# $NetBSD: Makefile,v 1.3 2003/07/12 12:23:12 wiz Exp $
DISTNAME= nut4
PKGNAME= nut-4.0
WRKSRC= ${WRKDIR}/nut
DISTNAME= nut-8.10
CATEGORIES= biology
MASTER_SITES= http://www.kachinatech.com/~hjjou/archives/
MASTER_SITES= http://www.lafn.org/~av832/
MAINTAINER= root@garbled.net
HOMEPAGE= http://www.lafn.org/~av832/
COMMENT= record what you eat and analyze your meals
ALL_TARGET= nut
@ -15,6 +14,7 @@ USE_GMAKE= yes
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/nut ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/nut
${INSTALL_DATA} ${WRKSRC}/nutdb/abbrev.txt ${PREFIX}/share/nut/abbrev.txt
${INSTALL_DATA} ${WRKSRC}/raw.data/* ${PREFIX}/share/nut
${INSTALL_MAN} ${WRKSRC}/nut.1 ${PREFIX}/man/man1
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,8 @@
@comment $NetBSD: PLIST,v 1.1 2001/10/31 21:28:07 zuntum Exp $
@comment $NetBSD: PLIST,v 1.2 2003/07/12 12:23:12 wiz Exp $
bin/nut
share/nut/abbrev.txt
man/man1/nut.1
share/nut/FOOD_DES.txt
share/nut/NUT_DATA.txt
share/nut/WEIGHT.txt
share/nut/sr15.nut
@dirrm share/nut

View file

@ -1,7 +1,6 @@
$NetBSD: distinfo,v 1.2 2001/04/19 16:02:24 agc Exp $
$NetBSD: distinfo,v 1.3 2003/07/12 12:23:13 wiz Exp $
SHA1 (nut4.tar.gz) = 6db22e2074c69c29e8fa1d252f83e32f44401105
Size (nut4.tar.gz) = 506084 bytes
SHA1 (patch-aa) = de3211e59a0b46497e7cb2738e704d14bee6e76a
SHA1 (patch-ab) = cf2dba8e86457a0aaf538777a829532f854f95e4
SHA1 (patch-ac) = fef6ab92ea087a3bcfc94ecd2e4c7ff20bdd1be7
SHA1 (nut-8.10.tar.gz) = 5d69a814ace32f6a50d678af4460d1d3ebce2eaa
Size (nut-8.10.tar.gz) = 844871 bytes
SHA1 (patch-ab) = 717e1a502295b1bf57fa9db6e55e00c2b64b5761
SHA1 (patch-ac) = 525d65d517f637ed908d1df95672d34713dcf2bd

View file

@ -1,36 +0,0 @@
$NetBSD: patch-aa,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
--- main.c.orig Thu Apr 8 11:28:57 1999
+++ main.c Mon Jan 10 16:07:45 2000
@@ -23,15 +23,32 @@
#include "food.h"
#include "db.h"
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
void main(int argc, char *argv[])
{
+
+char pathname[256];
+extern int errno;
+
food_root.next = NULL;
meal_root.next = NULL;
recipe_root.next = NULL;
make_filenames();
if ( ! read_food_db() )
{
+ sprintf(pathname, "%s/%s", getenv("HOME"), NUTDIR);
+ if (mkdir(pathname, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
+ if (errno != EEXIST) {
+ printf("Cannot create %s/%s: %s\n", getenv("HOME"), NUTDIR,
+ strerror(errno));
+ exit(1);
+ }
+ }
read_raw_food_db();
read_nut_raw_food_file();
}

View file

@ -1,24 +1,27 @@
$NetBSD: patch-ab,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
--- db.c.orig Mon Jan 10 15:24:03 2000
+++ db.c Mon Jan 10 15:42:12 2000
@@ -32,6 +32,11 @@
$NetBSD: patch-ab,v 1.2 2003/07/12 12:23:13 wiz Exp $
--- db.c.orig Sun Jun 1 01:59:22 2003
+++ db.c
@@ -23,6 +23,7 @@
#include "meal.h"
#include "options.h"
#include "util.h"
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -729,7 +730,13 @@ void make_filenames(void)
sprintf(optionsfile,"%s/%s","NUTDB",optionsfile1);
#else
char nutdir1[]=NUTDIR ;
#endif
+#ifndef DBDIR
+char nutdir2[]=".nutdb";
+#else
+char nutdir2[]=DBDIR ;
+#endif
char rawfoodfile1[] = "abbrev.txt";
char rawnutfoodfile1[] = "nutfood.txt";
@@ -454,7 +459,7 @@
void make_filenames(void)
{
-sprintf(rawfoodfile,"%s/%s/%s",getenv("HOME"),nutdir1,rawfoodfile1);
+sprintf(rawfoodfile,"%s/%s",nutdir2,rawfoodfile1);
sprintf(rawnutfoodfile,"%s/%s/%s",getenv("HOME"),nutdir1,rawnutfoodfile1);
sprintf(foodfile,"%s/%s/%s",getenv("HOME"),nutdir1,foodfile1);
sprintf(mealfile,"%s/%s/%s",getenv("HOME"),nutdir1,mealfile1);
sprintf(nutdir,"%s/%s",getenv("HOME"),nutdir1);
-mkdir (nutdir, 0700 );
+if (mkdir(nutdir, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
+ if (errno != EEXIST) {
+ printf("Cannot create %s/%s: %s\n", getenv("HOME"), nutdir1,
+ strerror(errno));
+ exit(1);
+ }
+}
sprintf(USDAjoined,"%s/%s",FOODDIR,USDAjoined1);
sprintf(globalFOOD,"%s/%s",FOODDIR,globalFOOD1);
sprintf(globalNUT,"%s/%s",FOODDIR,globalNUT1);

View file

@ -1,11 +1,12 @@
$NetBSD: patch-ac,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
--- Makefile.orig Mon Jan 10 15:49:05 2000
+++ Makefile Mon Jan 10 15:52:35 2000
$NetBSD: patch-ac,v 1.2 2003/07/12 12:23:13 wiz Exp $
--- Makefile.orig Mon May 12 22:15:17 2003
+++ Makefile
@@ -1,6 +1,6 @@
objects := $(patsubst %.c,%.o,$(wildcard *.c))
-CFLAGS= -O2 -Wall -DNUTDIR=\".nutdb\"
+CFLAGS= -O2 -Wall -DNUTDIR=\".nutdb\" -DDBDIR=\"${PREFIX}/share/nut\"
-CFLAGS= -O3 -Wall -pedantic -ansi -DNUTDIR=\".nutdb\" -DFOODDIR=\"/usr/local/lib/nut\"
+CFLAGS= -O3 -Wall -pedantic -ansi -DNUTDIR=\".nutdb\" -DFOODDIR=\"${PREFIX}/share/nut\"
nut : $(objects)
gcc -O2 -Wall -lm -o nut $(objects)
nut: $(objects)
gcc ${CFLAGS} -lm -o nut $(objects)