59 lines
1.4 KiB
Makefile
59 lines
1.4 KiB
Makefile
# Makefile for gitea
|
|
# Downloads pre-built binary and stages files for packaging
|
|
# Author: Ruben Carlo Benante <rcb@beco.cc>
|
|
# License: GNU GPL v3
|
|
|
|
.PHONY: all clean gitea data doc install
|
|
|
|
# Variables
|
|
VERSION = $(shell cut -d" " -f2 VERSION)
|
|
DESTDIR ?= /tmp/SBo/package-gitea
|
|
ARCH ?= $(shell uname -m)
|
|
|
|
# Map Slackware arch to gitea arch
|
|
ifeq ($(ARCH),x86_64)
|
|
GITEA_ARCH = amd64
|
|
else
|
|
GITEA_ARCH = 386
|
|
endif
|
|
|
|
GITEA_XZ = gitea-$(VERSION)-linux-$(GITEA_ARCH).xz
|
|
DOWNLOAD_URL = https://dl.gitea.com/gitea/$(VERSION)/$(GITEA_XZ)
|
|
|
|
SHELL = /bin/bash
|
|
|
|
# make all
|
|
all: gitea data doc
|
|
|
|
# Download gitea binary, verify sha256, decompress
|
|
gitea:
|
|
mkdir -p build
|
|
wget -O build/$(GITEA_XZ) $(DOWNLOAD_URL)
|
|
wget -O build/$(GITEA_XZ).sha256 $(DOWNLOAD_URL).sha256
|
|
cd build && sha256sum -c $(GITEA_XZ).sha256 || { echo "SHA256 checksum failed"; rm -f $(GITEA_XZ) $(GITEA_XZ).sha256; exit 1; }
|
|
xz -d build/$(GITEA_XZ)
|
|
mv build/gitea-$(VERSION)-linux-$(GITEA_ARCH) build/gitea
|
|
chmod 0755 build/gitea
|
|
rm -f build/$(GITEA_XZ).sha256
|
|
|
|
# Copy configuration and data files to build/
|
|
data:
|
|
mkdir -p build
|
|
cp app.ini.new build/app.ini.new
|
|
cp rc.gitea.new build/rc.gitea.new
|
|
touch build/.gitkeep
|
|
|
|
# Copy docs to build/
|
|
doc:
|
|
mkdir -p build
|
|
cp VERSION build/VERSION
|
|
cp COPYING build/COPYING
|
|
|
|
# Install gitea using MakeInstall
|
|
install:
|
|
cd .. ; make -f gitea-src/MakeInstall DESTDIR=$(DESTDIR)
|
|
|
|
# Clean build directory
|
|
clean:
|
|
rm -rf build/*
|