Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:infrastructure
cachet
Cachet.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Cachet.spec of Package cachet
# # spec file for package Cachet # # Copyright (c) 2021 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: Cachet Version: 2.5.1 Release: 0 Summary: The open source status page system License: BSD-3-Clause Group: Productivity/Networking/Web/Frontends URL: https://github.com/fiveai/Cachet Source0: %{name}-%{version}.tar.xz ## zypper install php-composer # cd Cachet # composer install --no-dev --no-scripts --ignore-platform-reqs # => check "scripts" section in composer.json # export version=%%{version}; tar -cvJf ../Cachet-${version}-vendor.tar.xz vendor # Source1: %{name}-%{version}-vendor.tar.xz Source2: README.SUSE Source3: Cachet.conf Source10: Cachet-rpmlintrc Source11: Cachet-apache.service Source12: Cachet-apache.timer Source13: Cachet.logrotate BuildRequires: apache2 BuildRequires: logrotate BuildRequires: fdupes BuildRequires: systemd # below is needed for the post snipplets #BuildRequires: php > 7.0 #BuildRequires: php-json #BuildRequires: php-mbstring #BuildRequires: php-pdo %{?systemd_requires} Recommends: logrotate Requires: %{name}-http = %{version} Requires: php-composer Requires: php-ctype Requires: php-curl Requires: php-dom Requires: php-fileinfo Requires: php-gd Requires: php-iconv Requires: php-intl Requires: php-json Requires: php-mbstring Requires: php-mysql Requires: php-openssl Requires: php-pdo Requires: php-phar Requires: php-tokenizer Requires: php-xmlreader Requires: php-xmlwriter Requires: php-zip Requires: php-zlib Recommends: php-APCu Recommends: php-mysql Recommends: php-pgsql Recommends: php-redis Recommends: php-sqlite Recommends: redis BuildArch: noarch %define app_dir %{_datadir}/php/%{name} %define app_config_dir %{_sysconfdir}/%{name} %define apache_user wwwrun %define apache_group www %description Cachet is a beautiful and powerful open source status page system. Features: * List your services components * Log incidents * Apply custom CSS to the status page * Markdown support for incident messages * JSON API * Translated into eleven languages * Metrics * Cross-database support: MySQL, PostgreSQL and SQLite * Subscriber notifications via Email * Two factor authentication using Google Authenticator %package config-apache Summary: Apache configuration and dependencies for Cachet Group: Productivity/Networking/Web/Frontends Requires: mod_php_any >= 8 Recommends: apache2-mod_apparmor Requires(pre): apache2 Requires(pre): %{name} = %{version} Requires(pre): php > 8 %if 0%{?suse_version} >= 1500 Requires(pre): user(%apache_user) Requires(pre): group(%apache_group) %endif Provides: %{name}-http = %{version}-%{release} %description config-apache This package provides the files and dependencies needed to run Cachet via an Apache webserver. %prep %setup -q -a1 # remove unneeded files and directories for file in \ debugsources.list \ .codeclimate.yml \ .doctrine-project.json \ .editorconfig \ .gitattributes \ .gitignore \ .htaccess \ .php_cs \ .php_cs.dist \ .phpstorm.meta.php \ .pullapprove.yml \ .scrutinizer.yml \ .styleci.yml \ .travis.yml ; do find . -name "$file" -delete done for dir in \ .config \ .github \ .local \ .phan \ ; do find . -name "$dir" -exec rm -rf {} + done for dir in \ vendor/chillerlan/php-traits/tests \ vendor/pragmarx/google2fa/tests \ vendor/psy/psysh/test \ ; do rm -rf "$dir" done # disable the beacon (deliver information) cat << EOF >> .env.example CACHET_BEACON=false EOF %build %install mkdir -p %{buildroot}/%{app_config_dir} \ %{buildroot}/%{_sysconfdir}/apache2/vhosts.d \ %{buildroot}/%{app_dir} \ %{buildroot}/%{_defaultdocdir}/%{name} cp -r * %{buildroot}/%{app_dir}/ for file in $(find %{buildroot}/%{app_dir}/ -type f -name "*.php") %{buildroot}/%{app_dir}/artisan; do sed -i "s|#!%{_bindir}/env.*|#!%{_bindir}/php|g" "$file" done cd %{buildroot}/%{app_dir} mv *.md %{buildroot}/%{_defaultdocdir}/%{name}/ rm LICENSE cd - install -m644 %{SOURCE2} %{buildroot}/%{_defaultdocdir}/%{name}/README.SUSE cp .env.example %{buildroot}/%{app_config_dir}/ touch %{buildroot}/%{app_config_dir}/.env cd %{buildroot}/%{app_dir} ln -s %{app_config_dir}/.env . install -m644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/apache2/vhosts.d/%{name}.conf chmod +x %{buildroot}/%{app_dir}/artisan # install cron job install -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}.timer # install logrotate install -D -m0644 %{SOURCE13} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}-config-apache2 # run fdupes %fdupes -s %{buildroot}/%{app_dir}/* %pre config-apache %service_add_pre %{name}.timer %{name}.service apache2.service %post config-apache %service_add_post %{name}.timer %{name}.service apache2.service if [ $1 -gt 1 ]; then # Update Cachet echo "Cachet: trying to shut down the application" su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{app_dir}/artisan down --no-interaction" || : echo "Cachet: running artisan migrate" su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{app_dir}/artisan migrate --no-interaction" || : echo "Cachet: running artisan app:update" su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{app_dir}/artisan app:update --no-interaction" || : echo "Cachet: cleaning up the cache" su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{app_dir}/artisan cache:clear --no-interaction" || : echo "Cachet: trying to start the application" su %{apache_user} -s /bin/sh -c "%{_bindir}/php %{app_dir}/artisan up --no-interaction" || : fi %preun config-apache %service_del_preun %{name}.timer %{name}.service apache2.service %postun config-apache %service_del_postun %{name}.timer %{name}.service apache2.service %files %defattr(0644,root,root,0755) %license LICENSE %dir %{_defaultdocdir}/%{name} %doc %{_defaultdocdir}/%{name}/* %dir %{app_config_dir} %dir %{app_dir} %dir %{_datadir}/php %ghost %config(noreplace) %{app_config_dir}/.env %{app_dir}/* %{app_dir}/.env %attr(0755,root,root) %{app_dir}/artisan %exclude %{app_dir}/storage %exclude %{app_dir}/bootstrap/cache* %files config-apache %defattr(0640,root,root,0750) %{_unitdir}/%{name}.service %{_unitdir}/%{name}.timer %config(noreplace) %{_sysconfdir}/apache2/vhosts.d/%{name}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-config-apache2 %defattr(-,%{apache_user},%{apache_group}) %dir %{app_dir}/storage %dir %{app_dir}/bootstrap/cache* %{app_dir}/storage/* %attr(0640,root,%{apache_group}) %ghost %config(noreplace) %{app_config_dir}/.env %attr(0640,root,%{apache_group}) %config %{app_config_dir}/.env.example %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor