%define pmc https://packages.microsoft.com %define mib_name microsoft-identity-broker %define mib_version 2.0.4 %define mib_path /ubuntu/24.04/prod/pool/main/m/%{mib_name} %define mib_deb %{mib_name}_%{mib_version}_amd64.deb %define mib_dir %{mib_name}-%{mib_version} %define intune_name intune-portal %define intune_version 1.2511.7 %define intune_path /ubuntu/24.04/prod/pool/main/i/%{intune_name} %define intune_deb %{intune_name}_%{intune_version}-noble_amd64.deb %define intune_dir %{intune_name}-%{intune_version} %define intune_locales cs de en es fr hu id it ja ko nl pl pt-BR pt-PT ru sv tr zh-Hans zh-Hant %define unofficial_intune_datadir %{_datarootdir}/%{name}-%{version}-%{release} Name: unofficial-intune Version: 0.0.7 Release: 1%{?dist} Summary: Dynamic rpm packager for intune License: GPLv3 # libs from f41, this version of intune unfortunately requires this for some reason Source1: libcrypto.so.3.2.6 Source2: libssl.so.3.2.6 # additional files needed for intune to work correctly Source3: os-release Source4: common-password Source5: intune-portal Source6: intune-agent Source7: intune-daemon # systemd presets to force our stuff to be enabled Source8: 75-unofficial-intune-system.preset Source9: 75-unofficial-intune-user.preset # for macros.pam BuildRequires: pam BuildRequires: systemd-rpm-macros Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires(pre): wget >= 2 Requires: java Requires: libpwquality Requires: microsoft-edge Requires(post): dpkg Requires(post): sed Requires(post): /usr/bin/install Requires(post): /usr/bin/mktemp Requires(postun): sed %description Dynamic rpm packager for intune %install install -d %{buildroot}%{unofficial_intune_datadir}/debs install -d %{buildroot}%{unofficial_intune_datadir}/logs install -d %{buildroot}/opt/microsoft/identity-broker/bin install -d %{buildroot}/opt/microsoft/identity-broker/lib install -d %{buildroot}/opt/microsoft/intune/bin touch intune.mo for lang in %intune_locales; do install -D -m 0644 intune.mo %{buildroot}/opt/microsoft/intune/share/locale/$lang/LC_MESSAGES/intune.mo done install -D -m 0755 -t %{buildroot}/opt/microsoft/intune/lib %{SOURCE1} %{SOURCE2} install -D -m 0644 -t %{buildroot}/opt/microsoft/intune/etc %{SOURCE3} install -D -m 0644 -t %{buildroot}%{_pam_confdir} %{SOURCE4} install -D -m 0755 -t %{buildroot}%{_bindir} %{SOURCE5} %{SOURCE6} %{SOURCE7} install -D -m 0644 -t %{buildroot}%{_presetdir} %{SOURCE8} install -D -m 0644 -t %{buildroot}%{_userpresetdir} %{SOURCE9} %pre install -d %{unofficial_intune_datadir}/logs { install -d %{unofficial_intune_datadir}/debs rm -vf %{unofficial_intune_datadir}/debs/%{mib_deb} rm -vf %{unofficial_intune_datadir}/debs/%{intune_deb} wget -O %{unofficial_intune_datadir}/debs/%{mib_deb} "%{pmc}/%{mib_path}/%{mib_deb}" wget -O %{unofficial_intune_datadir}/debs/%{intune_deb} "%{pmc}/%{intune_path}/%{intune_deb}" } > %{unofficial_intune_datadir}/logs/pre.log %post { TMPDIR=$(mktemp -d) pushd ${TMPDIR} dpkg-deb -x %{unofficial_intune_datadir}/debs/%{mib_deb} %{mib_dir} install -D -m 0755 %{mib_dir}/opt/microsoft/identity-broker/bin/microsoft-identity-broker /opt/microsoft/identity-broker/bin/microsoft-identity-broker install -D -m 0755 %{mib_dir}/opt/microsoft/identity-broker/bin/microsoft-identity-device-broker /opt/microsoft/identity-broker/bin/microsoft-identity-device-broker install -D -m 0644 %{mib_dir}/usr/lib/systemd/system/microsoft-identity-device-broker.service /usr/lib/systemd/system/microsoft-identity-device-broker.service install -D -m 0644 %{mib_dir}/usr/share/applications/microsoft-identity-broker.desktop /usr/share/applications/microsoft-identity-broker.desktop install -D -m 0644 %{mib_dir}/usr/share/dbus-1/services/com.microsoft.identity.broker1.service /usr/share/dbus-1/services/com.microsoft.identity.broker1.service install -D -m 0644 %{mib_dir}/usr/share/dbus-1/system-services/com.microsoft.identity.devicebroker1.service /usr/share/dbus-1/system-services/com.microsoft.identity.devicebroker1.service install -D -m 0644 %{mib_dir}/usr/share/dbus-1/system.d/com.microsoft.identity.devicebroker1.conf /usr/share/dbus-1/system.d/com.microsoft.identity.devicebroker1.conf install -D -m 0644 %{mib_dir}/usr/share/icons/hicolor/256x256/apps/microsoft-identity-broker.png /usr/share/icons/hicolor/256x256/apps/microsoft-identity-broker.png rm -rf "%{mib_dir}" dpkg-deb -x %{unofficial_intune_datadir}/debs/%{intune_deb} %{intune_dir} # We need to replace the path to use our binary in /usr/bin since it wraps the real binary sed -i -e 's,/opt/microsoft/intune/bin/intune-portal,/usr/bin/intune-portal,' %{intune_dir}/usr/share/applications/intune-portal.desktop sed -i -e 's,/opt/microsoft/intune/bin/intune-daemon,/usr/bin/intune-daemon,' %{intune_dir}/lib/systemd/system/intune-daemon.service sed -i -e 's,/opt/microsoft/intune/bin/intune-agent,/usr/bin/intune-agent,' %{intune_dir}/lib/systemd/user/intune-agent.service install -D -m 0644 %{intune_dir}/usr/share/pam-configs/intune /usr/share/pam-configs/intune install -D -m 0644 %{intune_dir}/usr/share/applications/intune-portal.desktop /usr/share/applications/intune-portal.desktop install -D -m 0644 %{intune_dir}/usr/share/icons/hicolor/48x48/apps/intune.png /usr/share/icons/hicolor/48x48/apps/intune.png install -D -m 0644 %{intune_dir}/usr/share/polkit-1/actions/com.microsoft.intune.policy /usr/share/polkit-1/actions/com.microsoft.intune.policy install -D -m 0644 %{intune_dir}/usr/share/doc/intune-portal/copyright /usr/share/doc/intune-portal/copyright install -D -m 0644 %{intune_dir}/usr/lib/tmpfiles.d/intune.conf /usr/lib/tmpfiles.d/intune.conf install -D -m 0755 %{intune_dir}/usr/lib/x86_64-linux-gnu/security/pam_intune.so /usr/lib/x86_64-linux-gnu/security/pam_intune.so install -D -m 0644 %{intune_dir}/opt/microsoft/intune/NOTICE.txt /opt/microsoft/intune/NOTICE.txt install -D -m 0755 %{intune_dir}/opt/microsoft/intune/bin/intune-agent /opt/microsoft/intune/bin/intune-agent install -D -m 0755 %{intune_dir}/opt/microsoft/intune/bin/intune-daemon /opt/microsoft/intune/bin/intune-daemon install -D -m 0755 %{intune_dir}/opt/microsoft/intune/bin/intune-portal /opt/microsoft/intune/bin/intune-portal install -D -m 0644 %{intune_dir}/lib/systemd/system/intune-daemon.service /lib/systemd/system/intune-daemon.service install -D -m 0644 %{intune_dir}/lib/systemd/system/intune-daemon.socket /lib/systemd/system/intune-daemon.socket install -D -m 0644 %{intune_dir}/lib/systemd/user/intune-agent.service /lib/systemd/user/intune-agent.service install -D -m 0644 %{intune_dir}/lib/systemd/user/intune-agent.timer /lib/systemd/user/intune-agent.timer for lang in %intune_locales; do install -D -m 0644 %{intune_dir}/opt/microsoft/intune/share/locale/${lang}/LC_MESSAGES/intune.mo /opt/microsoft/intune/share/locale/${lang}/LC_MESSAGES/intune.mo done rm -rf "%{intune_dir}" popd rmdir ${TMPDIR} } > %{unofficial_intune_datadir}/logs/post.log grep -q graph.microsoft.com /etc/hosts || echo "20.190.152.24 graph.microsoft.com" >> /etc/hosts %systemd_post microsoft-identity-device-broker.service intune-daemon.socket %systemd_user_post intune-agent.timer %preun %systemd_preun microsoft-identity-device-broker.service intune-daemon.socket %systemd_user_preun intune-agent.timer %postun %systemd_postun microsoft-identity-device-broker.service intune-daemon.socket %systemd_user_postun intune-agent.timer [ $1 -eq 0 ] && sed -i -e '/20.190.152.24 graph.microsoft.com/d' /etc/hosts ||: %files /opt/microsoft/identity-broker /opt/microsoft/intune %{_pam_confdir}/common-password %{_bindir}/intune-portal %{_bindir}/intune-daemon %{_bindir}/intune-agent %{_presetdir}/75-unofficial-intune-system.preset %{_userpresetdir}/75-unofficial-intune-user.preset %{unofficial_intune_datadir} %ghost %{unofficial_intune_datadir}/logs/pre.log %ghost %{unofficial_intune_datadir}/logs/post.log %ghost %{unofficial_intune_datadir}/debs/%{mib_deb} %ghost %{unofficial_intune_datadir}/debs/%{intune_deb} %ghost /opt/microsoft/identity-broker/bin/microsoft-identity-broker %ghost /opt/microsoft/identity-broker/bin/microsoft-identity-device-broker %ghost /usr/lib/systemd/system/microsoft-identity-device-broker.service %ghost /usr/share/applications/microsoft-identity-broker.desktop %ghost /usr/share/dbus-1/services/com.microsoft.identity.broker1.service %ghost /usr/share/dbus-1/system-services/com.microsoft.identity.devicebroker1.service %ghost /usr/share/dbus-1/system.d/com.microsoft.identity.devicebroker1.conf %ghost /usr/share/icons/hicolor/256x256/apps/microsoft-identity-broker.png %ghost /usr/share/pam-configs/intune %ghost /usr/share/applications/intune-portal.desktop %ghost /usr/share/icons/hicolor/48x48/apps/intune.png %ghost /usr/share/polkit-1/actions/com.microsoft.intune.policy %ghost /usr/share/doc/intune-portal/copyright %ghost /usr/lib/tmpfiles.d/intune.conf %ghost /usr/lib/x86_64-linux-gnu/security/pam_intune.so %ghost /opt/microsoft/intune/NOTICE.txt %ghost /opt/microsoft/intune/bin/intune-agent %ghost /opt/microsoft/intune/bin/intune-daemon %ghost /opt/microsoft/intune/bin/intune-portal %ghost /lib/systemd/system/intune-daemon.service %ghost /lib/systemd/system/intune-daemon.socket %ghost /lib/systemd/user/intune-agent.service %ghost /lib/systemd/user/intune-agent.timer %changelog * Wed Mar 04 2026 Dan Streetman - 0.0.7-1 - update/add wrapper scripts - change service files to call wrapper scripts - remove manual removal of locale dirs/files - only clean up hosts file on uninstall, not upgrade * Thu Feb 19 2026 Dan Streetman - 0.0.6-1 - ignore errors while removing dirs in preun script * Thu Feb 19 2026 Dan Streetman - 0.0.5-1 - replace the desktop icon path to use our binary in /usr/bin * Wed Feb 18 2026 Dan Streetman - 0.0.4-1 - something, something, certificate blah blah, something * Wed Feb 18 2026 Dan Streetman - 0.0.3-1 - fix systemd unit handling in post * Wed Feb 18 2026 ddstreet -