-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_fedora_package.sh
executable file
·71 lines (61 loc) · 1.81 KB
/
build_fedora_package.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
set -e
set -x
. /etc/os-release
rm -rf qmk
# Build the virtualenv
mkdir -p qmk/etc/yum.repos.d qmk/usr/bin qmk/usr/lib/udev/rules.d qmk/usr/share/python
python3 -m venv qmk/usr/share/python/qmk
qmk/usr/share/python/qmk/bin/pip install qmk
# Extract the version
QMK_VERSION=$(qmk/usr/share/python/qmk/bin/qmk --version)
# Make the virtualenv work in the final location
virtualenv-tools --update-path /usr/share/python/qmk qmk/usr/share/python/qmk
ln -s ../share/python/qmk/bin/qmk qmk/usr/bin/qmk
# Install the qmk_udev package
git clone https://github.com/qmk/qmk_udev.git
cd qmk_udev
make DESTDIR=../qmk PREFIX=/usr install
cd ..
# Copy in some other files
sed "s,%VERSION_ID%,${VERSION_ID}," qmk.fedora.repo > qmk/etc/yum.repos.d/qmk-fedora-${VERSION_ID}.repo
# Build the fedora package
cd qmk
fpm \
--input-type dir \
--name qmk \
--version "${QMK_VERSION}" \
--description "Quantum Mechanical Keyboard (QMK) Firmware.
QMK is an open source keyboard firmware that can build a firmware and custom
layout for hundreds of keyboards, or your own custom design." \
--url "https://qmk.fm/" \
--output-type rpm \
--license expat \
--vendor QMK \
--category devel \
--architecture all \
--maintainer 'QMK Firmware (Official QMK GPG Signing Key) <[email protected]>' \
--depends clang \
--depends diffutils \
--depends git \
--depends gcc \
--depends glibc-headers \
--depends kernel-devel \
--depends kernel-headers \
--depends make \
--depends unzip \
--depends wget \
--depends zip \
--depends python3 \
--depends avr-binutils \
--depends avr-gcc \
--depends avr-libc \
--depends arm-none-eabi-binutils-cs \
--depends arm-none-eabi-gcc-cs \
--depends arm-none-eabi-newlib \
--depends avrdude \
--depends dfu-programmer \
--depends dfu-util \
--depends hidapi \
--depends which \
. < /dev/null