Skip to content

Commit

Permalink
Merge pull request #86 from mefuller/rpm
Browse files Browse the repository at this point in the history
Submit RPM for review?
  • Loading branch information
darrylb123 authored Apr 25, 2022
2 parents 1476a27 + b3c76a1 commit b3023dc
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 32 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build/
dist/
gitversion.h
usbrelay
*.so
*.egg
*.egg-info
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ install: usbrelay libusbrelay.so
install -m 0755 usbrelay $(DESTDIR)$(PREFIX)/bin

install_py: install libusbrelay.so libusbrelay_py.so
python3 setup.py install
python3 setup.py install --prefix=$(DESTDIR)

.PHONY: all clean install
13 changes: 13 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

* Wed Jan 26 2022 Mark E. Fuller <[email protected]> - 0.9.0-3
- restore minimal Python module
- why are man and test.py not installing?

* Tue Jan 25 2022 Mark E. Fuller <[email protected]> - 0.9.0-2
- continued spec development and upstream improvements

* Sat Jan 22 2022 Mark E. Fuller <[email protected]> - 0.9.0-1
- bump version

* Thu Jan 20 2022 Mark E. Fuller <[email protected]> - 0.8.0-1
- first attempt versions of spec file and packaging
39 changes: 19 additions & 20 deletions rpm/usbrelay.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%global fork mefuller
%global fork fuller
%global branch rpm

Name: usbrelay
Version: 0.9
Release: 2%{?dist}
Release: %autorelease
Summary: USB-connected electrical relay control, based on hidapi
License: GPLv2
URL: https://github.com/%{fork}/%{name}/
Expand Down Expand Up @@ -63,23 +63,29 @@ Summary: Support for Home Assistant or nodered with usbrelay
%build
%set_build_flags
make python HIDAPI=libusb
%py3_build


%install
make install DESTDIR=%{buildroot}
%py3_install


install -d %{buildroot}%{_prefix}/lib/udev/rules.d/
install 50-usbrelay.rules %{buildroot}%{_prefix}/lib/udev/rules.d/
# manual copy/install operations from README
install -d %{buildroot}%{_udevrulesdir}/
install 50-usbrelay.rules %{buildroot}%{_udevrulesdir}/
install -d %{buildroot}%{_sbindir}
install usbrelayd %{buildroot}%{_sbindir}
install -d %{buildroot}%{_sysconfdir}/systemd/system
install usbrelayd.service %{buildroot}%{_sysconfdir}/systemd/system/
install usbrelayd.conf %{buildroot}%{_sysconfdir}/
install -d %{_buildroot}/share/man/man1/
install usbrelay.1 %{_buildroot}/share/man/man1/

# install test function (since users need to test relay boards)
install -d %{buildroot}%{python3_sitearch}/%{name}
install test.py %{buildroot}%{python3_sitearch}/%{name}/


%check
# verify that Python module imports
# can't test here as this required hardware(?)



%pre
Expand All @@ -91,13 +97,13 @@ install usbrelay.1 %{_buildroot}/share/man/man1/
%doc README.md
%{_bindir}/usbrelay
%{_libdir}/libusbrelay.so
%{_prefix}/lib/udev/rules.d/50-usbrelay.rules
%{_udevrulesdir}/50-usbrelay.rules


%files -n python3-%{name}
%{python3_sitearch}/%{name}_*.egg-info
%{python3_sitearch}/%{name}_py*.so
%{python3_sitearch}/%{name}_py/
%{python3_sitearch}/%{name}_py*.egg-info
%{python3_sitearch}/%{name}/*


%files mqtt
Expand All @@ -107,11 +113,4 @@ install usbrelay.1 %{_buildroot}/share/man/man1/


%changelog
* Tue Jan 25 2022 Mark E. Fuller <[email protected]> - 0.9.0-2
- continued spec development and upstream improvements

* Sat Jan 22 2022 Mark E. Fuller <[email protected]> - 0.9.0-1
- bump version

* Thu Jan 20 2022 Mark E. Fuller <[email protected]> - 0.8.0-1
- first attempt versions of spec file and packaging
%autochangelog
2 changes: 1 addition & 1 deletion rpm/usbrelay.sysusers
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Type Name ID GECOS Home directory Shell
u usbrelay - "user for MQTT" /run/usbrelay /sbin/nologin
g usbrelay - "usbrelay proivileged group" - -
g usbrelay - "usbrelay privileged group" - -
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
author_email = "[email protected]",
license = 'GPL-2.0',
ext_modules = [module1],
packages = ['usbrelay_py'],

classifiers = [
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions usbrelay_py/__init__.py

This file was deleted.

2 changes: 2 additions & 0 deletions usbrelayd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /usr/bin/env python3

# MQTT daemon for usbrelay
# Publishes a state topic for each connected usbrelay and subscribes to command topics for each relay
# Topics are stat/SERIAL/RELAY or cmnd/SERIAL/RELAY
Expand Down

0 comments on commit b3023dc

Please sign in to comment.