[141278] trunk/dports/net
Revision: 141278 https://trac.macports.org/changeset/141278 Author: ryandesign@macports.org Date: 2015-10-13 23:32:32 -0700 (Tue, 13 Oct 2015) Log Message: ----------- docsis: new port, version 0.9.6 (#49268) Added Paths: ----------- trunk/dports/net/docsis/ trunk/dports/net/docsis/Portfile trunk/dports/net/docsis/files/ trunk/dports/net/docsis/files/net-snmp-5.4.patch trunk/dports/net/docsis/files/prog_name.patch Added: trunk/dports/net/docsis/Portfile =================================================================== --- trunk/dports/net/docsis/Portfile (rev 0) +++ trunk/dports/net/docsis/Portfile 2015-10-14 06:32:32 UTC (rev 141278) @@ -0,0 +1,36 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 +PortGroup github 1.0 + +github.setup rlaager docsis 0.9.6 upstream/ +categories net +platforms darwin +maintainers ryandesign openmaintainer +license GPL-2+ + +description generates binary configuration files for DOCSIS-compliant cable modems + +long_description This program encodes text configuration files which contain Configuration \ + File Settings into binary configuration files, as specified by the DOCSIS \ + Radio Frequency Interface Specification, Appendix C. \ + It supports most DOCSIS 2.0 Configuration Settings. + +checksums rmd160 6fde2a520120a5aa9867101ed044a05c57566801 \ + sha256 7f75fb1332b1e788ed111f64b65a702df5f23b280d0f2622c6321d6a4d2dad50 + +depends_build port:autoconf \ + port:automake \ + port:bison \ + port:flex \ + path:bin/glib-gettextize:glib2 \ + port:libtool + +depends_lib path:lib/libssl.dylib:openssl \ + port:net-snmp + +patchfiles net-snmp-5.4.patch \ + prog_name.patch + +configure.cmd ./autogen.sh Property changes on: trunk/dports/net/docsis/Portfile ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Added: trunk/dports/net/docsis/files/net-snmp-5.4.patch =================================================================== --- trunk/dports/net/docsis/files/net-snmp-5.4.patch (rev 0) +++ trunk/dports/net/docsis/files/net-snmp-5.4.patch 2015-10-14 06:32:32 UTC (rev 141278) @@ -0,0 +1,15 @@ +Fix build with net-snmp 5.4 +http://docsis.org/node/1334 +https://sourceforge.net/p/docsis/bugs/17/ +https://github.com/rlaager/docsis/commit/ed9180b94919ee9f3cceeccc8a4bf538a0a... +--- src/docsis.c.orig 2010-06-14 14:24:40.000000000 -0500 ++++ src/docsis.c 2015-10-14 00:48:44.000000000 -0500 +@@ -401,7 +401,7 @@ + #endif /* DEBUG */ + + setenv ("MIBS", "ALL", 1); +- init_mib (); ++ netsnmp_init_mib (); + if (!netsnmp_ds_get_boolean + (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS)) + { Added: trunk/dports/net/docsis/files/prog_name.patch =================================================================== --- trunk/dports/net/docsis/files/prog_name.patch (rev 0) +++ trunk/dports/net/docsis/files/prog_name.patch 2015-10-14 06:32:32 UTC (rev 141278) @@ -0,0 +1,200 @@ +Remove prog_name, which was causing a duplicate symbol compile failure +https://sourceforge.net/p/docsis/bugs/14/ +https://github.com/rlaager/docsis/commit/1c0abdfc8536165d1e91791a4cae38dcbf6... +--- src/docsis.c.orig ++++ src/docsis.c +@@ -113,7 +113,7 @@ add_cmts_mic (unsigned char *tlvbuf, unsigned int tlvbuflen, + else + { + if ( cp[0] == 64 ) { +- printf("%s: warning: TLV64 (length > 255) not allowed in DOCSIS config files\n", prog_name); ++ printf("docsis: warning: TLV64 (length > 255) not allowed in DOCSIS config files\n"); + cp = cp + (size_t) ntohs(*((unsigned short *)(cp+1))) + 3; + } else { + cp = cp + cp[1] + 2; +@@ -134,11 +134,11 @@ add_cmts_mic (unsigned char *tlvbuf, unsigned int tlvbuflen, + } + + #ifdef __GNUC__ +-static void usage (char *prog_name) __attribute__((__noreturn__)); ++static void usage () __attribute__((__noreturn__)); + #endif + + static void +-usage (char *prog_name) ++usage () + { + printf ("DOCSIS Configuration File creator, version %s\n", VERSION); + printf +@@ -147,19 +147,14 @@ usage (char *prog_name) + ("Copyright (c) 2002,2003,2004,2005 Evvolve Media SRL, docsis@evvolve.com \n\n"); + + printf +- ("To encode a cable modem configuration file: \n\t %s -e <modem_cfg_file> <key_file> <output_file>\n", +- prog_name); ++ ("To encode a cable modem configuration file: \n\t docsis -e <modem_cfg_file> <key_file> <output_file>\n"); + printf +- ("To encode multiple cable modem configuration files: \n\t %s -m <modem_cfg_file1> ... <key_file> <new_extension>\n", +- prog_name); ++ ("To encode multiple cable modem configuration files: \n\t docsis -m <modem_cfg_file1> ... <key_file> <new_extension>\n"); + printf +- ("To encode a MTA configuration file: \n\t %s -p <mta_cfg_file> <output_file>\n", +- prog_name); ++ ("To encode a MTA configuration file: \n\t docsis -p <mta_cfg_file> <output_file>\n"); + printf +- ("To encode multiple MTA configuration files: \n\t %s -m -p <mta_file1> ... <new_extension>\n", +- prog_name); +- printf ("To decode a CM or MTA config file: \n\t %s -d <binary_file>\n", +- prog_name); ++ ("To encode multiple MTA configuration files: \n\t docsis -m -p <mta_file1> ... <new_extension>\n"); ++ printf ("To decode a CM or MTA config file: \n\t docsis -d <binary_file>\n"); + printf + ("\nWhere:\n<cfg_file>\t\t= name of text (human readable) cable modem or MTA \n\t\t\t configuration file\n<key_file>\t\t= text file containing the authentication key \n\t\t\t (shared secret) to be used for the CMTS MIC\n<output_file> \t\t= name of output file where the binary data will\n\t\t\t be written to (if it does not exist it is created).\n<binary_file>\t\t= name of binary file to be decoded\n<new_extension>\t\t= new extension to be used when encoding multiple files\n"); + printf ("\nSee examples/*.cfg for configuration file format.\n"); +@@ -179,17 +174,14 @@ main (int argc, char *argv[]) + unsigned int encode_docsis = FALSE, decode_bin = FALSE; + int i; + +- memset (prog_name, 0, 255); +- strncpy (prog_name, argv[0], 254); +- + if (argc < 2 ) { +- usage(prog_name); ++ usage(); + exit (10); + } + + if (!strcmp (argv[1], "-m") ){ /* variable number of args, encoding multiple files */ + if (argc < 5 ) { +- usage(prog_name); ++ usage(); + exit (10); + } + extension_string = argv[argc-1]; +@@ -204,21 +196,21 @@ main (int argc, char *argv[]) + { + case 3: + if (strcmp (argv[1], "-d")) +- usage (prog_name); ++ usage (); + decode_bin = TRUE; + config_file = argv[2]; + break; + ;; + case 4: + if (strcmp (argv[1], "-p")) +- usage (prog_name); ++ usage (); + config_file = argv[2]; + output_file = argv[3]; + break; + ;; + case 5: + if (strcmp (argv[1], "-e")) +- usage (prog_name); ++ usage (); + encode_docsis = TRUE; + config_file = argv[2]; + key_file = argv[3]; +@@ -226,7 +218,7 @@ main (int argc, char *argv[]) + break; + ;; + default: +- usage (prog_name); ++ usage (); + exit (10); + } + } +@@ -235,7 +227,7 @@ main (int argc, char *argv[]) + { + if ((kf = fopen (key_file, "r")) == NULL) + { +- printf ("%s: error: can't open keyfile %s\n", prog_name, key_file); ++ printf ("docsis: error: can't open keyfile %s\n", key_file); + exit (-5); + } + keylen = fread (key, sizeof (unsigned char), 64, kf); +@@ -307,7 +299,7 @@ int encode_one_file ( char *input_file, char *output_file, + + if (!strcmp (input_file, output_file)) + { +- printf ("%s: Error: source file is the same as destination file\n", prog_name); ++ printf ("docsis: Error: source file is the same as destination file\n"); + return -1; + } + +@@ -350,7 +342,7 @@ int encode_one_file ( char *input_file, char *output_file, + decode_main_aggregate (buffer, buflen); + if ((of = fopen (output_file, "wb")) == NULL) + { +- printf ("%s: error: can't open output file %s\n", prog_name, output_file); ++ printf ("docsis: error: can't open output file %s\n", output_file); + return -2; + } + fwrite (buffer, sizeof (unsigned char), buflen, of); +--- src/docsis_encode.c.orig ++++ src/docsis_encode.c +@@ -33,7 +33,6 @@ + #include <math.h> + + #include "docsis_common.h" +-#include "docsis_globals.h" + #include "docsis_encode.h" + #include "docsis_snmp.h" + #include "ethermac.h" +@@ -57,7 +56,7 @@ int encode_uint ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr ) + helper = (union t_val *) tval; + if ( sym_ptr->low_limit || sym_ptr->high_limit ) { + if ( helper->uintval < sym_ptr->low_limit || helper->uintval > sym_ptr->high_limit ) { +- printf ("%s: at line %d, %s value %d out of range %hd-%hd\n ", prog_name,line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); ++ printf ("docsis: at line %d, %s value %d out of range %hd-%hd\n ", line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); + exit(-15); + } + } +@@ -86,7 +85,7 @@ int encode_ushort ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr + helper = (union t_val *) tval; + if ( sym_ptr->low_limit || sym_ptr->high_limit ) { + if ( helper->uintval < sym_ptr->low_limit || helper->uintval > sym_ptr->high_limit ) { +- printf ("%s: at line %d, %s value %d out of range %hd-%hd\n ", prog_name,line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); ++ printf ("docsis: at line %d, %s value %d out of range %hd-%hd\n ", line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); + exit(-15); + } + } +@@ -118,7 +117,7 @@ int encode_uchar ( unsigned char *buf, void *tval, struct symbol_entry *sym_ptr + + if ( sym_ptr->low_limit || sym_ptr->high_limit ) { + if ( helper->uintval < sym_ptr->low_limit || helper->uintval > sym_ptr->high_limit ) { +- printf ("%s: at line %d, %s value %d out of range %hd-%hd\n ", prog_name,line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); ++ printf ("docsis: at line %d, %s value %d out of range %hd-%hd\n ", line,sym_ptr->sym_ident,helper->uintval,sym_ptr->low_limit, sym_ptr->high_limit); + exit(-15); + } + } +--- src/docsis_globals.h.orig ++++ src/docsis_globals.h +@@ -23,7 +23,6 @@ + #ifndef _DOCSIS_GLOBALS_H + #define _DOCSIS_GLOBALS_H + +-char prog_name[255]; + struct tlv *global_tlvtree_head; + symbol_type *global_symtable; + +--- src/docsis_yy.y.orig ++++ src/docsis_yy.y +@@ -37,7 +37,6 @@ extern unsigned int line; /* current line number, defined in a.l */ + extern struct tlv *global_tlvtree_head; /* Global list of all config TLVs */ + extern symbol_type *global_symtable; + extern FILE *yyin; +-extern char prog_name[255]; + + struct tlv *_my_tlvtree_head; + +@@ -620,7 +619,7 @@ int parse_config_file ( char *file, struct tlv **parse_tree_result ) + + if ( (cf = fopen ( file, "r" ))== NULL ) + { +- printf ("%s: Can't open input file %s\n", prog_name, file ); ++ printf ("docsis: Can't open input file %s\n", file ); + return -1; + } +
participants (1)
-
ryandesign@macports.org