pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/gensolpkg Bring this package into line with 2...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8b4473e9ac50
branches:  trunk
changeset: 482951:8b4473e9ac50
user:      agc <agc%pkgsrc.org@localhost>
date:      Fri Nov 05 16:44:46 2004 +0000

description:
Bring this package into line with 21st century pkgsrc:

+ ZOULARISBASE is gone - just use PREFIX to find bmake
+ WRKDIR contains the name of the work directory, so find this out from pkgsrc
+ remove getcwd() calls, and use WRKDIR to find the place where the various
  informational files are placed
+ retain the ability to set the working directory from the command-line, but
  it is almost useless these days

Bump pkg revision to 2.

diffstat:

 pkgtools/gensolpkg/Makefile         |   8 ++--
 pkgtools/gensolpkg/distinfo         |   4 +-
 pkgtools/gensolpkg/patches/patch-ac |  70 ++++++++++++++++++++++++++++++++++--
 3 files changed, 71 insertions(+), 11 deletions(-)

diffs (121 lines):

diff -r f6f5d649918b -r 8b4473e9ac50 pkgtools/gensolpkg/Makefile
--- a/pkgtools/gensolpkg/Makefile       Fri Nov 05 16:36:26 2004 +0000
+++ b/pkgtools/gensolpkg/Makefile       Fri Nov 05 16:44:46 2004 +0000
@@ -1,18 +1,18 @@
-# $NetBSD: Makefile,v 1.19 2004/02/06 19:04:25 jlam Exp $
+# $NetBSD: Makefile,v 1.20 2004/11/05 16:44:46 agc Exp $
 #
 
 DISTNAME=      gensolpkg-1.10
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    pkgtools
 MASTER_SITES=  ${MASTER_SITE_LOCAL}
 
-MAINTAINER=    veego%NetBSD.org@localhost
+MAINTAINER=    agc%NetBSD.org@localhost
 COMMENT=       Utility to generate a Solaris package
 
 ONLY_FOR_PLATFORM=     SunOS-*-*       # uses Solaris pkgmk(1)
 
 MAKE_ENV+=     CPPFLAGS="" CC=${CC:Q}
-MAKEFLAGS+=    PREFIX=${PREFIX:Q} ZOULARISBASE=${ZOULARISBASE:Q}
+MAKEFLAGS+=    PREFIX=${PREFIX:Q}
 
 do-install:
        cd ${WRKSRC} && ${MAKE} install PREFIX=${PREFIX}
diff -r f6f5d649918b -r 8b4473e9ac50 pkgtools/gensolpkg/distinfo
--- a/pkgtools/gensolpkg/distinfo       Fri Nov 05 16:36:26 2004 +0000
+++ b/pkgtools/gensolpkg/distinfo       Fri Nov 05 16:44:46 2004 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.5 2002/12/08 12:54:44 cjep Exp $
+$NetBSD: distinfo,v 1.6 2004/11/05 16:44:46 agc Exp $
 
 SHA1 (gensolpkg-1.10.tar.gz) = d7981f6c2159a1a2304a5e446185ce6b2ade7305
 Size (gensolpkg-1.10.tar.gz) = 8430 bytes
 SHA1 (patch-aa) = ad9239f3b4a037402b785bf6c37d40208f786ade
 SHA1 (patch-ab) = 0ecef672900def2d2f2151943effdaaf16f8e221
-SHA1 (patch-ac) = 70b71296dcd7686f0e066c0f8c7d9ebba7ad91a7
+SHA1 (patch-ac) = 1da06afa9c8128d3334f7251e8e0bc21f7945d72
diff -r f6f5d649918b -r 8b4473e9ac50 pkgtools/gensolpkg/patches/patch-ac
--- a/pkgtools/gensolpkg/patches/patch-ac       Fri Nov 05 16:36:26 2004 +0000
+++ b/pkgtools/gensolpkg/patches/patch-ac       Fri Nov 05 16:44:46 2004 +0000
@@ -1,13 +1,73 @@
-$NetBSD: patch-ac,v 1.1 2002/12/08 12:54:46 cjep Exp $
+$NetBSD: patch-ac,v 1.2 2004/11/05 16:44:46 agc Exp $
 
