Fixes to rpm build specifically for OBS

This commit is contained in:
Luke D Jones
2020-08-23 21:30:31 +12:00
parent 8cee0e6735
commit b8c83a1a72
2 changed files with 12 additions and 8 deletions

View File

@@ -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)

View File

@@ -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 <<EOF