From b8c83a1a7200b984909516f5f86acd0ba9756bda Mon Sep 17 00:00:00 2001 From: Luke D Jones Date: Sun, 23 Aug 2020 21:30:31 +1200 Subject: [PATCH] Fixes to rpm build specifically for OBS --- Makefile | 8 ++++++-- asus-nb-ctrl.spec | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cd83746e..c1c12fa6 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ SRC = Cargo.toml Cargo.lock Makefile $(shell find -type f -wholename '**/src/*.r BIN_C=asusctl BIN_D=asusd LEDCONFIG=asusd-ledmodes.toml +VERSION:=$(shell grep -P 'version = "(\d.\d.\d)"' asus-nb-ctrl/Cargo.toml | cut -d'"' -f2) DEBUG ?= 0 ifeq ($(DEBUG),0) @@ -56,11 +57,14 @@ vendor: mkdir -p .cargo cargo vendor | head -n -1 > .cargo/config echo 'directory = "vendor"' >> .cargo/config - tar pcfJ vendor.tar.xz vendor + mv .cargo/config ./cargo-config + rm -rf .cargo + tar pcfJ vendor-$(VERSION).tar.xz vendor rm -rf vendor target/release/$(BIN_D): $(SRC) ifeq ($(VENDORED),1) - tar pxf vendor.tar.xz + @echo "version = $(VERSION)" + tar pxf vendor-$(VERSION).tar.xz endif cargo build $(ARGS) diff --git a/asus-nb-ctrl.spec b/asus-nb-ctrl.spec index b74bba00..5a6b6956 100644 --- a/asus-nb-ctrl.spec +++ b/asus-nb-ctrl.spec @@ -5,13 +5,13 @@ # Use hardening ldflags. %global rustflags -Clink-arg=-Wl,-z,relro,-z,now Name: asus-nb-ctrl -Version: 1.0.0 +Version: 1.0.2 Release: 0 -Summary: Text editor for terminal +Summary: ASUS Notebook control License: MPLv2 -Group: Productivity/Text/Editors +Group: System Environment/Daemons URL: https://gitlab.com/asus-linux/asus-nb-ctrl -Source: %{name}-%{version}.tar.gz +Source: https://gitlab.com/asus-linux/asus-nb-ctrl/-/archive/%version/%{name}-%{version}.tar.gz # cargo vendor && # tar cfJ vendor.tar.xz vendor Source1: vendor.tar.xz @@ -26,8 +26,8 @@ BuildRequires: pkgconfig(libudev) ASUS Laptop control %prep -%setup -q -n %name-next -%setup -q -n %name-next -D -T -a 1 +%setup -q +%setup -q -D -T -a 1 mkdir .cargo cat >.cargo/config <