Skip to content

Commit

Permalink
ros2 split makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Yariv Rachmani <[email protected]>
  • Loading branch information
Yarboa authored and dougsland committed Jan 14, 2025
1 parent 6bab941 commit ff43278
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 14 deletions.
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ LIBDIR ?= $(PREFIX)/lib
SYSCONFDIR?=/etc
QMDIR=/usr/lib/qm
SPECFILE=rpm/qm.spec
SPECFILE_SUBPACKAGE_ROS2_ROLLING=rpm/ros2/rolling/ros2_rolling.spec
SUBSYS := subsystems/kvm subsystems/windowmanager subsystems/sound subsystems/video subsystems/radio subsystems/dvb subsystems/tty7 subsystems/input subsystems/ttyUSB0 subsystems/text2speech
SUBSYS := subsystems/kvm subsystems/windowmanager subsystems/sound subsystems/video subsystems/radio subsystems/dvb subsystems/tty7 subsystems/input subsystems/ttyUSB0 subsystems/text2speech subsystems/img_tempdir subsystems/ros2
export RPM_TOPDIR ?= $(PWD)/rpmbuild
export VERSION ?= $(shell cat VERSION)
export ROOTDIR ?= $(PWD)
Expand Down Expand Up @@ -81,16 +80,6 @@ rpm: clean dist ## - Creates a local RPM package, useful for develop
fi; \
done

.PHONY: ros2_rolling_subpackage
ros2_rolling_subpackage: clean 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 \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
${SPECFILE_SUBPACKAGE_ROS2_ROLLING}

install-policy: all ## - Install selinux policies only
semodule -i ${TARGETS}.pp.bz2
sepolicy manpage --path . --domain ${TARGETS}_t
Expand Down
5 changes: 3 additions & 2 deletions rpm/ros2/rolling/ros2_rolling.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%global ros2_container %{rootfs_qm}/%{_sysconfdir}/containers/systemd/

Name: qm-ros2-rolling
Version: 0
Version: 0.6.9
Release: 1%{?dist}
Summary: Subpackage container for quadlet container to ROS2 Rolling environment
License: GPL-2.0-only
Expand Down Expand Up @@ -36,7 +36,8 @@ containers managed by Podman and systemd within the QM environment.
mkdir -p %{buildroot}%{ros2_container}

# Install the ROS2 Rolling container file
install -m 644 subsystems/ros2/ros2-rolling.container %{buildroot}%{ros2_container}

install -m 644 subsystems/ros2/etc/containers/systemd/ros2-rolling.container %{buildroot}%{ros2_container}

%files
%license LICENSE
Expand Down
27 changes: 27 additions & 0 deletions subsystems/ros2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SPECFILE_SUBPACKAGE_ROS2_ROLLING=rpm/ros2/rolling/ros2_rolling.spec

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


.PHONY: rpm
rpm: 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) && rpmbuild -ba \
--define="_topdir ${RPM_TOPDIR}" \
--define="version ${VERSION}" \
${SPECFILE_SUBPACKAGE_ROS2_ROLLING}

File renamed without changes.
File renamed without changes.

0 comments on commit ff43278

Please sign in to comment.