---- gensolpkg.c.in.orig        Sat May  5 14:44:31 2001
-+++ gensolpkg.c.in
-@@ -572,7 +572,7 @@ main(int argc, char **argv)
+--- gensolpkg.c.in.orig        Sat May  5 15:44:31 2001
++++ gensolpkg.c.in     Fri Nov  5 16:19:24 2004
+@@ -79,7 +79,7 @@
+ static char   comment[256 + 1];               /* one line descr of pkg */
+ 
+ static char   prefix[MAXPATHLEN];             /* current prefix */
+-static char   *workdir;                       /* name of working directory */
++static char   workdir[MAXPATHLEN];            /* name of working directory */
+ static char   *category;                      /* category of package - default "application" */
+ static int    transform;                      /* transform the package - default "disabled" */
+ 
+@@ -357,9 +357,9 @@
+       }
+       (void) fprintf(fp, "!PKG=%s\n", pkg);
+       (void) fprintf(fp, "!PREFIX=%s\n", prefix);
+-      (void) fprintf(fp, "i pkginfo=%s/%s\n", getcwd(buf, sizeof(buf)), pkginfofile);
+-      (void) fprintf(fp, "i version=%s/%s\n", getcwd(buf, sizeof(buf)), versionfile);
+-      (void) fprintf(fp, "i depend=%s/%s\n", getcwd(buf, sizeof(buf)), dependfile);
++      (void) fprintf(fp, "i pkginfo=%s\n", pkginfofile);
++      (void) fprintf(fp, "i version=%s\n", versionfile);
++      (void) fprintf(fp, "i depend=%s\n", dependfile);
+       for (linec = 1 ; fgets(buf, sizeof(buf), plist) != (char *) NULL ; linec++) {
+               /* trim leading whitespace from PLIST entries */
+               for (cp = buf ; isspace(*cp) ; cp++) {
+@@ -463,7 +463,7 @@
+                       (void) fputc('\n', fp2);
+               }
+               (void) fclose(fp2);
+-              (void) fprintf(fp, "i postinstall=%s/%s/.postinstall\n", getcwd(buf, sizeof(buf)), workdir);
++              (void) fprintf(fp, "i postinstall=%s/.postinstall\n", workdir);
+       }
+       if (remove.s_c > 0) {
+               (void) snprintf(f, sizeof(f), "%s/.postremove", workdir);
+@@ -493,7 +493,7 @@
+                       (void) fputc('\n', fp2);
+               }
+               (void) fclose(fp2);
+-              (void) fprintf(fp, "i postremove=%s/%s/.postremove\n", getcwd(buf, sizeof(buf)), workdir);
++              (void) fprintf(fp, "i postremove=%s/.postremove\n", workdir);
+       }
+       (void) fclose(fp);
+       (void) fclose(plist);
+@@ -572,13 +572,17 @@
        int     i;
  
        (void) strcpy(prefix, "@PREFIX@");
 -      (void) strcpy(bmake, "@PREFIX@/bsd/bin/bmake");
-+      (void) strcpy(bmake, "@ZOULARISBASE@/bin/bmake");
++      (void) strcpy(bmake, "@PREFIX@/bin/bmake");
        (void) strcpy(output, "/tmp");
        (void) strcpy(pkgdir, "@SPOOLDIR@");
        transform = 0;
+-      workdir = "work";
+       category = "application";
+       pkg = (char *) NULL;
++      (void) snprintf(cmd, sizeof(cmd), "%s show-var VARNAME=WRKDIR", bmake);
++      if (!pipeit(workdir, sizeof(workdir), cmd, "r")) {
++              (void) fprintf(stderr, "Warning: can't find package workdir\n");
++              exit(1);
++      }
+       (void) snprintf(cmd, sizeof(cmd), "%s show-var VARNAME=PREFIX", bmake);
+       if (!pipeit(prefix, sizeof(prefix), cmd, "r")) {
+               (void) fprintf(stderr, "Can't find package prefix\n");
+@@ -633,7 +637,7 @@
+                       transform = 1;
+                       break;
+               case 'w':
+-                      workdir = optarg;
++                      (void) strnncpy(workdir, sizeof(workdir), optarg, strlen(optarg));
+                       break;
+               default:
+                       fprintf(stderr, "Usage:\n");



Home | Main Index | Thread Index | Old Index