# vim: set nowrap: %define _binary_payload w6.xzdio %global debug_package %{nil} %define app mediawiki %define branch REL1_43 Name: %{app}-x Conflicts: %{app} Provides: %{app} Version: 1.43.0 Release: 28%{?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, openssl, bash, diffutils, git Requires: sqlite >= 3.8.0 Requires: httpd Requires: mod_ssl Requires: mod_proxy_html 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} # valid on fedpkg #[ /builddir/build/BUILD/%{name}-%{version}-build/%{app}-%{version} = $PWD ] || exit 1 %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" # rpmuncompress not available on rhel #/usr/lib/rpm/rpmuncompress -xC "$_" "$T" if [ x1 = x"$(tar --exclude="*/*" -tf "$T" | wc -l)" ]; then tar -x -o -C extensions/"$1" -f "$T" --strip-components=1 else tar -x -o -C extensions/"$1" -f "$T" fi 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 -f svg -b lightgray -a -w $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 # valid on fedpkg #[ /builddir/build/BUILD/%{name}-%{version}-build/%{app}-%{version} = $PWD ] || exit 1 l() { mkdir -p %{buildroot}$2 mv $1 $_/%{app} ln -sf $2/%{app} $1 } # app mkdir -p %{buildroot}%{_datadir}/webapps/ cd $_ mv $OLDPWD %{app} # workaround copr rhel Executing(%%clean) error "/builddir/build/BUILD/mediawiki-1.43.0" No such file or directory mkdir -p $OLDPWD 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 # rhel coreutils 8.32 option -h --no-dereference not available find \ %{buildroot}%{_localstatedir}/db/%{app} \ %{buildroot}%{_sharedstatedir}/%{app} \ %{buildroot}%{_localstatedir}/cache/%{app} \ -not -type l -exec chmod go= {} \; %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 find \ %{_localstatedir}/db/%{app} \ %{_localstatedir}/cache/%{app} \ %{_sharedstatedir}/%{app} \ -not -type l -exec chown apache:apache {} \; \ || : %preun find \ %{_localstatedir}/db/%{app} \ %{_localstatedir}/cache/%{app} \ %{_sharedstatedir}/%{app} \ -not -type l -exec chown root:root {} \; \ || : %changelog