This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (48 loc) · 1.53 KB
/
Makefile
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
PKG_NAME := yups
AUR_PATH := ~/kode/aur_packages
VERSION := $(shell cat VERSION)
ARCHIVE := $(PKG_NAME)-$(VERSION).tar.gz
.PHONY: all install release version_sync
define archive_ok
@echo "Archive ok?"; \
read HVAD;
endef
define pkgbuild_ok
@echo "PKGBUILD ok?"; \
read HVAD;
endef
define check_aur_push
@echo "Push to ssh://aur@aur.archlinux.org/$(PKG_NAME).git?"; \
read HVAD;
endef
version_sync:
sed -i -e "s/^version=.*/version=$(VERSION)/" yups
sed -i -e "s/^version=.*/version=$(VERSION)/" yups-query
sed -i -e "s/^Latest Release .*/Latest Release $(VERSION)/" README.md
sed -i -e "s/^pkgver=.*/pkgver=$(VERSION)/" PKGBUILD
clean:
rm -rf src/
rm -rf pkg/
release: clean version_sync
git commit -am 'Release $(VERSION)'
git tag $(VERSION)
git archive --format=tar.gz -o $(ARCHIVE) --prefix yups-$(VERSION)/ HEAD
git push origin $(VERSION)
git archive --format=zip -o $(PKG_NAME)-$(VERSION).zip --prefix yups-$(VERSION)/ HEAD
sed -i -e "s/^sha256sums=.*/sha256sums=('`sha256sum $(ARCHIVE) | cut -d' ' -f1`')/" PKGBUILD
makepkg
namcap PKGBUILD
$(call pkgbuild_ok)
git commit -am 'Update PKGBUILD'
git push origin main
cp PKGBUILD $(AUR_PATH)/$(PKG_NAME)/PKGBUILD
updpkgsums
makepkg --printsrcinfo > .SRCINFO
mv .SRCINFO $(AUR_PATH)/$(PKG_NAME)/.SRCINFO
cd $(AUR_PATH)/$(PKG_NAME) && makepkg -ci && git commit -am 'Release $(VERSION)' && namcap $(ARCHIVE)
$(call archive_ok)
$(call check_aur_push)
# git push origin master
install:
install -m755 yups /usr/local/bin/
install -m755 yups-query /usr/local/bin/