forked from systemofapwne/leetmouse
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathpkg.mk
More file actions
45 lines (33 loc) · 1.2 KB
/
Copy pathpkg.mk
File metadata and controls
45 lines (33 loc) · 1.2 KB
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
.ONESHELL: # shell-like behaviour. Reference global variables via ${varname} and local make variables via $${varname}
SHELL := /bin/bash
ROOT=$(shell pwd)/
PKG=${ROOT}/pkg/
BUILD=${PKG}/build
include version.mk
VERSION?=$(YEETMOUSE_VERSION)
PKG_NAME=yeetmouse-${VERSION}
SRC_NAME=${PKG_NAME}.tar.xz
pkg_clean:
@rm -rf ${BUILD}/*
# Prepare a clean source package (for releases on github or for pkg creation)
pkg_release:
@
mkdir -p ${BUILD}
tar --exclude-vcs --exclude-vcs-ignores --transform='s,^,${PKG_NAME}/,' -cJf ${BUILD}/${SRC_NAME} -C "${ROOT}" .
# Arch package
pkg_arch: pkg_release
@
mkdir -p ${BUILD}/arch
ln -fs ../${SRC_NAME} ${BUILD}/arch/${SRC_NAME}
# Generate PKGBUILD for Arch based systems
HASH=$(shell sha256sum "${BUILD}/${SRC_NAME}" | awk '{ print $$1 }')
cp -f "${PKG}/arch/PKGBUILD.template" "${BUILD}/arch/PKGBUILD"
sed -i 's|'__VERSION__'|'${VERSION}'|' "${BUILD}/arch/PKGBUILD"
sed -i 's|'__SRC__'|'${SRC_NAME}'|' "${BUILD}/arch/PKGBUILD"
sed -i 's|'__HASH__'|'$${HASH}'|' "${BUILD}/arch/PKGBUILD"
# Copy .install files
cp -f ${PKG}/arch/*.install "${BUILD}/arch/"
# And finally build the package
makepkg -f -D ${BUILD}/arch/
# TBD: Debian package
# pkg_deb: pkg_release