openpgm:moved from contrib

This commit is contained in:
blue-devil
2020-01-18 22:21:13 +03:00
parent 3bb5f20c61
commit a43dc73bc8
8 changed files with 323 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt
from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import libtools
from pisi.actionsapi import get
def setup():
shelltools.cd("openpgm/pgm/")
shelltools.system("pwd")
libtools.libtoolize("-fc")
autotools.aclocal()
autotools.autoheader()
autotools.automake("--add-missing --copy")
autotools.autoconf()
# suppress c compiler warnings
pisitools.cflags.add("-Wno-cpp -Wno-unused-result")
autotools.configure()
def build():
shelltools.cd("openpgm/pgm/")
autotools.make()
def install():
shelltools.cd("openpgm/pgm/")
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
@@ -0,0 +1,11 @@
--- openpgm-release-5-2-122/openpgm/pgm/Makefile.am 2012-12-04 03:56:54.000000000 +0100
+++ openpgm-release-5-2-122/openpgm/pgm/Makefile2.am 2019-10-30 22:09:31.457801206 +0100
@@ -54,7 +54,7 @@
histogram.c \
version.c
-share_includedir = $(includedir)/pgm-@RELEASE_INFO@/pgm
+share_includedir = $(includedir)/pgm
share_include_HEADERS = \
include/pgm/atomic.h \
include/pgm/engine.h \
@@ -0,0 +1,129 @@
diff --git a/openpgm/pgm/include/impl/messages.h b/openpgm/pgm/include/impl/messages.h
index 812393f..1655e9c 100644
--- a/openpgm/pgm/include/impl/messages.h
+++ b/openpgm/pgm/include/impl/messages.h
@@ -185,14 +185,14 @@ static inline void pgm_fatal (const char* format, ...) {
#define pgm_warn_if_reached() \
do { \
pgm_warn ("file %s: line %d (%s): code should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ __FILE__, __LINE__, __func__); \
} while (0)
#define pgm_warn_if_fail(expr) \
do { \
if (PGM_LIKELY (expr)); \
else \
pgm_warn ("file %s: line %d (%s): runtime check failed: (%s)", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
+ __FILE__, __LINE__, __func__, #expr); \
} while (0)
@@ -210,14 +210,14 @@ static inline void pgm_fatal (const char* format, ...) {
if (PGM_LIKELY(expr)); \
else { \
pgm_fatal ("file %s: line %d (%s): assertion failed: (%s)", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
+ __FILE__, __LINE__, __func__, #expr); \
abort (); \
} \
} while (0)
# define pgm_assert_not_reached() \
do { \
pgm_fatal ("file %s: line %d (%s): should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ __FILE__, __LINE__, __func__); \
abort (); \
} while (0)
# define pgm_assert_cmpint(n1, cmp, n2) \
@@ -226,7 +226,7 @@ static inline void pgm_fatal (const char* format, ...) {
if (PGM_LIKELY(_n1 cmp _n2)); \
else { \
pgm_fatal ("file %s: line %d (%s): assertion failed (%s): (%" PRIi64 " %s %" PRIi64 ")", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
+ __FILE__, __LINE__, __func__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
abort (); \
} \
} while (0)
@@ -236,7 +236,7 @@ static inline void pgm_fatal (const char* format, ...) {
if (PGM_LIKELY(_n1 cmp _n2)); \
else { \
pgm_fatal ("file %s: line %d (%s): assertion failed (%s): (%" PRIu64 " %s %" PRIu64 ")", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
+ __FILE__, __LINE__, __func__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
abort (); \
} \
} while (0)
@@ -295,7 +295,7 @@ static inline void pgm_fatal (const char* format, ...) {
if (PGM_LIKELY(expr)); \
else { \
pgm_warn ("file %s: line %d (%s): assertion `%s' failed", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
+ __FILE__, __LINE__, __func__, #expr); \
return; \
} \
} while (0)
@@ -304,20 +304,20 @@ static inline void pgm_fatal (const char* format, ...) {
if (PGM_LIKELY(expr)); \
else { \
pgm_warn ("file %s: line %d (%s): assertion `%s' failed", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
+ __FILE__, __LINE__, __func__, #expr); \
return (val); \
} \
} while (0)
# define pgm_return_if_reached() \
do { \
pgm_warn ("file %s: line %d (%s): should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ __FILE__, __LINE__, __func__); \
return; \
} while (0)
# define pgm_return_val_if_reached(val) \
do { \
pgm_warn ("file %s: line %d (%s): should not be reached", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ __FILE__, __LINE__, __func__); \
return (val); \
} while (0)
diff --git a/openpgm/pgm/mem.c b/openpgm/pgm/mem.c
index 5697baf..d3d5295 100644
--- a/openpgm/pgm/mem.c
+++ b/openpgm/pgm/mem.c
@@ -163,7 +163,7 @@ pgm_malloc (
#ifdef __GNUC__
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu " bytes",
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
+ __FILE__, __LINE__, __func__,
n_bytes);
#else
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu " bytes",
@@ -186,7 +186,7 @@ pgm_malloc_n (
if (SIZE_OVERFLOWS (n_blocks, block_bytes)) {
#ifdef __GNUC__
pgm_fatal ("file %s: line %d (%s): overflow allocating %" PRIzu "*%" PRIzu " bytes",
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
+ __FILE__, __LINE__, __func__,
n_blocks, block_bytes);
#else
pgm_fatal ("file %s: line %d: overflow allocating %" PRIzu "*%" PRIzu " bytes",
@@ -210,7 +210,7 @@ pgm_malloc0 (
#ifdef __GNUC__
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu " bytes",
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
+ __FILE__, __LINE__, __func__,
n_bytes);
#else
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu " bytes",
@@ -236,7 +236,7 @@ pgm_malloc0_n (
#ifdef __GNUC__
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu "*%" PRIzu " bytes",
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
+ __FILE__, __LINE__, __func__,
n_blocks, block_bytes);
#else
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu "*%" PRIzu " bytes",
@@ -0,0 +1,11 @@
diff --git a/openpgm/pgm/openpgm-5.2.pc.in b/openpgm/pgm/openpgm-5.2.pc.in
index 1e56d944..9e30a6da 100644
--- a/openpgm/pgm/openpgm-5.2.pc.in
+++ b/openpgm/pgm/openpgm-5.2.pc.in
@@ -9,4 +9,4 @@ Version: @PACKAGE_VERSION@
# packagers may wish to move @LIBS@ to Libs.private for platforms with
# versions of pkg-config that support static linking.
Libs: -L${libdir} -lpgm @LIBS@
-Cflags: -I${includedir}/pgm-@VERSION_MAJOR@.@VERSION_MINOR@ -I${libdir}/pgm-@VERSION_MAJOR@.@VERSION_MINOR@/include
+Cflags: -I${includedir}
@@ -0,0 +1,59 @@
diff --git a/openpgm/pgm/version_generator.py b/openpgm/pgm/version_generator.py
index e489aef..581eabe 100755
--- a/openpgm/pgm/version_generator.py
+++ b/openpgm/pgm/version_generator.py
@@ -1,19 +1,25 @@
-#!/usr/bin/python
+#!/usr/bin/python3
import os
import platform
import time
-build_date = time.strftime ("%Y-%m-%d")
-build_time = time.strftime ("%H:%M:%S")
-build_rev = filter (str.isdigit, "$Revision$")
+timestamp = time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
+build_date = time.strftime ("%Y-%m-%d", timestamp)
+build_time = time.strftime ("%H:%M:%S", timestamp)
+build_rev = ''.join (list (filter (str.isdigit, "$Revision$")))
+build_system = platform.system()
+build_machine = platform.machine()
+if 'SOURCE_DATE_EPOCH' in os.environ:
+ build_system = 'BuildSystem'
+ build_machine = 'BuildMachine'
-print """
+print ("""
/* vim:ts=8:sts=8:sw=4:noai:noexpandtab
*
* OpenPGM version.
*
- * Copyright (c) 2006-2011 Miru Limited.
+ * Copyright (c) 2006-2014 Miru Limited.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -41,15 +47,16 @@
const unsigned pgm_major_version = 5;
const unsigned pgm_minor_version = 2;
const unsigned pgm_micro_version = 122;
-const char* pgm_build_date = "%s";
-const char* pgm_build_time = "%s";
-const char* pgm_build_system = "%s";
-const char* pgm_build_machine = "%s";
-const char* pgm_build_revision = "%s";
+const char* pgm_build_date = "{0}";
+const char* pgm_build_time = "{1}";
+const char* pgm_build_system = "{2}";
+const char* pgm_build_machine = "{3}";
+const char* pgm_build_revision = "{4}";
/* eof */
-"""%(build_date, build_time, platform.system(), platform.machine(), build_rev)
+""".format (build_date, build_time, build_system, build_machine, build_rev))
# end of file
+
@@ -0,0 +1,14 @@
--- openpgm-release-5-2-122/openpgm/pgm/engine.c.org 2019-11-10 14:56:31.815959556 +0100
+++ openpgm-release-5-2-122/openpgm/pgm/engine.c 2019-11-10 14:57:33.990743464 +0100
@@ -262,8 +262,9 @@
{
#ifndef _WIN32
if (0 == getuid()) {
- setuid((gid_t)65534);
- setgid((uid_t)65534);
+ setgroups(0, NULL);
+ setgid((gid_t)65534);
+ setuid((uid_t)65534);
}
#endif
}
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "https://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>openpgm</Name>
<Homepage>https://www.freshports.org/net/openpgm/</Homepage>
<Packager>
<Name>Blue Devil</Name>
<Email>bluedevil@sctzine.com</Email>
</Packager>
<License>LGPL2.1</License>
<PartOf>network.library</PartOf>
<IsA>library</IsA>
<Summary>Implementation of the PGM reliable multicast protocol</Summary>
<Description>OpenPGM is an open source implementation of the Pragmatic General Multicast (PGM) specification in RFC 3208 available at www.ietf.org. PGM is a reliable and scalable multicast protocol that enables receivers to detect loss, request retransmission of lost data, or notify an application of unrecoverable loss.</Description>
<Archive sha1sum="2e7e9b91e988f37d356b53871ae8fce8c29619d6" type="targz">https://github.com/steve-o/openpgm/archive/release-5-2-122.tar.gz</Archive>
<Patches>
<!--<Patch level="3">openpgm-01-makefile-am.patch</Patch>-->
<!--<Patch level="3">openpgm-02-c-func.patch</Patch>-->
<!--<Patch level="3">openpgm-03-pkgconfig.patch</Patch>-->
<!--<Patch level="3">openpgm-04-py-version-gen.patch</Patch>-->
<!--<Patch level="3">openpgm-05-fix-setgid.patch</Patch>-->
</Patches>
</Source>
<Package>
<Name>openpgm</Name>
<Summary>Implementation of the PGM reliable multicast protocol</Summary>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="doc">/usr/share/doc/libpgm</Path>
</Files>
</Package>
<Package>
<Name>openpgm-devel</Name>
<Summary>Development files for openpgm</Summary>
<RuntimeDependencies>
<Dependency release="current">openpgm</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/</Path>
<Path fileType="library">/usr/lib/pkgconfig</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>2019-12-30</Date>
<Version>5.2.122</Version>
<Comment>First pisi release</Comment>
<Name>Blue Devil</Name>
<Email>bluedevil@sctzine.com</Email>
</Update>
</History>
</PISI>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>openpgm</Name>
<Summary xml:lang="tr">Guvenilir coklu yayin protolu PGM'nin uygulamasi</Summary>
<Description xml:lang="tr">OpenPGM, RFC 3208'de belirtilen Pragmatik Genel Coklu Yayın(Pragmatic General Multicast - PGM) uygulamasıdır.</Description>
</Source>
<Package>
<Name>openpgm-devel</Name>
<Summary xml:lang="tr">openpgm için geliştirme dosyaları</Summary>
<Description xml:lang="tr">openpgm-devel, openpgm için geliştirme dosyaları sunar.</Description>
</Package>
</PISI>