| 1 |
export VERSION = 1.29 |
| 2 |
|
| 3 |
PKG_CONFIG ?= pkg-config |
| 4 |
|
| 5 |
SHELL=/bin/bash |
| 6 |
|
| 7 |
sd_var = $(shell $(PKG_CONFIG) --variable=systemd$(1) systemd) |
| 8 |
systemdsystemconfdir = $(call sd_var,systemconfdir) |
| 9 |
systemdsystemunitdir = $(call sd_var,systemunitdir) |
| 10 |
|
| 11 |
.PHONY: install tarball pkgbuild upload clean |
| 12 |
|
| 13 |
install: |
| 14 |
# Documentation |
| 15 |
$(MAKE) -C docs install |
| 16 |
# Configuration files |
| 17 |
install -d $(DESTDIR)/etc/netctl/{examples,hooks,interfaces} |
| 18 |
install -m644 docs/examples/* $(DESTDIR)/etc/netctl/examples/ |
| 19 |
# Libs |
| 20 |
install -Dt $(DESTDIR)/usr/lib/netctl -m644 src/lib/{globals,interface,ip,rfkill,wpa} |
| 21 |
install -Dt $(DESTDIR)/usr/lib/netctl/connections -m644 src/lib/connections/* |
| 22 |
install -Dt $(DESTDIR)/usr/lib/netctl/dhcp -m644 src/lib/dhcp/* |
| 23 |
install -m755 src/lib/{auto.action,network} $(DESTDIR)/usr/lib/netctl/ |
| 24 |
# Scripts |
| 25 |
install -d $(DESTDIR)/usr/bin |
| 26 |
sed -e "s|@systemdsystemconfdir@|$(systemdsystemconfdir)|g" \ |
| 27 |
-e "s|@systemdsystemunitdir@|$(systemdsystemunitdir)|g" \ |
| 28 |
src/netctl.in > $(DESTDIR)/usr/bin/netctl |
| 29 |
chmod 755 $(DESTDIR)/usr/bin/netctl |
| 30 |
install -m755 \ |
| 31 |
src/netctl-auto \ |
| 32 |
src/wifi-menu \ |
| 33 |
$(DESTDIR)/usr/bin/ |
| 34 |
install -Dm755 src/ifplugd.action $(DESTDIR)/etc/ifplugd/netctl.action |
| 35 |
# Services |
| 36 |
install -Dt $(DESTDIR)$(systemdsystemunitdir) -m644 services/*.service |
| 37 |
|
| 38 |
tarball: netctl-$(VERSION).tar.xz |
| 39 |
netctl-$(VERSION).tar.xz: |
| 40 |
$(MAKE) -B -C docs |
| 41 |
cp src/lib/globals{,.orig} |
| 42 |
sed -i "s|NETCTL_VERSION=.*|NETCTL_VERSION=$(VERSION)|" src/lib/globals |
| 43 |
git stash save -q |
| 44 |
git archive -o netctl-$(VERSION).tar --prefix=netctl-$(VERSION)/ stash |
| 45 |
git stash pop -q |
| 46 |
mv src/lib/globals{.orig,} |
| 47 |
tar --exclude-vcs --transform "s|^|netctl-$(VERSION)/|" --owner=root --group=root --mtime=./netctl-$(VERSION).tar -rf netctl-$(VERSION).tar docs/*.[1-8] |
| 48 |
xz netctl-$(VERSION).tar |
| 49 |
gpg --detach-sign $@ |
| 50 |
|
| 51 |
pkgbuild: PKGBUILD |
| 52 |
PKGBUILD: netctl-$(VERSION).tar.xz netctl.install contrib/PKGBUILD.in |
| 53 |
sed -e "s|@pkgver@|$(VERSION)|g" \ |
| 54 |
-e "s|@sha256sum@|$(shell sha256sum $< | cut -d ' ' -f 1)|" \ |
| 55 |
$(lastword $^) > $@ |
| 56 |
|
| 57 |
netctl.install: contrib/netctl.install |
| 58 |
cp $< $@ |
| 59 |
|
| 60 |
upload: netctl-$(VERSION).tar.xz |
| 61 |
scp $< $<.sig sources.archlinux.org:/srv/ftp/other/packages/netctl |
| 62 |
|
| 63 |
clean: |
| 64 |
$(MAKE) -C docs clean |
| 65 |
-@rm -vf netctl-*.tar.xz{,.sig} PKGBUILD netctl.install |