Skip to content

Commit

Permalink
Switch from python install to installing directly in spec file
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Nov 22, 2023
1 parent fc51af3 commit 5c60979
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
31 changes: 18 additions & 13 deletions livereduce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BuildArch: noarch
Vendor: Pete Peterson
Url: https://github.com/mantidproject/livereduce

BuildRequires: python%{python3_pkgversion} python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}

Requires: python%{python3_pkgversion}
Requires: jq
Expand All @@ -25,34 +25,39 @@ Requires: nsd-app-wrap
%description
There should be a meaningful description, but it is not needed quite yet.

%{?python_provide:%python_provide python-%{srcname}}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

%prep
%setup -n %{srcname}-%{version} -n %{srcname}-%{version}
%setup -q -n %{srcname}-%{version} -n %{srcname}-%{version}

%build
%py3_build
# no build step

%install
%py3_install
%{__rm} -rf $RPM_BUILD_ROOT
# put things in the bin directory
%{__mkdir} -p %{buildroot}%{_bindir}/
%{__install} -m 644 scripts/livereduce.py %{buildroot}%{_bindir}/
%{__install} -m 755 scripts/livereduce.sh %{buildroot}%{_bindir}/
%{__mkdir} -p %{buildroot}%{_unitdir}/
%{__install} -m 644 livereduce.service %{buildroot}%{_unitdir}/

%check
%{__python3} setup.py test
# no test step

%clean
rm -rf $RPM_BUILD_ROOT
%{__rm} -rf $RPM_BUILD_ROOT

%post
mkdir -p /var/log/SNS_applications/
chown snsdata /var/log/SNS_applications/
chmod 1755 /var/log/SNS_applications/
%{__mkdir} -p /var/log/SNS_applications/
%{__chown} snsdata /var/log/SNS_applications/
%{__chmod} 1755 /var/log/SNS_applications/

%preun
rm -f /var/log/SNS_applications/livereduce.log*
%{__rm} -f /var/log/SNS_applications/livereduce.log*

%files
%doc README.md
%{python3_sitelib}/*
%{_bindir}/livereduce.py
%{_bindir}/livereduce.sh
%{_prefix}/lib/systemd/system/livereduce.service
%{_unitdir}/livereduce.service
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ include-package-data=true
where = ["."]
exclude = ["test"]

[tool.setuptools.package-data]
"*" = ["*.sh", "*.service"]

#TODO define entrypoints

0 comments on commit 5c60979

Please sign in to comment.