recipes: xorg/mesa: upgraded to version 18.3.2
[dragora.git] / recipes / networking / iptables / recipe
blob662b77f45e8853c9554498f55e7913b11772fa96
1 # Build recipe for iptables.
3 # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=iptables
18 version=1.6.2
19 release=2
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/networking"
24 tarname=${program}-${version}.tar.bz2
26 # Remote source(s)
27 fetch=http://www.netfilter.org/projects/iptables/files/$tarname
29 description="
30 The main firewall program in GNU/Linux.
32 iptables is the userspace command line program used to configure the
33 Linux 2.4.x and later packet filtering ruleset.  It is targeted towards
34 system administrators.
36 Since Network Address Translation is also configured from the packet
37 filter ruleset, iptables is used for this, too.
39 The iptables package also includes ip6tables. ip6tables is used for
40 configuring the IPv6 packet filter.
43 homepage=http://www.netfilter.org/projects/iptables/index.html
44 license="GPLv2 only"
46 # Source documentation
47 docs="COMMIT_NOTES COPYING INCOMPATIBILITIES"
48 docsdir="${docdir}/${program}-${version}"
50 build()
52     set -e
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     # A patch from Alpine Linux adding definitions for Musl
62     patch -p1 < "${worktree}/patches/iptables/iptables-1.6.0-musl-fixes.patch"
64     ./configure CFLAGS="$QICFLAGS -D_GNU_SOURCE" LDFLAGS="$QILDFLAGS" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --docdir=$docsdir \
68      --mandir=$mandir \
69      --enable-devel \
70      --enable-libipq \
71      --enable-bpf-compiler \
72      --enable-nfsynproxy \
73      --without-kernel \
74      --build="$(cc -dumpmachine)"
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install
79     # Manage dot new config file
80     touch "${destdir}/etc/.graft-config"
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 '{}' +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi
96     # Copy documentation
97     mkdir -p "${destdir}${docsdir}"
99     for file in $docs
100     do
101         cp -p $file "${destdir}${docsdir}"
102     done