Browse Source

iana-etc: add new package

tags/milky-way/v0.3
André Silva 1 year ago
parent
commit
8d3088ef6d
2 changed files with 74 additions and 0 deletions
  1. +56
    -0
      iana-etc/PKGBUILD
  2. +18
    -0
      iana-etc/public-domain.txt

+ 56
- 0
iana-etc/PKGBUILD View File

@@ -0,0 +1,56 @@
# Contributor (Arch): Thomas Bächler <thomas@archlinux.org>
# Maintainer (Arch): Gaetan Bisson <bisson@archlinux.org>
# Maintainer: André Silva <emulatorman@hyperbola.info>

pkgname=iana-etc
pkgver=20190117
pkgrel=1.hyperbola1
pkgdesc='/etc/protocols and /etc/services provided by IANA'
url='https://www.iana.org/protocols'
arch=('any')
license=('Public-Domain')
backup=('etc/'{protocols,services})
source=('https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml'
'https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml'
'public-domain.txt')
sha512sums=('a55cdb636608ac991c2959052c4dcc69c98fd900034d2c05667a28f1d851b9a64bdc1c89a905e2044f0b62c52a12dddf01736316020bbab876f5c2bb67135230'
'2d3279bd718a3b62d8550dab3079a901e3e20d3b239746fe7dd9675d887aa3aeb53ddf17fe6818c434104574895332df9ed3a0a99b2ff73e388991fcdbf757cc'
'bbdb7d33e444e1f3e34d5f1c73414da3a492fee797eae80e8868d82faed02e42198e1dcea807ed1c279b47bb5a6efd2cf2ce4f4c67254eb7a7dde782d3d51d11')

package() {
cd "${srcdir}"
install -d "${pkgdir}/etc"
install -Dm644 public-domain.txt "${pkgdir}/usr/share/licenses/iana-etc/public-domain.txt"
install -Dm644 protocol-numbers.xml "${pkgdir}/usr/share/iana-etc/protocol-numbers.iana"
install -Dm644 service-names-port-numbers.xml "${pkgdir}/usr/share/iana-etc/port-numbers.iana"

gawk '
BEGIN {
print "# Full data: /usr/share/iana-etc/protocol-numbers.iana\n"
FS="[<>]"
}

{
if (/<record/) { v=n=0 }
if (/<value/) v=$3
if (/<name/ && !($3~/ /)) n=$3
if (/<\/record/ && (v || n=="HOPOPT") && n) printf "%-12s %3i %s\n", tolower(n),v,n
}
' protocol-numbers.xml > "${pkgdir}/etc/protocols"

gawk '
BEGIN {
print "# Full data: /usr/share/iana-etc/port-numbers.iana\n"
FS="[<>]"
}

{
if (/<record/) { n=u=p=c=0 }
if (/<name/ && !/\(/) n=$3
if (/<number/) u=$3
if (/<protocol/) p=$3
if (/Unassigned/ || /Reserved/ || /historic/) c=1
if (/<\/record/ && n && u && p && !c) printf "%-15s %5i/%s\n", n,u,p
}' service-names-port-numbers.xml > "${pkgdir}/etc/services"

}

+ 18
- 0
iana-etc/public-domain.txt View File

@@ -0,0 +1,18 @@
Being in the public domain is not a license; rather, it means the
material is not copyrighted and no license is needed. Practically
speaking, though, if a work is in the public domain, it might as well
have an all-permissive non-copyleft free software license. Public
domain material is compatible with the GNU GPL.

If you want to release your work to the public domain, we encourage
you to use formal tools to do so. We ask people who make small
contributions to GNU to sign a disclaimer form; that's one
solution. If you're working on a project that doesn't have formal
contribution policies like that, CC0 is a good tool that anyone can
use. It formally dedicates your work to the public domain, and
provides a fallback license for cases where that is not legally
possible.

http://directory.fsf.org/wiki/License:CC0

Source: http://www.gnu.org/licenses/license-list.html#PublicDomain

Loading…
Cancel
Save