File dokuwiki.spec of Package dokuwiki

# spec file for package DokuWiki
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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

Name: 		dokuwiki
Version: 	2015.08.10a
%define my_version 2015-08-10a
Release: 	1
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
Group: 		Productivity/Publishing/Other
Vendor: 	Andreas Gohr <>
PreReq: 	coreutils
BuildArch: 	noarch
Prefix: 	/usr/share
Prefix: 	/etc
Source1: 	DokuWiki.conf
##Patch0: 	dokuwiki-suse-shebang.patch
Buildroot: 	%{_tmppath}/%{name}-%{version}-buildroot

%if "%{_vendor}" == "suse"
Requires: apache2-mod_php5
Requires: php5 >= 5.1.2
PreReq: apache2
BuildRequires:        fdupes
BuildRequires:        apache2-devel
%define apache        apache2
%define apxs          %{_sbindir}/apxs2
Requires: php >= 5.1.2
PreReq: httpd
BuildRequires:        httpd-devel
%define apache        httpd
%define apxs          %{_sbindir}/apxs2

%define apache_libexecdir %(%{apxs} -q LIBEXECDIR)
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)

# %%packager

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.

    Andreas Gohr

%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.

    Andreas Gohr

%setup -q -n %{name}-%{my_version}
##%%if "%%{_vendor}" == "suse"
##%%patch0 -p1


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/
#rm %%{buildroot}%%{_datadir}/dokuwiki/inc/lang/.htaccess
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/dwpage.php
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/indexer.php
chmod 754 %{buildroot}%{_datadir}/dokuwiki/bin/wantedpages.php
%if "%{_vendor}" == "suse"
%fdupes %{buildroot}

[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}

%if "%{_vendor}" == "suse"
%defattr(-, wwwrun, www)
%defattr(-, apache, apache)
%doc README VERSION COPYING .htaccess.dist
%config %{apache_sysconfdir}/conf.d/%{name}.conf

[ -L /etc/DokuWiki ] && rm -rf /etc/DokuWiki
[ -L /etc/DokuWiki ] || ln -s /usr/share/dokuwiki/conf /etc/DokuWiki