Skip to content

Commit 97d3ad1

Browse files
committed
split spec file, move img_tempdir to it's own spec
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
1 parent 4359aec commit 97d3ad1

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SPECFILE_SUBPACKAGE_VIDEO=rpm/video/video.spec
1313
SPECFILE_SUBPACKAGE_TTY7=rpm/tty7/tty7.spec
1414
SPECFILE_SUBPACKAGE_INPUT=rpm/input/input.spec
1515
SPECFILE_SUBPACKAGE_TTYUSB0=rpm/ttyUSB0/ttyUSB0.spec
16+
SPECFILE_SUBPACKAGE_IMG_TEMPDIR=rpm/img_tempdir/img_tempdir.spec
1617
SPECFILE_SUBPACKAGE_ROS2_ROLLING=rpm/ros2/rolling/ros2_rolling.spec
1718
RPM_TOPDIR ?= $(PWD)/rpmbuild
1819
VERSION ?= $(shell cat VERSION)
@@ -161,6 +162,16 @@ ttyUSB0_subpackage: clean dist ## - Creates a local RPM package, use
161162
--define="version ${VERSION}" \
162163
${SPECFILE_SUBPACKAGE_TTYUSB0}
163164

165+
.PHONY: img_tempdir_subpackage
166+
img_tempdir_subpackage: clean dist ## - Creates a local RPM package, useful for development
167+
mkdir -p ${RPM_TOPDIR}/{RPMS,SRPMS,BUILD,SOURCES}
168+
tools/version-update -v ${VERSION}
169+
cp ./rpm/v${VERSION}.tar.gz ${RPM_TOPDIR}/SOURCES
170+
rpmbuild -ba \
171+
--define="_topdir ${RPM_TOPDIR}" \
172+
--define="version ${VERSION}" \
173+
${SPECFILE_SUBPACKAGE_IMG_TEMPDIR}
174+
164175
# ostree target is a helper for everything required for ostree
165176
.PHONY: ostree
166177
ostree: qm_dropin_img_tempdir ## - A helper for creating QM packages for ostree based distros

rpm/img_tempdir/img_tempdir.spec

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Name: qm-dropin-img-tempdir
2+
Version: 0.6.8
3+
Release: 1%{?dist}
4+
Summary: Drop-in configuration for QM nested containers using img tempdir
5+
License: GPL-2.0-only
6+
URL: https://github.com/containers/qm
7+
Source0: %{url}/archive/v%{version}.tar.gz
8+
BuildArch: noarch
9+
10+
Requires: qm = %{version}-%{release}
11+
12+
%description
13+
This sub-package installs drop-in configurations for QM nested containers that use img tempdir.
14+
15+
%prep
16+
%autosetup -Sgit -n qm-%{version}
17+
18+
%install
19+
install -d %{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d
20+
install -m 644 etc/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf \
21+
%{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d/
22+
23+
%files
24+
%license LICENSE
25+
%doc README.md
26+
%{_sysconfdir}/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf
27+
28+
%changelog
29+
* Fri Jul 21 2023 RH Container Bot <[email protected]>
30+
- Added img_tempdir mount bind drop-in configuration.

rpm/qm.spec

-35
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
# Define the feature flag: 1 to enable, 0 to disable
88
# By default it's disabled: 0
99

10-
###########################################
11-
# subpackage QM - img_tempdir #
12-
###########################################
13-
# use img temp dir as /var/tmp
14-
%define enable_qm_dropin_img_tempdir 0
15-
1610
###########################################
1711
# subpackage QM - Enable Window Manager #
1812
###########################################
@@ -157,17 +151,6 @@ install -d %{buildroot}%{_sysconfdir}/containers/containers.conf.d
157151
################# END QM Window Manager ############################
158152
####################################################################
159153

160-
########################################################
161-
# START - qm dropin sub-package - img tempdir #
162-
########################################################
163-
%if %{enable_qm_dropin_img_tempdir}
164-
install -m 644 %{_builddir}/qm-%{version}/etc/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf \
165-
%{buildroot}%{_sysconfdir}/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf
166-
%endif
167-
########################################################
168-
# END - qm dropin sub-package - img tempdir #
169-
########################################################
170-
171154
# install policy modules
172155
%_format MODULES $x.pp.bz2
173156
%{__make} DESTDIR=%{buildroot} DATADIR=%{_datadir} install
@@ -224,24 +207,6 @@ fi
224207
%ghost %dir %{_installscriptdir}/rootfs
225208
%ghost %{_installscriptdir}/rootfs/*
226209

227-
#######################################
228-
# sub-package QM Img TempDir #
229-
#######################################
230-
%if %{enable_qm_dropin_img_tempdir}
231-
%package -n qm-dropin-img-tempdir
232-
Summary: Drop-in configuration for QM nested containers to img tempdir
233-
Requires: %{name} = %{version}-%{release}
234-
BuildArch: noarch
235-
236-
%description -n qm-dropin-img-tempdir
237-
This sub-package installs a drop-in configurations for the QM.
238-
It creates the `/etc/qm/containers/containers.conf.d/` directory for adding
239-
additional drop-in configurations.
240-
241-
%files -n qm-dropin-img-tempdir
242-
%{_sysconfdir}/qm/containers/containers.conf.d/qm_dropin_img_tempdir.conf
243-
%endif
244-
245210
#######################################
246211
# sub-package qm window manager #
247212
#######################################

tools/version-update

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ sed -i "s/Version: ${PREV_VERSION}$/Version: ${VERSION}/g" "${BASEDIR}/rpm/video
6363
sed -i "s/Version: ${PREV_VERSION}$/Version: ${VERSION}/g" "${BASEDIR}/rpm/tty7/tty7.spec"
6464
sed -i "s/Version: ${PREV_VERSION}$/Version: ${VERSION}/g" "${BASEDIR}/rpm/input/input.spec"
6565
sed -i "s/Version: ${PREV_VERSION}$/Version: ${VERSION}/g" "${BASEDIR}/rpm/ttyUSB0/ttyUSB0.spec"
66+
sed -i "s/Version: ${PREV_VERSION}$/Version: ${VERSION}/g" "${BASEDIR}/rpm/img_tempdir/img_tempdir.spec"
6667
# Otherwise, set the new version.
6768
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/qm.spec"
6869
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/kvm/qm-kvm.spec"
@@ -71,7 +72,7 @@ sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/sound/sound.spec"
7172
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/video/video.spec"
7273
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/tty7/tty7.spec"
7374
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/input/input.spec"
74-
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/ttyUSB0/ttyUSB0.spec"
75+
sed -i "s/Version: 0$/Version: ${VERSION}/g" "${BASEDIR}/rpm/img_tempdir/img_tempdir.spec"
7576
# Execute the changes on the rest of the files.
7677
for file in "${FILES[@]}"; do
7778
sed -i "s/${PREV_VERSION}/${VERSION}/g" "${BASEDIR}/${file}"

0 commit comments

Comments
 (0)