File: Makefile

package info (click to toggle)
netctl 1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 596 kB
  • sloc: sh: 814; makefile: 72
file content (65 lines) | stat: -rw-r--r-- 2,264 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export VERSION = 1.29

PKG_CONFIG ?= pkg-config

SHELL=/bin/bash

sd_var = $(shell $(PKG_CONFIG) --variable=systemd$(1) systemd)
systemdsystemconfdir = $(call sd_var,systemconfdir)
systemdsystemunitdir = $(call sd_var,systemunitdir)

.PHONY: install tarball pkgbuild upload clean

install:
	# Documentation
	$(MAKE) -C docs install
	# Configuration files
	install -d $(DESTDIR)/etc/netctl/{examples,hooks,interfaces}
	install -m644 docs/examples/* $(DESTDIR)/etc/netctl/examples/
	# Libs
	install -Dt $(DESTDIR)/usr/lib/netctl -m644 src/lib/{globals,interface,ip,rfkill,wpa}
	install -Dt $(DESTDIR)/usr/lib/netctl/connections -m644 src/lib/connections/*
	install -Dt $(DESTDIR)/usr/lib/netctl/dhcp -m644 src/lib/dhcp/*
	install -m755 src/lib/{auto.action,network} $(DESTDIR)/usr/lib/netctl/
	# Scripts
	install -d $(DESTDIR)/usr/bin
	sed -e "s|@systemdsystemconfdir@|$(systemdsystemconfdir)|g" \
	    -e "s|@systemdsystemunitdir@|$(systemdsystemunitdir)|g" \
	    src/netctl.in > $(DESTDIR)/usr/bin/netctl
	chmod 755 $(DESTDIR)/usr/bin/netctl
	install -m755 \
	    src/netctl-auto \
	    src/wifi-menu \
	    $(DESTDIR)/usr/bin/
	install -Dm755 src/ifplugd.action $(DESTDIR)/etc/ifplugd/netctl.action
	# Services
	install -Dt $(DESTDIR)$(systemdsystemunitdir) -m644 services/*.service

tarball: netctl-$(VERSION).tar.xz
netctl-$(VERSION).tar.xz:
	$(MAKE) -B -C docs
	cp src/lib/globals{,.orig}
	sed -i "s|NETCTL_VERSION=.*|NETCTL_VERSION=$(VERSION)|" src/lib/globals
	git stash save -q
	git archive -o netctl-$(VERSION).tar --prefix=netctl-$(VERSION)/ stash
	git stash pop -q
	mv src/lib/globals{.orig,}
	tar --exclude-vcs --transform "s|^|netctl-$(VERSION)/|" --owner=root --group=root --mtime=./netctl-$(VERSION).tar -rf netctl-$(VERSION).tar docs/*.[1-8]
	xz netctl-$(VERSION).tar
	gpg --detach-sign $@

pkgbuild: PKGBUILD
PKGBUILD: netctl-$(VERSION).tar.xz netctl.install contrib/PKGBUILD.in
	sed -e "s|@pkgver@|$(VERSION)|g" \
	    -e "s|@sha256sum@|$(shell sha256sum $< | cut -d ' ' -f 1)|" \
	    $(lastword $^) > $@

netctl.install: contrib/netctl.install
	cp $< $@

upload: netctl-$(VERSION).tar.xz
	scp $< $<.sig sources.archlinux.org:/srv/ftp/other/packages/netctl

clean:
	$(MAKE) -C docs clean
	-@rm -vf netctl-*.tar.xz{,.sig} PKGBUILD netctl.install