Peter 'Pessoft' Kolínek ed273b
%global		releasenum 2018-04-22a
Peter 'Pessoft' Kolínek ed273b
%global		releasetag 20180422a
88d46a
b1c053
Name:		dokuwiki
b1c053
Version:	0
Peter 'Pessoft' Kolínek d6f5ed
Release:	0.33.%{releasetag}%{?dist}
b1c053
Summary:	Standards compliant simple to use wiki
b1c053
Group:		Applications/Internet
b1c053
License:	GPLv2
Peter 'Pessoft' Kolínek ed273b
URL:		https://www.dokuwiki.org/dokuwiki
Peter 'Pessoft' Kolínek ed273b
Source0:	https://download.dokuwiki.org/src/%{name}/%{name}-%{releasenum}.tgz
b1c053
#Fedora specific patches to use fedora packaged libraries
b2edf8
Patch1:		dokuwiki-rm-bundled-libs.patch
b1c053
BuildArch:	noarch
b1c053
Requires:	php-gd
Peter 'Pessoft' Kolínek ed273b
Requires:	php-xml
Peter 'Pessoft' Kolínek ed273b
Requires:	php-json
b1c053
Requires:	php-geshi
Peter 'Pessoft' Kolínek ed273b
Requires:	php-simplepie
b1c053
Requires:	php-email-address-validation
Peter 'Pessoft' Kolínek ed273b
Requires:	php-lessphp
Peter 'Pessoft' Kolínek ed273b
Requires:	php-paragonie-random-compat
Peter 'Pessoft' Kolínek ed273b
Requires:	php-phpseclib
b1c053
b1c053
%description
Peter 'Pessoft' Kolínek d6f5ed
DokuWiki is a standards compliant, simple to use Wiki, mainly aimed at creating
Peter 'Pessoft' Kolínek d6f5ed
documentation of any kind. It has a simple but powerful syntax which makes sure
Peter 'Pessoft' Kolínek d6f5ed
the data-files remain readable outside the Wiki and eases the creation of
Peter 'Pessoft' Kolínek d6f5ed
structured texts.
b1c053
Peter 'Pessoft' Kolínek d6f5ed
All data is stored in plain text files no database is required.
b1c053
b2edf8
%package selinux
b2edf8
Summary:	SElinux support for dokuwiki
b2edf8
Requires:	%name = %version-%release
Adam Tkac bf610a
Requires:	policycoreutils
Peter 'Pessoft' Kolínek d6f5ed
%if 0%{?rhel} > 5 || 0%{?fedora}
cdb50a
Requires:	python2-policycoreutils
Adam Tkac bf610a
%endif
Adam Tkac bf610a
Group:		Applications/Internet
b2edf8
BuildArch:	noarch
b2edf8
b2edf8
%description selinux
b2edf8
Configures DokuWiki to run in SELinux enabled environments.
b2edf8
b1c053
%prep
88d46a
%setup -q -n %{name}-%{releasenum}
Adam Tkac 4a2b63
Adam Tkac 4a2b63
# Remove bundled code
Peter 'Pessoft' Kolínek ed273b
#  email-address-validator
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/aziraphale
Peter 'Pessoft' Kolínek ed273b
#  geshi
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/geshi
Peter 'Pessoft' Kolínek ed273b
#  lesserphp
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/marcusschwarz
Peter 'Pessoft' Kolínek ed273b
#  random_compat
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/paragonie
Peter 'Pessoft' Kolínek ed273b
#  phpseclib
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/phpseclib
Peter 'Pessoft' Kolínek ed273b
#  simplepie
Peter 'Pessoft' Kolínek ed273b
rm -r vendor/simplepie
Adam Tkac 4a2b63
Adam Tkac bdc4db
%patch1 -p1 -b .bundled
b2edf8
b1c053
mv -f conf/mysql.conf.php.example .
b1c053
b1c053
sed -i "s:'./data':'%{_localstatedir}/lib/%{name}/data':" conf/%{name}.php
b1c053
sed -i "s:ALL        8:ALL        1:" conf/acl.auth.php.dist
b1c053
b1c053
cat <<eof>%{name}.httpd
b1c053
b1c053
Alias /%{name} %{_datadir}/%{name}
b1c053
b1c053
<directory %{_datadir}="" %{name}="">
d0a14c
	<ifmodule mod_authz_core.c="">
