Skip to content

Commit

Permalink
Adding more targets
Browse files Browse the repository at this point in the history
make TARGETS=dvb subpackages
make TARGETS=img_tmpdir subpackages
make TARGETS=input subpackages
make TARGETS=radio subpackages
make TARGETS=tesxt2speech subpackages
make TARGETS=tty7 subpackages
make TARGETS=ttyUSB0 subpackages

Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa committed Feb 10, 2025
1 parent c74ba00 commit 97ccd69
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 74 deletions.
14 changes: 11 additions & 3 deletions rpm/dvb/dvb.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
%global debug_package %{nil}

# Define the rootfs macros
%global rootfs_qm %{_prefix}/lib/qm/rootfs/

Name: qm-mount-bind-dvb
Version: 0
Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind /dev/dvb
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-dvb-%{version}.tar.gz

BuildArch: noarch
Requires: qm = %{version}-%{release}
Expand All @@ -13,17 +18,20 @@ Requires: qm = %{version}-%{release}
This subpackage installs a drop-in configuration for QM containers to mount bind `/dev/dvb`.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-dvb-%{version}

%install
# Create the directory for drop-in configurations
install -d %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d

# Install the dvb drop-in configuration file
install -m 644 %{_builddir}/qm-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_dvb.conf \
install -m 644 %{_builddir}/qm-video-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_dvb.conf \
%{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_dvb.conf


%files
%license LICENSE
%doc README.md SECURITY.md
%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_dvb.conf

%changelog
Expand Down
6 changes: 3 additions & 3 deletions rpm/img_tempdir/img_tempdir.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Release: 1%{?dist}
Summary: Drop-in configuration for QM nested containers using img tempdir
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-img_tmpdir-%{version}.tar.gz
BuildArch: noarch

Requires: qm = %{version}-%{release}
Expand All @@ -13,11 +13,11 @@ Requires: qm = %{version}-%{release}
This sub-package installs drop-in configurations for QM nested containers that use img tempdir.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-img_tmpdir-%{version}

%install
install -d %{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d
install -m 644 etc/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf \
install -m 644 %{_builddir}/qm-video-%{version}/etc/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf \
%{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d/

%files
Expand Down
10 changes: 6 additions & 4 deletions rpm/input/input.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
%global debug_package %{nil}

Name: qm_mount_bind_input
Version: 0
Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind input devices
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-input-%{version}.tar.gz
BuildArch: noarch

Requires: qm = %{version}-%{release}
Expand All @@ -13,14 +15,14 @@ Requires: qm = %{version}-%{release}
This sub-package installs drop-in configurations for QM containers to mount bind input devices.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-input-%{version}

%install
# Create the directory for drop-in configurations
install -d %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d

# Install the KVM drop-in configuration file
install -m 644 %{_builddir}/qm-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_input.conf \
# Install the input drop-in configuration file
install -m 644 %{_builddir}/qm-input-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_input.conf \
%{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_input.conf

%files
Expand Down
10 changes: 7 additions & 3 deletions rpm/radio/radio.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
%global debug_package %{nil}

Name: qm-mount-bind-radio
Version: 0
Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind /dev/radio
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-radio-%{version}.tar.gz

BuildArch: noarch
Requires: qm = %{version}-%{release}
Expand All @@ -13,16 +15,18 @@ Requires: qm = %{version}-%{release}
This subpackage installs a drop-in configuration for QM containers to mount bind `/dev/radio`.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-radio-%{version}

%install
# Create the directory for drop-in configurations
install -d %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d
# Install the KVM drop-in configuration file
install -m 644 %{_builddir}/qm-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_radio.conf \
install -m 644 %{_builddir}/qm-radio-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_radio.conf \
%{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_radio.conf

%files
%license LICENSE
%doc README.md SECURITY.md
%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_radio.conf

%changelog
Expand Down
6 changes: 3 additions & 3 deletions rpm/text2speech/text2speech.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-text2speech-%{version}.tar.gz
BuildArch: noarch

# Build requirements
Expand All @@ -30,14 +30,14 @@ Requires: espeak
This subpackage provides a drop-in configuration for the QM environment to enable espeak

%prep
%autosetup -n qm-%{version}
%autosetup -n qm-text2speech-%{version}

%build

%install

%post
dnf --installroot /usr/lib/qm/rootfs/ install espeak -y
dnf --setopt=reposdir=/etc/qm/yum.repos.d --installroot /usr/lib/qm/rootfs/ install espeak -y

%files
%license LICENSE
Expand Down
11 changes: 8 additions & 3 deletions rpm/tty7/tty7.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
%global debug_package %{nil}

Name: qm-mount-bind-tty7
Version: 0
Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind /dev/tty7
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-tty7%{version}.tar.gz

BuildArch: noarch
Requires: qm = %{version}-%{release}
Expand All @@ -15,7 +17,7 @@ This subpackage installs a drop-in configuration for QM containers to mount bind
This configuration is useful when graphical applications require access to the host’s GUI display server.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-tty7-%{version}

%build
# No build required for configuration files
Expand All @@ -25,11 +27,14 @@ This configuration is useful when graphical applications require access to the h
install -d %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d

# Install the KVM drop-in configuration file
install -m 644 %{_builddir}/qm-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_tty7.conf \
install -m 644 %{_builddir}/qm-tty7-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_tty7.conf \
%{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_tty7.conf

%files
%license LICENSE
%doc README.md SECURITY.md
%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_tty7.conf

%changelog
* Fri Jul 21 2023 RH Container Bot <[email protected]>
- Added drop-in configuration to mount bind /dev/tty7.
10 changes: 6 additions & 4 deletions rpm/ttyUSB0/ttyUSB0.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
%global debug_package %{nil}

Name: qm_mount_bind_ttyUSB0
Version: 0
Release: 1%{?dist}
Summary: Drop-in configuration for QM containers to mount bind ttyUSB0
License: GPL-2.0-only
URL: https://github.com/containers/qm
Source0: %{url}/archive/v%{version}.tar.gz
Source0: %{url}/archive/qm-ttyUSB0%{version}.tar.gz
BuildArch: noarch

Requires: qm = %{version}-%{release}
Expand All @@ -13,14 +15,14 @@ Requires: qm = %{version}-%{release}
This sub-package installs drop-in configurations for QM containers to mount bind ttyUSB0.

%prep
%autosetup -Sgit -n qm-%{version}
%autosetup -Sgit -n qm-ttyUSB0-%{version}

%install
# Create the directory for drop-in configurations
install -d %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d

# Install the KVM drop-in configuration file
install -m 644 %{_builddir}/qm-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_ttyUSB0.conf %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_ttyUSB0.conf
# Install the ttyusb0 drop-in configuration file
install -m 644 %{_builddir}/qm-ttyUSB0-%{version}/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_ttyUSB0.conf %{buildroot}%{_sysconfdir}/containers/systemd/qm.container.d/qm_dropin_mount_bind_ttyUSB0.conf

%files
%license LICENSE
Expand Down
17 changes: 9 additions & 8 deletions subsystems/dvb/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
SPECFILE_SUBPACKAGE_DVB=rpm/dvb/dvb.spec
RPM_TOPDIR ?= $(PWD)/rpmbuild
VERSION ?= $(shell cat VERSION)
ROOTDIR ?= $(PWD)
SPECFILE_SUBPACKAGE_VIDEO ?= ${ROOTDIR}/rpm/dvb/dvb.spec

.PHONY: dist
dist: ## - Creates the QM dvb package
cd $(ROOTDIR) && tar cvz \
--exclude-from=build-aux/exclude_from_tar_gz_subpackage_kvm.txt \
--dereference \
--transform s/qm/qm-dvb-${VERSION}/ \
-f /tmp/qm-dvb-${VERSION}.tar.gz \
../qm/README.md \
../qm/SECURITY.md \
../qm/LICENSE \
../qm/ \
../qm/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_dvb.conf
cd $(ROOTDIR) && mv /tmp/qm-dvb-${VERSION}.tar.gz ./rpm

.PHONY: rpm
rpm: dist ## - Creates a local RPM package, useful for development
mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
tools/version-update -v ${VERSION}
cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
.PHONY: dvb
dvp: dist ## - Creates a local RPM package, useful for development
cd $(ROOTDIR) && mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
cd $(ROOTDIR) && tools/version-update -v ${VERSION}
cd $(ROOTDIR) && cp ./rpm/qm-dvb-${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
Expand Down
19 changes: 10 additions & 9 deletions subsystems/img_tempdir/Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
SPECFILE_SUBPACKAGE_IMG_TEMPDIR=rpm/img_tempdir/img_tempdir.spec
RPM_TOPDIR ?= $(PWD)/rpmbuild
VERSION ?= $(shell cat VERSION)
ROOTDIR ?= $(PWD)
SPECFILE_SUBPACKAGE_IMG_TEMPDIR ?= ${ROOTDIR}/rpm/img_tempdir/img_tempdir.spec

.PHONY: dist
dist: ## - Creates the QM img_tempdir package
cd $(ROOTDIR) && tar cvz \
--exclude-from=build-aux/exclude_from_tar_gz_subpackage_kvm.txt \
--dereference \
--transform s/qm/qm-img_tempdir-${VERSION}/ \
-f /tmp/qm-img_tempdir-${VERSION}.tar.gz \
../qm/README.md \
../qm/SECURITY.md \
../qm/LICENSE \
../qm/ \
../qm/etc/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf
cd $(ROOTDIR) && mv /tmp/qm-img_tempdir-${VERSION}.tar.gz ./rpm

.PHONY: rpm
rpm: dist ## - Creates a local RPM package, useful for development
mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
tools/version-update -v ${VERSION}
cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
rpmbuild -ba \
.PHONY: img_tempdir
img_tempdir: dist ## - Creates a local RPM package, useful for development
cd $(ROOTDIR) && mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
cd $(ROOTDIR) && tools/version-update -v ${VERSION}
cd $(ROOTDIR) && cp ./rpm/qm-img_tempdir-${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
${SPECFILE_SUBPACKAGE_IMG_TEMPDIR}
Expand Down
17 changes: 9 additions & 8 deletions subsystems/input/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
SPECFILE_SUBPACKAGE_INPUT=rpm/input/input.spec
RPM_TOPDIR ?= $(PWD)/rpmbuild
VERSION ?= $(shell cat VERSION)
ROOTDIR ?= $(PWD)
SPECFILE_SUBPACKAGE_INPUT ?= ${ROOTDIR}/rpm/input/input.spec

.PHONY: dist
dist: ## - Creates the QM input package
cd $(ROOTDIR) && tar cvz \
--exclude-from=build-aux/exclude_from_tar_gz_subpackage_kvm.txt \
--dereference \
--transform s/qm/qm-input-${VERSION}/ \
-f /tmp/qm-input-${VERSION}.tar.gz \
../qm/README.md \
../qm/SECURITY.md \
../qm/LICENSE \
../qm/ \
../qm/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_input.conf
cd $(ROOTDIR) && mv /tmp/qm-input-${VERSION}.tar.gz ./rpm

.PHONY: rpm
rpm: dist ## - Creates a local RPM package, useful for development
mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
tools/version-update -v ${VERSION}
cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
.PHONY: input
input: dist ## - Creates a local RPM package, useful for development
cd $(ROOTDIR) && mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
cd $(ROOTDIR) && tools/version-update -v ${VERSION}
cd $(ROOTDIR) && cp ./rpm/qm-input-${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
Expand Down
17 changes: 9 additions & 8 deletions subsystems/radio/Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
SPECFILE_SUBPACKAGE_RADIO=rpm/radio/radio.spec
RPM_TOPDIR ?= $(PWD)/rpmbuild
VERSION ?= $(shell cat VERSION)
ROOTDIR ?= $(PWD)
SPECFILE_SUBPACKAGE_VIDEO ?= ${ROOTDIR}/rpm/radio/radio.spec

.PHONY: dist
dist: ## - Creates the QM radio package
cd $(ROOTDIR) && tar cvz \
--exclude-from=build-aux/exclude_from_tar_gz_subpackage_kvm.txt \
--dereference \
--transform s/qm/qm-radio-${VERSION}/ \
-f /tmp/qm-radio-${VERSION}.tar.gz \
../qm/README.md \
../qm/SECURITY.md \
../qm/LICENSE \
../qm/ \
../qm/etc/containers/systemd/qm.container.d/qm_dropin_mount_bind_radio.conf
cd $(ROOTDIR) && mv /tmp/qm-radio-${VERSION}.tar.gz ./rpm


.PHONY: rpm
rpm: dist ## - Creates a local RPM package, useful for development
mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
tools/version-update -v ${VERSION}
cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
.PHONY: radio
radio: dist ## - Creates a local RPM package, useful for development
cd $(ROOTDIR) && mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
cd $(ROOTDIR) && tools/version-update -v ${VERSION}
cd $(ROOTDIR) && cp ./rpm/qm-radio-${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
Expand Down
13 changes: 7 additions & 6 deletions subsystems/text2speech/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
SPECFILE_SUBPACKAGE_TEXT2SPEECH=rpm/text2speech/text2speech.spec
RPM_TOPDIR ?= $(PWD)/rpmbuild
VERSION ?= $(shell cat VERSION)
ROOTDIR ?= $(PWD)
SPECFILE_SUBPACKAGE_TEXT2SPEECH ?= ${ROOTDIR}/rpm/text2speech/text2speech.spec

.PHONY: dist
dist: ## - Creates the QM input package
cd $(ROOTDIR) && tar cvz \
--exclude-from=build-aux/exclude_from_tar_gz_subpackage_kvm.txt \
--dereference \
--transform s/qm/qm-text2speech-${VERSION}/ \
-f /tmp/qm-text2speech-${VERSION}.tar.gz \
../qm/README.md \
../qm/SECURITY.md \
../qm/LICENSE \
../qm/
cd $(ROOTDIR) && mv /tmp/qm-text2speech-${VERSION}.tar.gz ./rpm

.PHONY: rpm
rpm: dist ## - Creates a local RPM package, useful for development
.PHONY: qm-text2speech
qm-text2speech: dist ## - Creates a local RPM package, useful for development
cd $(ROOTDIR) && mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
cd $(ROOTDIR) && tools/version-update -v ${VERSION}
cd $(ROOTDIR) && cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
cd $(ROOTDIR) && cp ./rpm/qm-text2speech-${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
cd $(ROOTDIR) && rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
Expand Down
Loading

0 comments on commit 97ccd69

Please sign in to comment.