# 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: 17%{?dist} License: GPL-2.0-or-later Summary: custom MediaWiki instance URL: https://www.%{app}.org/w/index.php?title=MediaWiki 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: 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 # Source3: related-list.svg # Source4: bible-2.svg # Source5: 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 Requires: php-pecl-apcu Requires: php-fpm Requires: php-gd Requires: php-pecl-igbinary Requires: php-intl Requires: php-pdo %description %prep %setup -q -n %{app}-%{version} [ /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" /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 [ /builddir/build/BUILD/%{name}-%{version}-build/%{app}-%{version} = $PWD ] || exit 1 mkdir -p %{buildroot}%{_datadir}/webapps/%{app} cd $_ mv $OLDPWD/* ./ rmdir $OLDPWD p() { find "$1" -type d -exec chmod 0700 {} \; find "$1" -type f -exec chmod 0600 {} \; } l() { mkdir -p %{buildroot}$2 mv $1 $_/%{app} p $_ ln -sf $2/%{app} $1 } l cache %{_localstatedir}/cache l images %{_sharedstatedir} mkdir -p %{buildroot}%{_sysconfdir}/%{app} ln -sf %{_sysconfdir}/%{app}/LocalSettings.php ./ mkdir -p %{buildroot}%{_localstatedir}/db/%{app} p $_ %files %{_datadir}/webapps/%{app}/* %config(missingok) %{_datadir}/webapps/%{app}/LocalSettings.php %dir %{_sysconfdir}/%{app} %dir %{_localstatedir}/db/%{app} %{_localstatedir}/cache/%{app}/.htaccess %{_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