d0a14c
		# Apache 2.4
d0a14c
		Require local
d0a14c
	</ifmodule>
d0a14c
	<ifmodule !mod_authz_core.c="">
d0a14c
		# Apache 2.2
d0a14c
		Options +FollowSymLinks
d0a14c
		Order Allow,Deny
d0a14c
		Allow from 127.0.0.1 ::1
d0a14c
	</ifmodule>
b1c053
</directory>
b1c053
Peter 'Pessoft' Kolínek ed273b
<directory %{_datadir}="" %{name}="" bin="">
b1c053
	Order Deny,Allow
b1c053
	Deny from all
b1c053
</directory>
b1c053
Peter 'Pessoft' Kolínek ed273b
<directory %{_datadir}="" %{name}="" conf="">
b1c053
	Order Deny,Allow
b1c053
	Deny from all
b1c053
</directory>
b1c053
Peter 'Pessoft' Kolínek ed273b
<directory %{_datadir}="" %{name}="" inc="">
Peter 'Pessoft' Kolínek ed273b
	Order Deny,Allow
ad46a9
	Deny from all
ad46a9
</directory>
ad46a9
Peter 'Pessoft' Kolínek ed273b
<directory %{_datadir}="" %{name}="" vendor="">
b1c053
	Order Deny,Allow
b1c053
	Deny from all
