File barcodebuddy.spec of Package barcodebuddy

#
# spec file for package barcodebuddy
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           barcodebuddy
Version:        1.8.1.8
Release:        0
Summary:	Barcode Buddy for Grocy
License:        AGPL-3
URL:            https://github.com/Forceu/barcodebuddy/
Source:         %{name}-%{version}.tar.gz
Source1:        barcodebuddy-wsserver.service
Patch0:         0010-use_BASEURL_in_getApiUrl.patch
BuildRequires:  systemd-rpm-macros
Requires: user(wwwrun)
Requires: group(www)
Requires: php-cli

%description

%prep
%autosetup -p 1

%build

%install
mkdir -p %{buildroot}/srv/www/vhosts/barcodebuddy
cp -av * %{buildroot}/srv/www/vhosts/barcodebuddy/
cp -av .htaccess %{buildroot}/srv/www/vhosts/barcodebuddy/
cp -av config-dist.php %{buildroot}/srv/www/vhosts/barcodebuddy/data/config.php
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/barcodebuddy-wsserver.service

%pre
%service_add_pre barcodebuddy-wsserver.service

%post
%service_add_post barcodebuddy-wsserver.service

%preun
%service_del_preun barcodebuddy-wsserver.service

%postun
%service_del_postun barcodebuddy-wsserver.service

%files
%license LICENSE.md
%doc README.md
%dir /srv/www
%dir /srv/www/vhosts
%dir /srv/www/vhosts/barcodebuddy
%dir %attr(755, wwwrun, www) /srv/www/vhosts/barcodebuddy/data
%config (noreplace) /srv/www/vhosts/barcodebuddy/data/config.php
%{_unitdir}/barcodebuddy-wsserver.service
/srv/www/vhosts/barcodebuddy/data/.htaccess
/srv/www/vhosts/barcodebuddy/example/
/srv/www/vhosts/barcodebuddy/incl/
/srv/www/vhosts/barcodebuddy/locales/
/srv/www/vhosts/barcodebuddy/menu/
/srv/www/vhosts/barcodebuddy/plugins/
/srv/www/vhosts/barcodebuddy/api/
/srv/www/vhosts/barcodebuddy/LICENSE.md
/srv/www/vhosts/barcodebuddy/README.md
/srv/www/vhosts/barcodebuddy/composer.json
/srv/www/vhosts/barcodebuddy/composer.lock
/srv/www/vhosts/barcodebuddy/config-dist.php
/srv/www/vhosts/barcodebuddy/cron.php
/srv/www/vhosts/barcodebuddy/error.php
/srv/www/vhosts/barcodebuddy/index.php
/srv/www/vhosts/barcodebuddy/login.php
/srv/www/vhosts/barcodebuddy/logout.php
/srv/www/vhosts/barcodebuddy/openapi.json
/srv/www/vhosts/barcodebuddy/robots.txt
/srv/www/vhosts/barcodebuddy/screen.php
/srv/www/vhosts/barcodebuddy/setup.php
/srv/www/vhosts/barcodebuddy/wsserver.php
/srv/www/vhosts/barcodebuddy/.htaccess


%changelog
openSUSE Build Service is sponsored by