Import package vendor original spec for necessary manipulations.

Fri, 21 Sep 2012 22:40:46 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 21 Sep 2012 22:40:46 +0200
changeset 700
2164082fa57f
parent 699
da76d565ccd3
child 701
86ba9e0b19e2

Import package vendor original spec for necessary manipulations.

sipcalc/sipcalc.patch file | annotate | diff | comparison | revisions
sipcalc/sipcalc.spec file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sipcalc/sipcalc.patch	Fri Sep 21 22:40:46 2012 +0200
     1.3 @@ -0,0 +1,121 @@
     1.4 +--- src/sub-func.c.orig	2003-03-19 13:28:15.000000000 +0100
     1.5 ++++ src/sub-func.c	2003-07-28 10:35:53.000000000 +0200
     1.6 +@@ -1267,7 +1267,7 @@
     1.7 + }
     1.8 + #endif
     1.9 + 
    1.10 +-#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP)
    1.11 ++#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP) && defined(AF_INET6)
    1.12 + char *
    1.13 + _resolv_v6_ghbn2 (char *raddr, struct dnsresp *d_resp, char *extra)
    1.14 + {
    1.15 +@@ -1308,7 +1308,7 @@
    1.16 + }
    1.17 + #endif
    1.18 + 
    1.19 +-#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP)
    1.20 ++#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) && defined(AF_INET6)
    1.21 + char *
    1.22 + _resolv_v6_gai (char *raddr, struct dnsresp *d_resp, char *extra)
    1.23 + {
    1.24 +@@ -1393,13 +1393,19 @@
    1.25 + 			snprintf(d_resp->str, 127, "%s%s", inet_ntoa (sin->sin_addr), extra);
    1.26 + 			d_resp->type = AF_INET;
    1.27 + 		}
    1.28 ++#ifdef AF_INET6
    1.29 + 		if (res->ai_family == PF_INET6) {
    1.30 + 			sin6 = (struct sockaddr_in6 *) res->ai_addr;
    1.31 + 			snprintf (retaddr, 1023, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra);
    1.32 + 			snprintf (d_resp->str, 127, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra);
    1.33 + 			d_resp->type = AF_INET6;
    1.34 + 		}
    1.35 ++#endif
    1.36 ++#ifdef AF_INET6
    1.37 + 		if (res->ai_next && (res->ai_family == PF_INET || res->ai_family == PF_INET6))
    1.38 ++#else
    1.39 ++		if (res->ai_next && res->ai_family == PF_INET)
    1.40 ++#endif
    1.41 + 			d_resp = new_dnsresp (d_resp);
    1.42 + 		res = res->ai_next;
    1.43 + 	}
    1.44 +@@ -1460,14 +1466,20 @@
    1.45 + 	if ((f_gethostbyname2 || f_getaddrinfo) && f_inet_ntop)
    1.46 + 		ipv6_cap = 1;
    1.47 + 
    1.48 ++#ifdef AF_INET6
    1.49 + 	if (family != PF_INET && family != PF_INET6 && family != PF_UNSPEC)
    1.50 ++#else
    1.51 ++	if (family != PF_INET && family != PF_UNSPEC)
    1.52 ++#endif
    1.53 + 		return NULL;
    1.54 + 
    1.55 + 	if (family == PF_INET && !ipv4_cap)
    1.56 + 		return NULL;
    1.57 + 
    1.58 ++#ifdef AF_INET6
    1.59 + 	if (family == PF_INET6 && !ipv6_cap)
    1.60 + 		return NULL;
    1.61 ++#endif
    1.62 + 
    1.63 + 	if (family == PF_UNSPEC && (!ipv4_cap && !ipv6_cap))
    1.64 + 		return NULL;
    1.65 +@@ -1475,8 +1487,10 @@
    1.66 + 	if (strlen (addr) > 1023)
    1.67 + 		return NULL;
    1.68 + 
    1.69 ++#ifdef AF_INET6
    1.70 + 	if (family == PF_UNSPEC && !ipv4_cap)
    1.71 + 		family = PF_INET6;
    1.72 ++#endif
    1.73 + 
    1.74 + 	if (family == PF_UNSPEC && !ipv6_cap)
    1.75 + 		family = PF_INET;
    1.76 +@@ -1508,6 +1522,7 @@
    1.77 + 		return retaddr;
    1.78 + 	}
    1.79 + 
    1.80 ++#ifdef AF_INET6
    1.81 + 	if (family == PF_INET6) {
    1.82 + 		if (f_getaddrinfo) {
    1.83 + 			tmpstr = _resolv_v6_gai (raddr, d_resp, extra);
    1.84 +@@ -1525,6 +1540,7 @@
    1.85 + 			return retaddr;
    1.86 + 		}
    1.87 + 	}
    1.88 ++#endif
    1.89 + 
    1.90 + 	if (family == PF_UNSPEC) {
    1.91 + 		if (f_getaddrinfo) {
    1.92 +--- src/sub.c.orig	2003-03-19 13:28:16.000000000 +0100
    1.93 ++++ src/sub.c	2003-07-28 10:37:10.000000000 +0200
    1.94 +@@ -496,6 +496,7 @@
    1.95 + 			ifarg_cur->type = IFT_V6;
    1.96 + 		}
    1.97 + 
    1.98 ++#if AF_INET6
    1.99 + 		if (abox->type == AT_V6 && abox->resolv) {
   1.100 + 			d_resp_start = d_resp_cur = (struct dnsresp *) malloc (sizeof (struct dnsresp));
   1.101 + 			d_resp_start->next = NULL;
   1.102 +@@ -526,6 +527,7 @@
   1.103 + 
   1.104 + 			free_dnsresp (d_resp_start);
   1.105 + 		}
   1.106 ++#endif
   1.107 + 
   1.108 + 		if (abox->type == AT_INT) {
   1.109 + 			if_cur = if_start;
   1.110 +@@ -585,12 +587,14 @@
   1.111 + 				d_resp_cur = d_resp_start;
   1.112 + 				while (d_resp_cur) {
   1.113 + 					strncpy (ifarg_cur->cmdstr, abox->str, 127);
   1.114 ++#if AF_INET6
   1.115 + 					if (d_resp_cur->type == AF_INET6) {
   1.116 + 						strncpy (ifarg_cur->p_v6addr, d_resp_cur->str, 43);
   1.117 + 						ifarg_cur->type = IFT_V6;
   1.118 + 
   1.119 + 						mk_ipv6addr (&ifarg_cur->v6ad, ifarg_cur->p_v6addr);
   1.120 + 					}
   1.121 ++#endif
   1.122 + 					if (d_resp_cur->type == AF_INET) {
   1.123 + 						tmpstr = strstr (d_resp_cur->str, " ");
   1.124 + 						if (tmpstr != NULL && (strlen (tmpstr) > 0)) {
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/sipcalc/sipcalc.spec	Fri Sep 21 22:40:46 2012 +0200
     2.3 @@ -0,0 +1,81 @@
     2.4 +##
     2.5 +##  sipcalc.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package information
    2.28 +Name:         sipcalc
    2.29 +Summary:      IP Subnet Calculator
    2.30 +URL:          http://www.routemeister.net/projects/sipcalc/
    2.31 +Vendor:       Simon Ekstrand
    2.32 +Packager:     OpenPKG Foundation e.V.
    2.33 +Distribution: OpenPKG Community
    2.34 +Class:        PLUS
    2.35 +Group:        Mapping
    2.36 +License:      GPL
    2.37 +Version:      1.1.5
    2.38 +Release:      20090721
    2.39 +
    2.40 +#   list of sources
    2.41 +Source0:      http://www.routemeister.net/projects/sipcalc/files/sipcalc-%{version}.tar.gz
    2.42 +Patch0:       sipcalc.patch
    2.43 +
    2.44 +#   build information
    2.45 +Prefix:       %{l_prefix}
    2.46 +BuildRoot:    %{l_buildroot}
    2.47 +BuildPreReq:  OpenPKG, openpkg >= 20040130, gcc, make
    2.48 +PreReq:       OpenPKG, openpkg >= 20040130
    2.49 +AutoReq:      no
    2.50 +AutoReqProv:  no
    2.51 +
    2.52 +%description
    2.53 +    SipCalc is an IP subnet calculator.
    2.54 +
    2.55 +%track
    2.56 +    prog sipcalc = {
    2.57 +        version   = %{version}
    2.58 +        url       = http://www.routemeister.net/projects/sipcalc/download.html
    2.59 +        regex     = sipcalc-(\d+\.\d+\.\d+)\.tar\.gz
    2.60 +    }
    2.61 +
    2.62 +%prep
    2.63 +    %setup -q
    2.64 +    %patch -p0
    2.65 +
    2.66 +%build
    2.67 +    CC="%{l_cc}" \
    2.68 +    CFLAGS="%{l_cflags -O}" \
    2.69 +    GREP="grep" \
    2.70 +    ./configure \
    2.71 +        --prefix=%{l_prefix}
    2.72 +    %{l_make} %{l_mflags -O}
    2.73 +
    2.74 +%install
    2.75 +    rm -rf $RPM_BUILD_ROOT
    2.76 +    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
    2.77 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
    2.78 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
    2.79 +
    2.80 +%files -f files
    2.81 +
    2.82 +%clean
    2.83 +    rm -rf $RPM_BUILD_ROOT
    2.84 +

mercurial