]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg: reorganize for multiplatform wg-quick
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 14 May 2018 16:14:55 +0000 (18:14 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 14 May 2018 16:18:40 +0000 (18:18 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/Makefile
src/man/wg-quick.8 [moved from src/wg-quick.8 with 100% similarity]
src/man/wg.8 [moved from src/wg.8 with 100% similarity]
src/systemd/wg-quick@.service [moved from src/wg-quick@.service with 73% similarity]
src/wg-quick/linux.bash [moved from src/wg-quick.bash with 100% similarity]

index 72296aa5c1d9ba005e954d626a7cf48291776ead..241293fda53ac55a71445d1eb8f9d750497be44a 100644 (file)
@@ -35,6 +35,8 @@ WITH_SYSTEMDUNITS := yes
 endif
 endif
 
+PLATFORM ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
+
 CFLAGS ?= -O3
 CFLAGS += -std=gnu11 -D_GNU_SOURCE
 CFLAGS += -Wall -Wextra
@@ -43,7 +45,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\""
 ifeq ($(DEBUG_TOOLS),y)
 CFLAGS += -g
 endif
-ifeq ($(shell uname -s),Linux)
+ifeq ($(PLATFORM),linux)
 LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null)
 LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
 CFLAGS += $(LIBMNL_CFLAGS)
@@ -72,17 +74,17 @@ endif
 
 install: wg
        @install -v -d "$(DESTDIR)$(BINDIR)" && install -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg"
-       @install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
+       @install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v man/wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
        @[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
        install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -m 0644 -v completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg"
        @[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
-       install -m 0755 -v wg-quick.bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -m 0700 -v -d "$(DESTDIR)$(SYSCONFDIR)/wireguard"
+       install -m 0755 -v wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -m 0700 -v -d "$(DESTDIR)$(SYSCONFDIR)/wireguard"
        @[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
-       install -m 0644 -v wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8"
+       install -m 0644 -v man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8"
        @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
        install -m 0644 -v completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg-quick"
        @[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \
-       install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -m 0644 -v wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/wg-quick@.service"
+       install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -m 0644 -v systemd/wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/wg-quick@.service"
 
 help:
        @cat INSTALL
similarity index 100%
rename from src/wg-quick.8
rename to src/man/wg-quick.8
similarity index 100%
rename from src/wg.8
rename to src/man/wg.8
similarity index 73%
rename from src/wg-quick@.service
rename to src/systemd/wg-quick@.service
index ce6d70a329a32efe55c8495e14a269b0be3bc863..da5d7872ffb79b482a6955de6615ee23ce26626f 100644 (file)
@@ -6,8 +6,8 @@ Documentation=man:wg-quick(8)
 Documentation=man:wg(8)
 Documentation=https://www.wireguard.com/
 Documentation=https://www.wireguard.com/quickstart/
-Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8
-Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/wg.8
+Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8
+Documentation=https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8
 
 [Service]
 Type=oneshot
similarity index 100%
rename from src/wg-quick.bash
rename to src/wg-quick/linux.bash