File dokuwiki.spec of Package dokuwiki
#
# spec file for package dokuwiki
#
# Copyright (c) 2020 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/
#
%define my_version 2025-05-14a
Name: dokuwiki
Version: 2025.05.14a
Release: 0
Summary: A Wiki written in PHP to work without a database
Summary(de): Ein in PHP geschriebenes Wiki, das keine Datenbank benutzt
License: GPL-2.0-only
Group: Productivity/Publishing/Other
URL: https://www.dokuwiki.org/
Source: http://download.dokuwiki.org/src/%{name}/%{name}-%{my_version}.tgz
Source1: DokuWiki.conf
BuildRequires: apache-rpm-macros
BuildRequires: fdupes
BuildArch: noarch
%package apache
Summary: Apache configuration for %{name}
Group: Productivity/Networking/Web/Utilities
BuildRequires: apache2
Requires: %{name} = %{version}
Requires: apache2
Requires: mod_php_any >= 7.4
Supplements: (apache2 and %name)
%description apache
This subpackage contains the Apache configuration files
%description
DokuWiki is a standards compliant, simple to use Wiki, mainly aimed at creating
documentation of any kind. It is targeted at developer teams, workgroups and small
companies. It has a simple but powerful syntax which makes sure the datafiles
remain readable outside the Wiki and eases the creation of structured texts.
All data is stored in plain text files - no database is required.
Read the DokuWiki Manual to unleash the full power of DokuWiki.
%description -l de
DokuWiki ist ein einfach zu benutzendes Wiki, mit dem vor allem Dokumentation jeder Art
erstellt werden soll, und dessen Ausgabeformat den Standards entspricht. Zielguppe sind
Entwicklerteams, Arbeitsgruppen und kleine Firmen aller Art. DokuWiki hat eine einfache,
aber mächtige Syntax und erleichtert das Erstellen strukturierter Texte. Alle Daten
werden in reinen Textdateien abgelegt - eine Datenbank ist nicht erforderlich.
Lies das Handbuch von DokuWiki, um seine geballte Kraft freizusetzen.
%prep
%setup -q -n %{name}-%{my_version}
# rpmlint
find . -type f -exec sed -i -e 's|\/usr\/bin\/env php|\/usr\/bin\/php|g' {} \;
find . -type f -exec sed -i -e 's|\/usr\/bin\/env sh|\/bin\/sh|g' {} \;
chmod -x vendor/simplepie/simplepie/library/SimplePie.php
chmod -x vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php
chmod -x vendor/simplepie/simplepie/library/SimplePie/Registry.php
find . -type f "(" -name ".gitignore" -or -name ".editorconfig" -or -name ".gitattributes" -or -name ".travis.yml" ")" -delete
%build
# nothing to build
%install
mkdir -p %{buildroot}%{apache_sysconfdir}/conf.d/
mkdir -p %{buildroot}%{_datadir}/dokuwiki/bin
mkdir -p %{buildroot}%{_datadir}/dokuwiki/conf
mkdir -p %{buildroot}%{_datadir}/dokuwiki/data
mkdir -p %{buildroot}%{_datadir}/dokuwiki/inc
mkdir -p %{buildroot}%{_datadir}/dokuwiki/lib
mkdir -p %{buildroot}%{_datadir}/dokuwiki/vendor
cp %{SOURCE1} %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf
cp -a *.php %{buildroot}%{_datadir}/dokuwiki/
cp -a bin/*.php %{buildroot}%{_datadir}/dokuwiki/bin/
cp -ar data/* %{buildroot}%{_datadir}/dokuwiki/data/
cp -ar inc/* %{buildroot}%{_datadir}/dokuwiki/inc/
cp -ar lib/* %{buildroot}%{_datadir}/dokuwiki/lib/
cp -ar vendor/* %{buildroot}%{_datadir}/dokuwiki/vendor/
cp -a conf/* %{buildroot}%{_datadir}/dokuwiki/conf/
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/dwpage.php
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/indexer.php
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/wantedpages.php
%fdupes %{buildroot}
%postun apache
if [ "$1" = "0" ]; then
# deinstallation of the package - remove the apache flag
test -x %{_sbindir}/a2disflag && %{_sbindir}/a2disflag DOKUWIKI >/dev/null
%restart_on_update apache2
fi
%pre apache
if [ "$1" = "1" ]; then
# enable version in apache config
test -x %{_sbindir}/a2enmod && %{_sbindir}/a2enmod version >/dev/null
# enable php5 in apache config
test -x %{_sbindir}/a2enmod && %{_sbindir}/a2enmod php5 >/dev/null
# enable KOHANA in %%{_sysconfdir}/sysconfig/apache2
test -x %{_sbindir}/a2enflag && %{_sbindir}/a2enflag DOKUWIKI >/dev/null
%restart_on_update apache2
fi
%post
[ -L %{_sysconfdir}/DokuWiki ] && rm -rf %{_sysconfdir}/DokuWiki
[ -L %{_sysconfdir}/DokuWiki ] || ln -s %{_datadir}/dokuwiki/conf %{_sysconfdir}/DokuWiki
%files
%defattr(-, %{apache_user}, %{apache_group})
%license COPYING
%doc README VERSION
%{_datadir}/dokuwiki
%files apache
%config(noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf
%changelog