Skip to content

Commit

Permalink
Update Makefile and add a short-term fix for gcc10
Browse files Browse the repository at this point in the history
  • Loading branch information
fepitre committed Apr 6, 2020
1 parent e377ae2 commit a207be8
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 70 deletions.
93 changes: 26 additions & 67 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,77 +1,36 @@
#
# Common Makefile for building RPMs
#
DIST ?= fc32
VERSION := $(shell cat version)
REL := $(shell cat rel)

WORKDIR := $(CURDIR)
SPECDIR ?= $(WORKDIR)
SRCRPMDIR ?= $(WORKDIR)/../srpm
BUILDDIR ?= $(WORKDIR)
RPMDIR ?= $(WORKDIR)/../rpm
SOURCEDIR := $(WORKDIR)
FEDORA_SOURCES := https://src.fedoraproject.org/rpms/awesome/raw/f$(subst fc,,$(DIST))/f/sources
SRC_FILE := awesome-$(VERSION).tar.xz

SPECFILE = awesome.spec
BUILDER_DIR ?= ../..
SRC_DIR ?= qubes-src

RPM_DEFINES := --define "_sourcedir $(SOURCEDIR)" \
--define "_specdir $(SPECDIR)" \
--define "_builddir $(BUILDDIR)" \
--define "_srcrpmdir $(SRCRPMDIR)" \
--define "_rpmdir $(RPMDIR)"
DISTFILES_MIRROR ?= https://raw.githubusercontent.com/awesomeWM/awesome-releases/master/
UNTRUSTED_SUFF := .UNTRUSTED
FETCH_CMD := wget --no-use-server-timestamps -q -O

DIST_DOM0 ?= fc20
SHELL := /bin/bash

VER_REL := $(shell rpm $(RPM_DEFINES) -q --qf "%{VERSION}-%{RELEASE}\n" --specfile $(SPECFILE)| head -1|sed -e 's/fc../$(DIST_DOM0)/')
NAME := $(shell rpm $(RPM_DEFINES) -q --qf "%{NAME}\n" --specfile $(SPECFILE)| head -1)

URL := $(shell spectool $(RPM_DEFINES) --list-files --source 0 $(SPECFILE) 2> /dev/null| cut -d ' ' -f 2- )
ifndef SRC_FILE
ifdef URL
SRC_FILE := $(notdir $(URL))
endif
endif
%: %.sha512
@$(FETCH_CMD) $@$(UNTRUSTED_SUFF) $(DISTFILES_MIRROR)$@
@sha512sum --status -c <(printf "$$(cat $<) -\n") <$@$(UNTRUSTED_SUFF) || \
{ echo "Wrong SHA512 checksum on $@$(UNTRUSTED_SUFF)!"; exit 1; }
@mv $@$(UNTRUSTED_SUFF) $@

.PHONY: get-sources
get-sources: $(SRC_FILE)

$(SRC_FILE):
ifneq ($(SRC_FILE), None)
@wget -q $(URL)
endif

.PHONY: verify-sources

verify-sources:
ifneq ($(SRC_FILE), None)
@sha256sum --quiet -c sources
endif

.PHONY: clean-sources
clean-sources:
ifneq ($(SRC_FILE), None)
-rm $(SRC_FILE)
endif

rpms: rpms-dom0

rpms-vm:

rpms-dom0:
rpmbuild $(RPM_DEFINES) -bb $(SPECFILE)
# rpm --addsign $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm

srpms:
rpmbuild $(RPM_DEFINES) -bs $(SPECFILE)
# rpm --addsign $(SRCRPMDIR)/$(NAME)*$(VER_REL)*.rpm

update-repo-current:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/current/dom0/rpm/

update-repo-current-testing:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/current-testing/dom0/rpm/

update-repo-unstable:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/unstable/dom0/rpm/

update-repo-installer:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../installer/yum/qubes-dom0/rpm/

clean:

@true

# This target is generating content locally from upstream project
# 'sources' file. Sanitization is done but it is encouraged to perform
# update of component in non-sensitive environnements to prevent
# any possible local destructions due to shell rendering
.PHONY: update-sources
update-sources:
@$(BUILDER_DIR)/$(SRC_DIR)/builder-rpm/scripts/generate-hashes-from-sources $(FEDORA_SOURCES)
4 changes: 2 additions & 2 deletions Makefile.builder
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ifeq ($(PACKAGE_SET),dom0)
RPM_SPEC_FILES := awesome.spec
endif

NO_ARCHIVE := 1
1 change: 1 addition & 0 deletions awesome-3.5.9.tar.xz.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6a4c679b293e8cd85d1f7e13f6dea704cbb267e42b9260496a54b657a66d6148aae51521d802d61baaeb23df0d4a8ad0b28d9dc922ea5da2a347b4251cce5e25
3 changes: 3 additions & 0 deletions awesome.spec → awesome.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Patch100: awesome-3.5.5-qubes-prefix.patch
Patch110: awesome-3.5.5-qubes.patch
Patch120: awesome-3.5.5-dex-autostart.patch

# short-term fix for FTBFS with GCC10
%define _legacy_common_support 1

BuildRequires: cmake >= 3.0.0

BuildRequires: ImageMagick
Expand Down
1 change: 1 addition & 0 deletions rel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 0 additions & 1 deletion sources

This file was deleted.

1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.5.9

0 comments on commit a207be8

Please sign in to comment.