From 171ec414ae74564e2c6f7a6e7da7f0ebdc9db2d5 Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 15 Feb 2022 09:52:43 -0500 Subject: add initial system-ready values and install steps --- extra/stackbin.spec | 86 +++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 48 deletions(-) (limited to 'extra/stackbin.spec') diff --git a/extra/stackbin.spec b/extra/stackbin.spec index fcc9f8f..f9a7792 100644 --- a/extra/stackbin.spec +++ b/extra/stackbin.spec @@ -1,20 +1,19 @@ -# File: fuss.spec -# Location: fuss package +# File: stackbin.spec +# Location: stackbin package # Author: bgstack15 # SPDX-License-Identifier: CC-BY-SA-4.0 # Startdate: 2021-01-05 -# Title: Rpm spec for fuss package +# Title: Rpm spec for stackbin package # Purpose: Provide build instructions for CentOS rpm for package # History: # Usage: # Reference: +# fuss.spec # Improve: # Documentation: # Dependencies: # Tunables -# If you set with_icons to 1, then you will pull in a large amount of dependencies! -%global with_icons 0 # If you set this to 1, use the systemd-rpm-macros functionality described at https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/ %global with_systemd_usercreate 0 %global pythonver python36 @@ -22,77 +21,64 @@ # Fedora defaults %if 0%{?fedora} %global with_systemd_usercreate 1 -%global with_icons 1 %global pythonver python3 %endif -%global _appvardir %{?_localstatedir}%{!?_localstatedir:/var}/www/fuss -%global _appdir %{?_datarootdir}%{!?_datarootdir:%{_prefix}/share}/fuss -%global _user fuss +%global _appvardir %{?_localstatedir}%{!?_localstatedir:/var}/www/stackbin +%global _appdir %{?_datarootdir}%{!?_datarootdir:%{_prefix}/share}/stackbin +%global _user stackbin %define devtty "/dev/null" %define debug_package %{nil} %global _python_bytecompile_errors_terminate_build 0 -Summary: file upload and storage service web app -Name: fuss -Version: 0.0.2 +Summary: Pastebin implementation in flask +Name: stackbin +Version: 0.0.1 Release: 1 License: GPL 3.0 Source0: %{name}_%{version}.orig.tar.gz %if 0%{?with_systemd_usercreate} Source1: extra/%{name}.sysusers %endif -%if ! 0%{?fedora} -Patch1: extra/%{name}-el7.patch -%endif -URL: https://bgstack15.wordpress.com/ +#%%if ! 0%%{?fedora} +#Patch1: extra/%%{name}-el7.patch +#%%endif +URL: https://bgstack15.ddns.net/ #Distribution: #Vendor: Packager: B. Stack Requires: %{pythonver}-flask +Requires: %{pythonver}-sqlalchemy Requires: %{pythonver}-uwsgidecorators Requires: uwsgi-plugin-%{pythonver} +# WORKHERE Requires: uwsgi-logger-file %if 0%{?fedora} -Requires: %{pythonver}-magic -Requires: %{pythonver}-flask-script -%endif -# Mandatory pip3 requirements: flask-script, python-magic -%if 0%{?with_icons} -Requires: /usr/bin/xvfb-run -%if 0%{?fedora} -Requires: %{pythonver}-gobject -%else -# The following are needed for CentOS7 pip3 install --user PyGObject -Requires: cairo-gobject-devel -Requires: gcc -Requires: gobject-introspection-devel -Requires: gtk3-devel -Requires: python36-gobject -Requires: python3-devel -%endif +# Fedora has all the deps; no pip3 helper needed! +Requires: %{pythonver}-pytimeparse +Requires: %{pythonver}-flask-sqlalchemy %endif +# Mandatory pip3 requirements: pytimeparse, flask-sqlalchemy #BuildRequires: txt2man %if 0%{?with_systemd_usercreate} BuildRequires: systemd-rpm-macros %endif %if 0%{?fedora} || 0%{?rhel} >= 8 -Suggests: httpd +Suggests: nginx %endif Buildarch: noarch %description -File Upload and Storage Service is a demo flask application that can -be used for whatever purposes you want. +Stackbin is a flask-based pastebin implementation. %prep %setup -q -c %{name} test -d "%{name}" && cd "%{name}" test -d "%{name}-master" && cd "%{name}-master" -%if ! 0%{?fedora} -%patch1 -p1 -%endif +#%%if ! 0%%{?fedora} +#%%patch1 -p1 +#%%endif %build export srcdir="extra" @@ -104,8 +90,14 @@ export srcdir="extra" test -d "%{name}" && cd "%{name}" %make_install -C "${srcdir}" \ with_systemd=YES \ + with_nginx=YES \ + with_apache=NO \ with_init=NO \ +%if 0%{?fedora} + with_pip_helper=NO +%else with_pip_helper=YES +%endif %if 0%{?with_systemd_usercreate} install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf %endif @@ -121,12 +113,12 @@ rm -rf %{buildroot} %else if ! getent group %{_user} 1>/dev/null 2>&1 ; then - /usr/sbin/groupadd --system --gid 723 %{_user} + /usr/sbin/groupadd --system --gid 724 %{_user} fi if ! getent passwd %{_user} 1>/dev/null 2>&1 ; then - /usr/sbin/useradd --system --gid 723 \ - --uid 723 --comment "FUSS system user" \ + /usr/sbin/useradd --system --gid 724 \ + --uid 724 --comment "stackbin system user" \ --home-dir %{_appvardir} --shell /sbin/nologin \ %{_user} fi @@ -154,18 +146,16 @@ exit 0 %attr(0644, %{_user}, %{_user}) %{_appdir}/templates/* %attr(0755, %{_user}, %{_user}) %dir %{_appdir}/static %attr(0755, %{_user}, %{_user}) %dir %{_appdir}/templates -%attr(0755, %{_user}, %{_user}) %dir %{_appvardir}/upload %attr(0755, %{_user}, %{_user}) %dir %{_appdir} %attr(0755, %{_user}, %{_user}) %dir %{_appvardir} +%if ! 0%{?fedora} %attr(0755, -, -) %{_libexecdir}/%{name}/pip-helper.sh +%endif %attr(0644, root, root) %{?_unitdir}%{!?_unitdir:/usr/lib/systemd/system}/%{name}.service -%attr(0644, root, root) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%attr(0644, root, root) %{_sysconfdir}/nginx/default.d/%{name}.conf %attr(0755, %{_user}, %{_user}) %dir %{?_localstatedir}%{!?_localstatedir:/var}/log/%{name} %{_defaultdocdir}/%{name} %changelog -* Fri Sep 24 2021 B. Stack - 0.0.2-1 -- Upstream update - -* Tue Jan 05 2021 B. Stack - 0.0.1-1 +* Tue Feb 15 2022 B. Stack - 0.0.1-1 - Initial release -- cgit