]> git.ipfire.org Git - people/stevee/network.git/blob - Makefile
aiccu: Introduce support for systemd and add aiccu-config-helper.
[people/stevee/network.git] / Makefile
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
22 PACKAGE_VERSION = 006
23
24 DESTDIR=
25
26 # Export HTML documents to this directory.
27 HTML_DOCS_DIR = html
28
29 prefix=/usr
30 bindir=$(prefix)/bin
31 sbindir=$(prefix)/sbin
32 libdir=$(prefix)/lib
33 datadir=$(prefix)/share
34 mandir=$(datadir)/man
35 sysconfdir=/etc
36 localstatedir=/var
37 systemdunitdir=$(prefix)/lib/systemd/system
38 tmpfilesdir=$(prefix)/lib/tmpfiles.d
39
40 # File to store the version number in.
41 VERSION_FILE = $(DESTDIR)$(libdir)/network/version
42
43 # A list of files which should be removed on "make clean"
44 CLEANFILES =
45
46 # man pages
47 MAN_PAGES = \
48 man/network.8 \
49 man/network-config.8 \
50 man/network-device.8 \
51 man/network-dns-server.8 \
52 man/network-port-batman-adv.8 \
53 man/network-port-batman-adv-port.8 \
54 man/network-route.8 \
55 man/network-zone.8 \
56 man/network-zone-6to4-tunnel.8 \
57 man/network-zone-bridge.8 \
58 man/network-zone-config-pppoe-server.8 \
59 man/network-zone-pppoe.8
60
61 MAN_PAGES_HTML = $(patsubst %.xml,%.html,$(MAN_PAGES_XML))
62 MAN_PAGES_XML = $(patsubst %.8,%.xml,$(MAN_PAGES))
63 MAN_PAGES_8 = $(filter %.8,$(MAN_PAGES))
64
65 CLEANFILES += \
66 $(MAN_PAGES) \
67 $(MAN_PAGES_HTML)
68
69 XSLTPROC = xsltproc
70
71 XSLTPROC_FLAGS = \
72 --nonet \
73 --stringparam man.output.quietly 1 \
74 --stringparam funcsynopsis.style ansi \
75 --stringparam man.th.extra1.suppress 1 \
76 --stringparam man.authors.section.enabled 1 \
77 --stringparam man.copyright.section.enabled 1
78
79 XSLTPROC_COMMAND_MAN = \
80 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
81 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
82
83 XSLTPROC_COMMAND_HTML = \
84 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) man/custom-html.xsl $<
85
86 man/%.8: man/%.xml
87 $(XSLTPROC_COMMAND_MAN)
88
89 man/%.html: man/%.xml man/custom-html.xsl
90 $(XSLTPROC_COMMAND_HTML)
91
92 .PHONY: all
93 all: $(MAN_PAGES)
94
95 .PHONY: install
96 install: $(MAN_PAGES)
97 -mkdir -pv $(DESTDIR)$(sysconfdir)/{network/{ports,zones},ppp}
98 -mkdir -pv $(DESTDIR)$(libdir)/{network,sysctl.d,udev}
99 -mkdir -pv $(DESTDIR)$(localstatedir)/log/network
100 -mkdir -pv $(DESTDIR)$(sbindir)
101 -mkdir -pv $(DESTDIR)$(systemdunitdir)
102 -mkdir -pv $(DESTDIR)$(tmpfilesdir)
103 -mkdir -pv $(DESTDIR)$(datadir)/firewall
104
105 install -m 755 -v firewall $(DESTDIR)$(sbindir)
106 install -m 755 -v network $(DESTDIR)$(sbindir)
107
108 cp -rfv {hooks,header*,functions*} $(DESTDIR)$(libdir)/network/
109 cp -fv sysctl.d/* $(DESTDIR)$(libdir)/sysctl.d/
110 cp -rfv udev/* $(DESTDIR)$(libdir)/udev
111 cp -rfv network-* $(DESTDIR)$(libdir)/network/
112 cp -vf systemd/*.service $(DESTDIR)$(systemdunitdir)
113 cp -vf network.tmpfiles $(DESTDIR)$(tmpfilesdir)/network.conf
114
115 # Install the helper tools.
116 -mkdir -pv $(DESTDIR)$(libdir)/network/helpers
117 cp -vf helpers/* $(DESTDIR)$(libdir)/network/helpers
118
119 # Install bridge-stp.
120 ln -svf --relative \
121 $(DESTDIR)$(libdir)/network/helpers/bridge-stp \
122 $(DESTDIR)$(sbindir)/
123
124 # Install dhclient script and helper.
125 install -m 755 dhclient-helper $(DESTDIR)$(libdir)/network/
126 install -m 755 dhclient-script $(DESTDIR)$(sbindir)/
127
128 install -m 755 -v ppp/ip-updown $(DESTDIR)$(sysconfdir)/ppp
129 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-pre-up
130 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-up
131 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ip-down
132 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-up
133 ln -svf ip-updown $(DESTDIR)$(sysconfdir)/ppp/ipv6-down
134 install -m 755 -v ppp/dialer $(DESTDIR)$(libdir)/network/
135
136 # Install pppoe-server wrapper.
137 install -m 755 ppp/pppoe-server $(DESTDIR)$(libdir)/network/
138
139 # Install the firewall macros.
140 cp -av macros $(DESTDIR)$(datadir)/firewall/
141
142 # Create the version file.
143 : > $(VERSION_FILE)
144 echo "# This file is automatically generated." >> $(VERSION_FILE)
145 echo "NETWORK_VERSION=$(PACKAGE_VERSION)" >> $(VERSION_FILE)
146
147 # Install man pages.
148 -mkdir -pv $(DESTDIR)$(mandir)/man8
149 install -v -m 644 $(MAN_PAGES_8) $(DESTDIR)$(mandir)/man8
150
151 .PHONY: clean
152 clean:
153 rm -f $(CLEANFILES)
154
155 dist:
156 git archive --format tar --prefix $(PACKAGE_NAME)-$(PACKAGE_VERSION)/ HEAD | gzip -9 > \
157 $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
158
159 .PHONY: export-html-docs
160 export-html-docs: $(MAN_PAGES_HTML)
161 mkdir -pv $(HTML_DOCS_DIR)
162 cp -vf $^ $(HTML_DOCS_DIR)