]>
Commit | Line | Data |
---|---|---|
bf41b85d MT |
1 | ############################################################################### |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2012-2013 IPFire Network Development Team # | |
5 | # # | |
6 | # This program is free software: you can redistribute it and/or modify # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation, either version 3 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # This program is distributed in the hope that it will be useful, # | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
18 | # # | |
19 | ############################################################################### | |
20 | ||
21 | PACKAGE_NAME = network | |
1fbaa96c | 22 | PACKAGE_VERSION = 006 |
aa574002 MT |
23 | |
24 | DESTDIR= | |
25 | ||
e7399160 MT |
26 | # Export HTML documents to this directory. |
27 | HTML_DOCS_DIR = html | |
28 | ||
120c0830 SS |
29 | prefix=/usr |
30 | bindir=$(prefix)/bin | |
31 | sbindir=$(prefix)/sbin | |
32 | libdir=$(prefix)/lib | |
afb7d704 | 33 | datadir=$(prefix)/share |
f8915761 | 34 | mandir=$(datadir)/man |
120c0830 SS |
35 | sysconfdir=/etc |
36 | localstatedir=/var | |
5bb2429a | 37 | systemdunitdir=$(prefix)/lib/systemd/system |
5529407b | 38 | tmpfilesdir=$(prefix)/lib/tmpfiles.d |
120c0830 | 39 | |
d9e4e1ab | 40 | # File to store the version number in. |
120c0830 | 41 | VERSION_FILE = $(DESTDIR)$(libdir)/network/version |
d9e4e1ab | 42 | |
a2a6f759 MT |
43 | # A list of files which should be removed on "make clean" |
44 | CLEANFILES = | |
45 | ||
46 | # man pages | |
47 | MAN_PAGES = \ | |
ef953be2 | 48 | man/firewall-config.8 \ |
a2a6f759 MT |
49 | man/network.8 \ |
50 | man/network-config.8 \ | |
51 | man/network-device.8 \ | |
52 | man/network-dns-server.8 \ | |
53 | man/network-port-batman-adv.8 \ | |
54 | man/network-port-batman-adv-port.8 \ | |
55 | man/network-route.8 \ | |
56 | man/network-zone.8 \ | |
1e00d198 | 57 | man/network-zone-6to4-tunnel.8 \ |
0107b433 | 58 | man/network-zone-aiccu.8 \ |
a2a6f759 MT |
59 | man/network-zone-bridge.8 \ |
60 | man/network-zone-config-pppoe-server.8 \ | |
61 | man/network-zone-pppoe.8 | |
62 | ||
63 | MAN_PAGES_HTML = $(patsubst %.xml,%.html,$(MAN_PAGES_XML)) | |
64 | MAN_PAGES_XML = $(patsubst %.8,%.xml,$(MAN_PAGES)) | |
f8915761 | 65 | MAN_PAGES_8 = $(filter %.8,$(MAN_PAGES)) |
a2a6f759 MT |
66 | |
67 | CLEANFILES += \ | |
68 | $(MAN_PAGES) \ | |
69 | $(MAN_PAGES_HTML) | |
70 | ||
71 | XSLTPROC = xsltproc | |
72 | ||
73 | XSLTPROC_FLAGS = \ | |
74 | --nonet \ | |
75 | --stringparam man.output.quietly 1 \ | |
76 | --stringparam funcsynopsis.style ansi \ | |
77 | --stringparam man.th.extra1.suppress 1 \ | |
78 | --stringparam man.authors.section.enabled 1 \ | |
79 | --stringparam man.copyright.section.enabled 1 | |
80 | ||
81 | XSLTPROC_COMMAND_MAN = \ | |
82 | $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \ | |
83 | http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< | |
84 | ||
85 | XSLTPROC_COMMAND_HTML = \ | |
86 | $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) man/custom-html.xsl $< | |
87 | ||
88 | man/%.8: man/%.xml | |
89 | $(XSLTPROC_COMMAND_MAN) | |
90 | ||
91 | man/%.html: man/%.xml man/custom-html.xsl | |
92 | $(XSLTPROC_COMMAND_HTML) | |
93 | ||
de28a630 | 94 | .PHONY: all |
a2a6f759 | 95 | all: $(MAN_PAGES) |
aa574002 | 96 | |
de28a630 | 97 | .PHONY: install |
f8915761 | 98 | install: $(MAN_PAGES) |
120c0830 SS |
99 | -mkdir -pv $(DESTDIR)$(sysconfdir)/{network/{ports,zones},ppp} |
100 | -mkdir -pv $(DESTDIR)$(libdir)/{network,sysctl.d,udev} | |
101 | -mkdir -pv $(DESTDIR)$(localstatedir)/log/network | |
102 | -mkdir -pv $(DESTDIR)$(sbindir) | |
5bb2429a | 103 | -mkdir -pv $(DESTDIR)$(systemdunitdir) |
5529407b | 104 | -mkdir -pv $(DESTDIR)$(tmpfilesdir) |
afb7d704 | 105 | -mkdir -pv $(DESTDIR)$(datadir)/firewall |
aa574002 | 106 | |
1206f44c | 107 | install -m 755 -v firewall-config $(DESTDIR)$(sbindir) |
fe52c5e0 MT |
108 | install -m 755 -v firewall6 $(DESTDIR)$(sbindir) |
109 | install -m 755 -v firewall4 $(DESTDIR)$(sbindir) | |
120c0830 | 110 | install -m 755 -v network $(DESTDIR)$(sbindir) |
aa574002 | 111 | |
120c0830 SS |
112 | cp -rfv {hooks,header*,functions*} $(DESTDIR)$(libdir)/network/ |
113 | cp -fv sysctl.d/* $(DESTDIR)$(libdir)/sysctl.d/ | |
114 | cp -rfv udev/* $(DESTDIR)$(libdir)/udev | |
115 | cp -rfv network-* $(DESTDIR)$(libdir)/network/ | |
5bb2429a | 116 | cp -vf systemd/*.service $(DESTDIR)$(systemdunitdir) |
5529407b | 117 | cp -vf network.tmpfiles $(DESTDIR)$(tmpfilesdir)/network.conf |
aa574002 | 118 | |
28f0b4ab MT |
119 | # Install the helper tools. |
120 | -mkdir -pv $(DESTDIR)$(libdir)/network/helpers | |
121 | cp -vf helpers/* $(DESTDIR)$(libdir)/network/helpers | |
122 | ||
ca79d92e MT |
123 | # Install bridge-stp. |
124 | ln -svf --relative \ | |
125 | $(DESTDIR)$(libdir)/network/helpers/bridge-stp \ | |
126 | $(DESTDIR)$(sbindir)/ | |
30812a00 | 127 | |
e9ea243e | 128 | # Install dhclient script and helper. |
5bb2429a MT |
129 | install -m 755 dhclient-helper $(DESTDIR)$(libdir)/network/ |
130 | install -m 755 dhclient-script $(DESTDIR)$(sbindir)/ | |
e9ea243e | 131 | |
120c0830 SS |
132 | install -m 755 -v ppp/ip-updown $(DESTDIR)$(sysconfdir)/ppp |
133 | ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-pre-up | |
134 | ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-up | |
135 | ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-down | |
ef620c07 MT |
136 | ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-up |
137 | ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-down | |
6c74a64c | 138 | install -m 755 -v ppp/dialer $(DESTDIR)$(libdir)/network/ |
aa574002 | 139 | |
999d659b MT |
140 | # Install pppoe-server wrapper. |
141 | install -m 755 ppp/pppoe-server $(DESTDIR)$(libdir)/network/ | |
142 | ||
afb7d704 MT |
143 | # Install the firewall macros. |
144 | cp -av macros $(DESTDIR)$(datadir)/firewall/ | |
145 | ||
d9e4e1ab | 146 | # Create the version file. |
ef620c07 MT |
147 | : > $(VERSION_FILE) |
148 | echo "# This file is automatically generated." >> $(VERSION_FILE) | |
de28a630 MT |
149 | echo "NETWORK_VERSION=$(PACKAGE_VERSION)" >> $(VERSION_FILE) |
150 | ||
f8915761 MT |
151 | # Install man pages. |
152 | -mkdir -pv $(DESTDIR)$(mandir)/man8 | |
153 | install -v -m 644 $(MAN_PAGES_8) $(DESTDIR)$(mandir)/man8 | |
154 | ||
a2a6f759 MT |
155 | .PHONY: clean |
156 | clean: | |
157 | rm -f $(CLEANFILES) | |
d9e4e1ab | 158 | |
aa574002 | 159 | dist: |
de28a630 MT |
160 | git archive --format tar --prefix $(PACKAGE_NAME)-$(PACKAGE_VERSION)/ HEAD | gzip -9 > \ |
161 | $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz | |
a2a6f759 MT |
162 | |
163 | .PHONY: export-html-docs | |
164 | export-html-docs: $(MAN_PAGES_HTML) | |
e7399160 MT |
165 | mkdir -pv $(HTML_DOCS_DIR) |
166 | cp -vf $^ $(HTML_DOCS_DIR) |