# vim: set nowrap: %global debug_package %{nil} %define app mediawiki %define branch REL1_43 Name: %{app}-x Conflicts: %{app} Provides: %{app} Version: 1.43.0 Release: 20%{?dist} License: GPL-2.0-or-later Summary: custom MediaWiki instance URL: https://www.%{app}.org/w/index.php?title=MediaWiki # https://www.mediawiki.org/wiki/Download Source0: https://releases.wikimedia.org/%{app}/1.43/%{app}-%{version}.tar.gz # https://www.svgheart.com/product/tree-with-leaves-free-svg-file/ # FreeAccount+Cart+ReceiveEmail+Download Source1: tree.svg # https://www.iconarchive.com/show/library-icons-by-robinweatherall/books-icon.html Source2: https://www.iconarchive.com/download/i51988/robinweatherall/library/books.ico # https://www.svgrepo.com/svg/NUMBER/NAME # search "svgrepo+ID" # https://www.svgrepo.com/svg/374395/related-list # https://www.svgrepo.com/svg/478565/bible-2 # https://www.svgrepo.com/svg/520719/expand # Source3: related-list.svg # Source4: bible-2.svg # Source5: expand.svg Source3: https://www.svgrepo.com/download/374395/related-list.svg Source4: https://www.svgrepo.com/download/478565/bible-2.svg Source5: https://www.svgrepo.com/download/520719/expand.svg Patch: 1.patch BuildRequires: curl BuildRequires: librsvg2-tools Requires: glibc, bash, diffutils, git Requires: httpd, openssl Requires: sqlite >= 3.8.0 Requires: nodejs Requires: python3, python3-pillow Requires: perl, pcre >= 8.33 Requires: php >= 8.1.0, php-fpm Requires: php-bcmath Requires: php-gd Requires: php-intl Requires: php-pdo Requires: php-pecl-apcu Requires: php-pecl-igbinary Requires: php-pecl-memcached Requires: php-pecl-zip %description %prep %setup -q -n %{app}-%{version} if [ -v ETC_MOCK_SITE_DEFAULTS_HELLO ]; then [ /builddir/build/BUILD/%{name}-%{version}-build/%{app}-%{version} = $PWD ] || exit 1 fi %autopatch -p0 t() { # third-party extension T="$1".tar.gz if [ -v ETC_MOCK_SITE_DEFAULTS_HELLO ]; then # busybox httpd -f -vv -p 127.0.0.1:45573 -h ~/copr/mediawiki-x/S curl -Lo "$T" http://127.0.0.1:45573/"$T" || exit 1 else curl -Lo "$T" "$2" || exit 1 fi mkdir -p extensions/"$1" /usr/lib/rpm/rpmuncompress -xC "$_" "$T" rm "$T" } e() { # official extension t "$1" https://gerrit.wikimedia.org/r/plugins/gitiles/%{app}/extensions/"$1"/+archive/refs/heads/%{branch}.tar.gz } t "SimpleTooltip" https://codeload.github.com/Universal-Omega/SimpleTooltip/tar.gz/refs/heads/master e CodeMirror e MobileFrontend e RegularTooltips e RelatedArticles e SandboxLink e Variables r() { I=%{_sourcedir}/$2.svg O=resources/assets/$2.svg [ x"image/svg+xml" = x"$(file --mime-type -b $I)" ] || exit 1 if [ x"0" = x"$1" ]; then cp $I $O else rsvg-convert -fsvg -blightgray -aw$1 -o $O $I fi } r 28 related-list r 22 bible-2 r 0 expand r 0 tree mv %{_sourcedir}/books.ico favicon.ico %build %install if [ -v ETC_MOCK_SITE_DEFAULTS_HELLO ]; then [ /builddir/build/BUILD/%{name}-%{version}-build/%{app}-%{version} = $PWD ] || exit 1 fi l() { mkdir -p %{buildroot}$2 mv $1 $_/%{app} ln -sf $2/%{app} $1 } # app mkdir -p %{buildroot}%{_datadir}/webapps/ cd $_ mv $OLDPWD %{app} cd %{app} # etc ln -sf %{_sysconfdir}/%{app}/LocalSettings.php ./ mkdir -p %{buildroot}%{_sysconfdir}/%{app} # db mkdir -p %{buildroot}%{_localstatedir}/db/%{app} # lib cache l images %{_sharedstatedir} l cache %{_localstatedir}/cache # db lib cache chmod -hRv g=,o= %{buildroot}%{_localstatedir}/db/%{app} chmod -hRv g=,o= %{buildroot}%{_sharedstatedir}/%{app} chmod -hRv g=,o= %{buildroot}%{_localstatedir}/cache/%{app} %files %{_datadir}/webapps/%{app}/* %config(missingok) %{_datadir}/webapps/%{app}/LocalSettings.php %dir %{_sysconfdir}/%{app} %dir %{_localstatedir}/db/%{app} %dir %{_localstatedir}/cache/%{app} %{_localstatedir}/cache/%{app}/.htaccess %dir %{_sharedstatedir}/%{app} %{_sharedstatedir}/%{app}/.htaccess %{_sharedstatedir}/%{app}/README #%%pre #selinuxenabled && exit 1 #[ Enforcing = "$(getenforce)" ] && exit 1 %post pwd chown -hRv apache:apache %{_localstatedir}/db/%{app} || : chown -hRv apache:apache %{_localstatedir}/cache/%{app} || : chown -hRv apache:apache %{_sharedstatedir}/%{app} || : %preun pwd chown -hRv root:root %{_localstatedir}/db/%{app} || : chown -hRv root:root %{_localstatedir}/cache/%{app} || : chown -hRv root:root %{_sharedstatedir}/%{app} || : %changelog