-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·40 lines (31 loc) · 1.76 KB
/
build.sh
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
#! /bin/bash
set -e
wget -O latest-release "https://api.github.com/repos/openrazer/openrazer/releases/latest"
wget -O - $(jq -r '.tarball_url' latest-release) | tar -xzvf - --strip-component=1 -C src
mkdir tmp/openrazer-kmod
cp src/driver/* tmp/openrazer-kmod
tar -czvf rpmbuild/SOURCES/openrazer-kmod.tar.gz -C tmp openrazer-kmod
mkdir tmp/openrazer
cp src/install_files/udev/* src/LICENSES/* src/README.md tmp/openrazer
tar -czvf rpmbuild/SOURCES/openrazer.tar.gz -C tmp openrazer
mkdir tmp/openrazer-daemon
cp -r src/daemon/* tmp/openrazer-daemon
rm tmp/openrazer-daemon/Makefile
rm -r tmp/openrazer-daemon/tests
sed -i "s|##PREFIX##|/usr|" tmp/openrazer-daemon/resources/org.razer.service.in \
tmp/openrazer-daemon/resources/openrazer-daemon.systemd.service.in
mv tmp/openrazer-daemon/resources/org.razer.service.in tmp/openrazer-daemon/resources/org.razer.service
mv tmp/openrazer-daemon/resources/openrazer-daemon.systemd.service.in tmp/openrazer-daemon/resources/openrazer-daemon.service
tar -czvf rpmbuild/SOURCES/openrazer-daemon.tar.gz -C tmp openrazer-daemon
mkdir tmp/python-openrazer
cp -r src/pylib/* tmp/python-openrazer
rm -r tmp/python-openrazer/tests
tar -czvf rpmbuild/SOURCES/python-openrazer.tar.gz -C tmp python-openrazer
sed -i "s/OPENRAZER_VERSION/$(jq -r '.tag_name' latest-release | cut -c2-)/" rpmbuild/SPECS/*
sed -i "s/RELEASE_VERSION/${RELEASE_VERSION:-1}/" rpmbuild/SPECS/*
rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" rpmbuild/SPECS/openrazer-kmod.spec
rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" rpmbuild/SPECS/openrazer.spec
rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" rpmbuild/SPECS/openrazer-daemon.spec
rpmbuild -ba --define "_topdir ${PWD}/rpmbuild" rpmbuild/SPECS/python-openrazer.spec
rm -vf out/*.rpm
cp -v rpmbuild/RPMS/**/*.rpm out/