From f9e737c3ec3b3d1b7db14caf23d1033afa933790 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 22 Oct 2025 20:21:22 +0200 Subject: [PATCH 1/4] add rpm spec based on the old Fedora package --- hdapsd.spec | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 hdapsd.spec diff --git a/hdapsd.spec b/hdapsd.spec new file mode 100644 index 0000000..29e4326 --- /dev/null +++ b/hdapsd.spec @@ -0,0 +1,143 @@ +Name: hdapsd +Version: 20250908 +Release: 1%{?dist} +Summary: Protects hard drives by parking head when fall is detected + +Group: Applications/System +License: GPLv2+ +URL: http://hdaps.sourceforge.net/ +Source0: https://github.com/linux-thinkpad/hdapsd/releases/download/%{version}/%{name}-%{version}.tar.gz +BuildRequires: gcc +%{?systemd_requires} +BuildRequires: systemd +BuildRequires: libconfig-devel + +%description + +This is a disk protection user-space daemon. It monitors the acceleration +values through the HDAPS/AMS interfaces and automatically initiates disk head +parking if a fall or sliding of the laptop is detected. + +HDAPS is typically found in ThinkPad laptops and AMS in Apple laptops. + +%prep +%setup -q + +%build +%configure +make %{?_smp_mflags} + + +%install +%make_install +install -m 644 misc/%{name}.service %{buildroot}%{_unitdir} + +%files +%{_sbindir}/* +%{_udevrulesdir}/%{name}.rules +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}@.service +%{_mandir}/man8/hdapsd.8.gz +%config(noreplace) %{_sysconfdir}/%{name}.conf +%doc AUTHORS +%license COPYING +%doc ChangeLog +%doc README.md + + +%changelog +* Wed Oct 22 2025 Evgeni Golov - 20250908-1 +- New upstream release + +* Tue Jul 24 2018 Adam Williamson - 20141203-10 +- Rebuild for new libconfig + +* Fri Jul 13 2018 Fedora Release Engineering - 20141203-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 20141203-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 20141203-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 20141203-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 20141203-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sun Feb 14 2016 Tomasz Torcz - 20141203-4 +- fix FTBFS (rhbz#1307612) + +* Wed Feb 03 2016 Fedora Release Engineering - 20141203-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 20141203-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed May 06 2015 Tomasz Torcz - 20141203-1 +- new upstream version + +* Tue Oct 28 2014 Tomasz Torcz - 20141024-1 +- new upstream version + +* Sat Aug 16 2014 Fedora Release Engineering - 20090401.20131204git401ca60-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 20090401.20131204git401ca60-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Dec 04 2013 Tomasz Torcz - 20090401.20131204git401ca60c75-1 +- latest upstream snapshot, fixes rhbz#1037119 + +* Sat Aug 03 2013 Fedora Release Engineering - 20090401gita64b50c-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue May 28 2013 Tomasz Torcz - 20090401gita64b50c-1 +- package upstream snapshot: + - use upstream systemd units and udev rules + - drop sysconfig file + +* Thu Feb 14 2013 Fedora Release Engineering - 20090401-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 20090401-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Feb 03 2012 Tomasz Torcz - 20090401-10 +- spec cleanup: + - remove BuildRoot define and it's removal from clean + - use _unitdir macro introduced in the meantime + - drop upstart event files +- remove StandardOutput=syslog from unit file + +* Fri Jan 13 2012 Fedora Release Engineering - 20090401-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 20090401-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Jan 9 2011 Tomasz Torcz 20090401-7 +- remove bad parentheses in ExecStart= line of systemd unit def + (thanks Alexandre Silva Lopes, #667073) + +* Sat Jul 17 2010 Tomasz Torcz 20090401-6 +- provide systemd service definition +- resurrect udev rule for systemd interaction + +* Mon Dec 07 2009 Tomasz Torcz 20090401-5 +- port initscript file to upstart 0.6, removing custom udev rule + +* Fri Sep 04 2009 Tomasz Torcz 20090401-4 +- use version macro in in Source0, as per review suggestion (#505928 #9) + +* Sun Jun 21 2009 Tomasz Torcz 20090401-3 +- fixes from review: URL source, proper build root macro +- minor cleanup of event file + +* Wed Jun 17 2009 Tomasz Torcz 20090401-2 +- mark upstart event file and udev rule as config files + +* Sun Jun 14 2009 Tomasz Torcz 20090401-1 +- initial version From 9baf9e2a0870cdd5441f8f8bfd833a49b6974c67 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 22 Oct 2025 20:30:36 +0200 Subject: [PATCH 2/4] update spec based on "modern" RPM --- hdapsd.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hdapsd.spec b/hdapsd.spec index 29e4326..b2b3b87 100644 --- a/hdapsd.spec +++ b/hdapsd.spec @@ -3,7 +3,6 @@ Version: 20250908 Release: 1%{?dist} Summary: Protects hard drives by parking head when fall is detected -Group: Applications/System License: GPLv2+ URL: http://hdaps.sourceforge.net/ Source0: https://github.com/linux-thinkpad/hdapsd/releases/download/%{version}/%{name}-%{version}.tar.gz @@ -21,11 +20,11 @@ parking if a fall or sliding of the laptop is detected. HDAPS is typically found in ThinkPad laptops and AMS in Apple laptops. %prep -%setup -q +%autosetup %build %configure -make %{?_smp_mflags} +%make_build %install From 79d47058fba9deeeef244e3458d0e9c27e1a7126 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 22 Oct 2025 20:25:44 +0200 Subject: [PATCH 3/4] add packit --- .packit.yaml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .packit.yaml diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..e0816cc --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,48 @@ +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +specfile_path: hdapsd.spec + +# add or remove files that should be synced +files_to_sync: + - hdapsd.spec + - .packit.yaml + +actions: + get-current-version: + - bash -c "grep AC_INIT configure.ac | cut -f2 -d, | tr --complement --delete '0-9'" + create-archive: + - ./autogen.sh + - make dist + - bash -c "ls -1t hdapsd-*.tar.gz | head -n 1" + +# name in upstream package repository/registry (e.g. in PyPI) +upstream_package_name: hdapsd +# downstream (Fedora) RPM package name +downstream_package_name: hdapsd + +upstream_tag_template: '{version}' + +srpm_build_deps: + - autoconf + - automake + - gcc + - make + +jobs: + - &copr + job: copr_build + trigger: pull_request + targets: + - epel-9 + - epel-10 + - fedora-stable + + - <<: *copr + job: tests + + - <<: *copr + trigger: commit + branch: master + owner: evgeni + project: linux-thinkpad-devel From 28fdf1c5cbc0df94c68b694c4889afcf567094e6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 22 Oct 2025 20:43:41 +0200 Subject: [PATCH 4/4] package com.github.linux_thinkpad.hdapsd.metainfo.xml --- hdapsd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/hdapsd.spec b/hdapsd.spec index b2b3b87..62c7c71 100644 --- a/hdapsd.spec +++ b/hdapsd.spec @@ -37,6 +37,7 @@ install -m 644 misc/%{name}.service %{buildroot}%{_unitdir} %{_unitdir}/%{name}.service %{_unitdir}/%{name}@.service %{_mandir}/man8/hdapsd.8.gz +%{_metainfodir}/com.github.linux_thinkpad.hdapsd.metainfo.xml %config(noreplace) %{_sysconfdir}/%{name}.conf %doc AUTHORS %license COPYING