b1c053
</directory>
b1c053
b1c053
EOF
b1c053
b2edf8
cat <<eof>DOKUWIKI-SELINUX.README
b2edf8
%{name}-selinux
b2edf8
====================
b2edf8
b2edf8
This package configures dokuwiki to run in
b2edf8
SELinux enabled environments
b2edf8
b2edf8
EOF
b2edf8
b1c053
%build
b1c053
# nothing to do here
b1c053
b1c053
%install
b1c053
install -d -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
b1c053
install -d -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
b1c053
install -d -p $RPM_BUILD_ROOT%{_datadir}/%{name}
b1c053
install -d -p $RPM_BUILD_ROOT%{_datadir}/%{name}/bin
b1c053
install -d -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
76baa0
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/data/{index,tmp,media,attic,pages,cache,meta,locks,media_attic,media_meta}
b1c053
rm -f install.php
b1c053
rm -f inc/.htaccess
b1c053
rm -f inc/lang/.htaccess
Peter 'Pessoft' Kolínek ed273b
rm -f vendor/.htaccess
b1c053
cp -rp data/pages/* $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/data/pages/
b1c053
cp -rp conf/* $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
b1c053
cp -rp bin/*  $RPM_BUILD_ROOT%{_datadir}/%{name}/bin
b1c053
cp -rp lib  $RPM_BUILD_ROOT%{_datadir}/%{name}/
b1c053
cp -rp inc  $RPM_BUILD_ROOT%{_datadir}/%{name}/
Peter 'Pessoft' Kolínek ed273b
cp -rp vendor  $RPM_BUILD_ROOT%{_datadir}/%{name}/
b1c053
install -p -m0644 *.php $RPM_BUILD_ROOT%{_datadir}/%{name}
b1c053
install -p -m0644 %{name}.httpd $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
b1c053
b1c053
pushd $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
b1c053
for d in *.dist; do
b1c053
	d0=`basename $d .dist`
b1c053
	if [ ! -f "$d0" ]; then
b1c053
		mv -f $d $d0
b1c053
	fi
b1c053
done
b1c053
popd
b1c053
b1c053
pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
b1c053
	ln -sf ../../../etc/%name conf
b1c053
popd
b1c053
b2edf8
%post selinux
Adam Tkac 654932
semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}(/.*)?' 2>/dev/null || :
b2edf8
semanage fcontext -a -t httpd_sys_content_t '%{_datadir}/%{name}(/.*)?' 2>/dev/null || :
Adam Tkac 654932
semanage fcontext -a -t httpd_sys_rw_content_t '%{_datadir}/%{name}/lib/plugins(/.*)?' 2>/dev/null || :
b2edf8
restorecon -R '%{_sysconfdir}/%{name}' || :
b2edf8
restorecon -R '%{_datadir}/%{name}' || :
b2edf8
b2edf8
%postun selinux
b2edf8
if [ $1 -eq 0 ] ; then
Adam Tkac 654932
semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}(/.*)?' 2>/dev/null || :
b2edf8
semanage fcontext -d -t httpd_sys_content_t '%{_datadir}/%{name}(/.*)?' 2>/dev/null || :
Adam Tkac 654932
semanage fcontext -d -t httpd_sys_rw_content_t '%{_datadir}/%{name}/lib/plugins(/.*)?' 2>/dev/null || :
b2edf8
fi
b2edf8
b2edf8
b1c053
%files
b1c053
%doc COPYING README VERSION mysql.conf.php.example
b1c053
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
b1c053
%config(noreplace) %attr(0644,apache,apache) %{_sysconfdir}/%{name}/*
b1c053
%dir %attr(0755,apache,apache) %{_sysconfdir}/%{name}
b1c053
%attr(0755,apache,apache) %{_datadir}/%{name}/bin/*.php
b1c053
%dir %{_datadir}/%{name}
b1c053
%{_datadir}/%{name}/conf
b1c053
%{_datadir}/%{name}/*.php
b1c053
%dir %{_datadir}/%{name}/lib
b1c053
%{_datadir}/%{name}/lib/exe
b1c053
%{_datadir}/%{name}/lib/images
b1c053
%{_datadir}/%{name}/lib/index.html
b1c053
%{_datadir}/%{name}/lib/scripts
b1c053
%{_datadir}/%{name}/lib/styles
b1c053
%{_datadir}/%{name}/lib/tpl
b1c053
%attr(0755,apache,apache) %dir %{_datadir}/%{name}/lib/plugins
b1c053
%{_datadir}/%{name}/lib/plugins/*
b1c053
%{_datadir}/%{name}/inc
Peter 'Pessoft' Kolínek ed273b
%{_datadir}/%{name}/vendor
b1c053
%dir %{_localstatedir}/lib/%{name}
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/media
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/attic
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/cache
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/meta
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/locks
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/tmp
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/index
76baa0
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/media_attic
76baa0
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/media_meta
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/pages
b1c053
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/%{name}/data/pages/wiki
b1c053
%{_localstatedir}/lib/%{name}/data/pages/*/*
b1c053
b2edf8
%files selinux
b2edf8
%doc DOKUWIKI-SELINUX.README
b2edf8
b1c053
%changelog
Peter 'Pessoft' Kolínek d6f5ed
* Fri Jul 13 2018 Peter 'Pessoft' Kolínek <fedora@pessoft.com> - 0-0.33.20180422a
Peter 'Pessoft' Kolínek ed273b
- Update to the latest stable upstream 2018-04-22a "Greebo" (#1390291: CVE-2016-7964, CVE-2016-7965, CVE-2017-12583, CVE-2017-12979, CVE-2017-12980, CVE-2017-18123)
Peter 'Pessoft' Kolínek ed273b
- Fix missing vendor directory issue (#1372948)
Peter 'Pessoft' Kolínek ed273b
- Fix Apache config file for access to conf and bin
Peter 'Pessoft' Kolínek ed273b
- Replace more bundled code in vendor directory with Fedora packages (lesserphp, random_compat, phpseclib, simplepie)
Peter 'Pessoft' Kolínek ed273b
- Fix source to HTTPS
Peter 'Pessoft' Kolínek ed273b
117d7b
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.32.20150810a
117d7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
117d7b
cdb50a
* Fri Mar 30 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0-0.31.20150810a
cdb50a
- Update Python 2 dependency declarations to new packaging standards
cdb50a
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
cdb50a
a20262
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.30.20150810a
a20262
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a20262
a5b57b
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.29.20150810a
a5b57b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a5b57b
73fe9a
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.28.20150810a
73fe9a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
73fe9a
dd4584
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.27.20150810a
dd4584
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
dd4584
Adam Tkac bdc4db
* Wed Sep 30 2015 Adam Tkac <vonsch@gmail.com> - 0.0.26.20150810a
Adam Tkac bdc4db
- update to the latest upstream
Adam Tkac bdc4db
415998
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.25.20140929c
415998
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
415998
d1553c
* Tue Mar 03 2015 Adam Tkac <vonsch@gmail.com> - 0.0.24.20140929c
d1553c
- update to the latest upstream (CVE-2015-2172)
d1553c
Adam Tkac 654932
* Fri Dec 26 2014 Adam Tkac <vonsch@gmail.com> - 0.0.23.20140929b
Adam Tkac 654932
- update to the latest upstream
Adam Tkac 654932
- drop requirement of httpd (#1164396)
Adam Tkac 654932
- fix SELinux file contexts (#1064524)
Adam Tkac 654932
- require php-xml (#1061477)
Adam Tkac 654932
34fae1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.22.20131208
34fae1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
34fae1
eb2c09
* Thu Dec 12 2013 Adam Tkac <vonsch@gmail.com> - 0-0.21.20131208
18fdb2
- fix upstream source link
88d46a
- use macros for dokuwiki release numbers
eb2c09
- update to the latest upstream
18fdb2
Adam Tkac bf610a
* Tue Sep 03 2013 Adam Tkac <vonsch@gmail.com> - 0-0.20.20130510a
Adam Tkac bf610a
- fix Requires for EL5, #967975 (patch by Charles R. Anderson)
Adam Tkac bf610a
Adam Tkac 823bdc
* Tue Sep 03 2013 Adam Tkac <vonsch@gmail.com> - 0-0.19.20121013
Adam Tkac 823bdc
- update to the latest upstream
Adam Tkac 823bdc
Adam Tkac 823bdc
* Tue Sep 03 2013 Adam Tkac <vonsch@gmail.com> - 0-0.18.20121013
Adam Tkac 4a2b63
- remove bundled code in specfile instead of via patch
Adam Tkac 4a2b63
926c8f
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.17.20121013
926c8f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
926c8f
760560
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.16.20121013
760560
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
760560
87ba3f
* Sun Dec 02 2012 Johan Cwiklinski <johan at="" x-tnd="" dot="" be=""> - 0-0.15.20121013
87ba3f
- Fix apache config file for httpd 2.4, #871388
d0a14c
76baa0
* Sat Oct 20 2012 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.14.20121013
76baa0
- Latest upstream
76baa0
- Fix Bugzilla bugs #844726, #840255, #795487, #741384, #840686, #835145
76baa0
37b276
* Thu Aug 02 2012 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.13.20120125.b
37b276
- Latest upstream
37b276
- Fix Bugzilla bugs #844726, #840255, #795487, #741384, #840686, #835145
Peter 'Pessoft' Kolínek d6f5ed
7b8eb2
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.12.20110525.a
7b8eb2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
7b8eb2
645bf2
* Tue Apr 24 2012 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.11.20110525.a
645bf2
- Fix CVE-2012-2129
645bf2
- Fix Bugzilla bugs #815123
645bf2
4fa3d3
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.10.20110525.a
4fa3d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4fa3d3
a8a42a
* Tue Jun 28 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.9.20110525.a
873802
- Upgrade to latest upstream
873802
- Fix Bugzilla bugs #717146, #717149, #717148, #715569
4aeb10
a8a42a
* Sun Mar 13 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.8.20101107.a
a8a42a
- Fix genshi path
a8a42a
a8a42a
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.7.20101107.a
a8a42a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a8a42a
a8a42a
* Mon Jan 17 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.6.20101107.a
a8a42a
- Fix selinux sub package
a8a42a
b2edf8
* Mon Jan 17 2011 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.5.20101107.a
b2edf8
- Upgrade to latest upstream
b2edf8
- Split package to create selinux package
b2edf8
- Fix Bugzilla bug #668386
b2edf8
610a18
* Tue Jan 19 2010 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.4.20091225.c
610a18
- Fix CSRF bug Secunia advisory SA38205, dokuwiki bug #1853
610a18
- Fix Security ACL bypass bug Secunia advisory SA38183, dokuwiki bug #1847
610a18
- Upgrade to the latest upstream
610a18
- Fix bugzilla bug #556494
610a18
dca4bb
* Tue Dec 15 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.3.20091202.rc
dca4bb
- Fix versioning
dca4bb
ad46a9
* Fri Dec 04 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.1.20091202.rc
ad46a9
- Upgrade to new upstream
dca4bb
- Fix bugzilla bug #544257
ad46a9
b1c053
* Fri Aug 07 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.2.20090214.b
b1c053
- Fixes requested by reviewer
b1c053
b1c053
* Thu Aug 06 2009 Andrew Colin Kissa <andrew@topdog.za.net> - 0-0.1.20090214.b
b1c053
- Initial package